Package description

An overview of the package and how it differs from RStan.

cmdstanr-package

CmdStanR: the R interface to CmdStan

Installing and setting the path to CmdStan

Install CmdStan, assuming the necessary C++ toolchain.

install_cmdstan() rebuild_cmdstan() cmdstan_make_local() check_cmdstan_toolchain()

Install CmdStan or clean and rebuild an existing installation

set_cmdstan_path() cmdstan_path() cmdstan_version()

Get or set the file path to the CmdStan installation

Running CmdStan from R

Run CmdStan from R.

cmdstan_model()

Create a new CmdStanModel object

CmdStanModel

CmdStanModel objects

model-method-check_syntax

Check syntax of a Stan program

model-method-compile

Compile a Stan program

model-method-generate-quantities

Run Stan's standalone generated quantities method

model-method-optimize

Run Stan's optimization algorithms

model-method-sample

Run Stan's MCMC algorithms

model-method-variational

Run Stan's variational approximation algorithms

cmdstanr_example() print_example_program()

Fit models for use in examples

Fitted model objects and methods

CmdStanMCMC

CmdStanMCMC objects

CmdStanMLE

CmdStanMLE objects

CmdStanVB

CmdStanVB objects

CmdStanGQ

CmdStanGQ objects

fit-method-cmdstan_summary

Run CmdStan's stansummary and diagnose

fit-method-draws

Extract posterior draws

fit-method-init

Extract initial values

fit-method-inv_metric

Extract inverse metric (mass matrix)

fit-method-lp

Extract log probability (target)

fit-method-metadata

Extract metadata from CmdStan CSV files

fit-method-mle

Extract (penalized) maximum likelihood estimate after optimization

fit-method-output

Access console output

fit-method-return_codes

Extract return codes from CmdStan

fit-method-sampler_diagnostics

Extract sampler diagnostics

fit-method-save_object

Save fitted model object to a file

fit-method-save_output_files

Save output and data files

fit-method-summary

Compute a summary table of MCMC estimates and diagnostics

fit-method-time

Report timing of CmdStan runs

Other tools for working with CmdStan

read_cmdstan_csv()

Read CmdStan CSV files into R

write_stan_json()

Write data to a JSON file readable by CmdStan

write_stan_file()

Write Stan code to a file

Knitr engine for CmdStanR

register_knitr_engine()

Register CmdStanR's knitr engine for Stan

eng_cmdstan()

CmdStan knitr engine for Stan