Package: cmdstanr 0.9.0

cmdstanr: R Interface to 'CmdStan'
A lightweight interface to 'Stan' <https://mc-stan.org>. The 'CmdStanR' interface is an alternative to 'RStan' that calls the command line interface for compilation and running algorithms instead of interfacing with C++ via 'Rcpp'. This has many benefits including always being compatible with the latest version of Stan, fewer installation errors, fewer unexpected crashes in RStudio, and a more permissive license.
Authors:
cmdstanr_0.9.0.tar.gz
cmdstanr_0.9.0.zip(r-4.6)cmdstanr_0.9.0.zip(r-4.5)cmdstanr_0.9.0.zip(r-4.4)
cmdstanr_0.9.0.tgz(r-4.5-any)cmdstanr_0.9.0.tgz(r-4.4-any)
cmdstanr_0.9.0.tar.gz(r-4.6-any)cmdstanr_0.9.0.tar.gz(r-4.5-any)
cmdstanr_0.9.0.tgz(r-4.5-emscripten)
cmdstanr.pdf |cmdstanr.html✨
cmdstanr/json (API)
NEWS
| # Install 'cmdstanr' in R: |
| install.packages('cmdstanr', repos = c('https://staging.r-multiverse.org', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/stan-dev/cmdstanr/issues
Pkgdown/docs site:https://mc-stan.org
bayesbayesianmarkov-chain-monte-carlomaximum-likelihoodmcmcstanvariational-inference
Last updated from:da99e2ba95 (on v0.9.0). Checks:7 NOTE, 2 OK. Indexed: no.
| Target | Result | Total time | Artifact |
|---|---|---|---|
| linux-devel-x86_64 | NOTE | 573 | |
| source / vignettes | OK | 378 | |
| linux-release-x86_64 | NOTE | 164 | |
| macos-release-arm64 | NOTE | 117 | |
| macos-oldrel-arm64 | NOTE | 151 | |
| windows-devel | NOTE | 978 | |
| windows-release | NOTE | 112 | |
| windows-oldrel | NOTE | 131 | |
| wasm-release | OK | 121 |
Exports:as_cmdstan_fitas_drawsas_mcmc.listas.CmdStanDiagnoseas.CmdStanGQas.CmdStanLaplaceas.CmdStanMCMCas.CmdStanMLEas.CmdStanPathfinderas.CmdStanVBcheck_cmdstan_toolchaincmdstan_default_install_pathcmdstan_default_pathcmdstan_make_localcmdstan_modelcmdstan_pathcmdstan_versioncmdstanr_exampledraws_to_csveng_cmdstaninstall_cmdstannum_threadsprint_example_programread_cmdstan_csvread_sample_csvrebuild_cmdstanregister_knitr_engineset_cmdstan_pathset_num_threadswrite_stan_filewrite_stan_jsonwrite_stan_tempfile
Dependencies:abindbackportscheckmateclidata.tabledistributionalgenericsgluejsonlitelifecyclemagrittrmatrixStatsnumDerivpillarpkgconfigposteriorprocessxpsR6rlangtensorAtibbleutf8vctrswithr
Getting started with CmdStanR
Rendered fromcmdstanr.Rmdusingknitr::rmarkdownon Oct 15 2025.Last update: 2024-07-31
Started: 2019-10-15
How does CmdStanR work?
Rendered fromcmdstanr-internals.Rmdusingknitr::rmarkdownon Oct 15 2025.Last update: 2023-12-13
Started: 2020-06-24
Profiling Stan programs with CmdStanR
Rendered fromprofiling.Rmdusingknitr::rmarkdownon Oct 15 2025.Last update: 2023-07-26
Started: 2021-01-25
R Markdown CmdStan Engine
Rendered fromr-markdown.Rmdusingknitr::rmarkdownon Oct 15 2025.Last update: 2023-09-26
Started: 2020-08-03
Working with Posteriors
Rendered fromposterior.Rmdusingknitr::rmarkdownon Oct 15 2025.Last update: 2024-04-23
Started: 2023-06-26
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| CmdStanR: the R interface to CmdStan | cmdstanr-package CmdStanR cmdstanr |
| Create a 'draws' object from a CmdStanR fitted model object | as_draws as_draws.CmdStanGQ as_draws.CmdStanLaplace as_draws.CmdStanMCMC as_draws.CmdStanMLE as_draws.CmdStanPathfinder as_draws.CmdStanVB |
| Convert 'CmdStanMCMC' to 'mcmc.list' | as_mcmc.list |
| Coercion methods for CmdStan objects | as.CmdStanDiagnose as.CmdStanGQ as.CmdStanLaplace as.CmdStanMCMC as.CmdStanMLE as.CmdStanPathfinder as.CmdStanVB cmdstan_coercion |
| Create a new CmdStanModel object | cmdstan_model |
| CmdStanDiagnose objects | CmdStanDiagnose |
| CmdStanGQ objects | CmdStanGQ |
| CmdStanLaplace objects | CmdStanLaplace |
| CmdStanMCMC objects | CmdStanMCMC |
| CmdStanMLE objects | CmdStanMLE |
| CmdStanModel objects | CmdStanModel |
| CmdStanPathfinder objects | CmdStanPathfinder |
| Fit models for use in examples | cmdstanr_example print_example_program |
| CmdStanR global options | cmdstanr_global_options |
| CmdStanVB objects | CmdStanVB |
| Write posterior draws objects to CSV files suitable for running standalone generated quantities with CmdStan. | draws_to_csv |
| CmdStan knitr engine for Stan | eng_cmdstan |
| Run CmdStan's 'stansummary' and 'diagnose' utilities | cmdstan_diagnose cmdstan_summary fit-method-cmdstan_diagnose fit-method-cmdstan_summary |
| Return Stan code | code fit-method-code |
| Transform a set of unconstrained parameter values to the constrained scale | constrain_variables fit-method-constrain_variables |
| Sampler diagnostic summaries and warnings | diagnostic_summary fit-method-diagnostic_summary |
| Extract posterior draws | draws fit-method-draws |
| Calculate the log-probability and the gradient w.r.t. each input for a given vector of unconstrained parameters | fit-method-grad_log_prob grad_log_prob |
| Extract gradients after diagnostic mode | fit-method-gradients gradients |
| Calculate the log-probability , the gradient w.r.t. each input, and the hessian for a given vector of unconstrained parameters | fit-method-hessian hessian |
| Extract user-specified initial values | fit-method-init init |
| Compile additional methods for accessing the model log-probability function and parameter constraining and unconstraining. | fit-method-init_model_methods init_model_methods |
| Extract inverse metric (mass matrix) after MCMC | fit-method-inv_metric inv_metric |
| Calculate the log-probability given a provided vector of unconstrained parameters. | fit-method-log_prob log_prob |
| Leave-one-out cross-validation (LOO-CV) | fit-method-loo loo |
| Extract log probability (target) | fit-method-lp lp lp_approx |
| Extract metadata from CmdStan CSV files | fit-method-metadata metadata |
| Extract point estimate after optimization | fit-method-mle mle |
| Extract number of chains after MCMC | fit-method-num_chains num_chains |
| Access console output | fit-method-output output |
| Return profiling data | fit-method-profiles profiles |
| Extract return codes from CmdStan | fit-method-return_codes return_codes |
| Extract sampler diagnostics after MCMC | fit-method-sampler_diagnostics sampler_diagnostics |
| Save fitted model object to a file | fit-method-save_object save_object |
| Save output and data files | config_files data_file fit-method-data_file fit-method-latent_dynamics_files fit-method-output_files fit-method-profile_files fit-method-save_config_files fit-method-save_data_file fit-method-save_latent_dynamics_files fit-method-save_metric_files fit-method-save_output_files fit-method-save_profile_files latent_dynamics_files metric_files output_files profile_files save_config_files save_data_file save_latent_dynamics_files save_metric_files save_output_files save_profile_files |
| Compute a summary table of estimates and diagnostics | fit-method-print fit-method-summary print.CmdStanMCMC print.CmdStanMLE print.CmdStanVB summary |
| Report timing of CmdStan runs | fit-method-time time |
| Transform all parameter draws to the unconstrained scale | fit-method-unconstrain_draws unconstrain_draws |
| Transform a set of parameter values to the unconstrained scale | fit-method-unconstrain_variables unconstrain_variables |
| Return the variable skeleton for 'relist' | fit-method-variable_skeleton variable_skeleton |
| Install CmdStan or clean and rebuild an existing installation | check_cmdstan_toolchain cmdstan_make_local install_cmdstan rebuild_cmdstan |
| Check syntax of a Stan program | check_syntax model-method-check_syntax |
| Compile a Stan program | compile model-method-compile |
| Run Stan's diagnose method | diagnose model-method-diagnose |
| Expose Stan functions to R | expose_functions fit-method-expose_functions model-method-expose_functions |
| Run stanc's auto-formatter on the model code. | format model-method-format |
| Run Stan's standalone generated quantities method | generate_quantities model-method-generate-quantities |
| Run Stan's Laplace algorithm | laplace model-method-laplace |
| Run Stan's optimization algorithms | model-method-optimize optimize |
| Run Stan's Pathfinder Variational Inference Algorithm | model-method-pathfinder pathfinder |
| Run Stan's MCMC algorithms | model-method-sample sample |
| Run Stan's MCMC algorithms with MPI | model-method-sample_mpi sample_mpi |
| Input and output variables of a Stan program | model-method-variables variables |
| Run Stan's variational approximation algorithms | model-method-variational variational |
| Read CmdStan CSV files into R | as_cmdstan_fit read_cmdstan_csv |
| Register CmdStanR's knitr engine for Stan | register_knitr_engine |
| Get or set the file path to the CmdStan installation | cmdstan_path cmdstan_version set_cmdstan_path |
| Write Stan code to a file | write_stan_file |
| Write data to a JSON file readable by CmdStan | write_stan_json |
