-
Lists of matrices/vectors and data frames can now be supplied for variables declared as
intin the Stan program. Previously these worked only forrealvariables and errored forintones. (#817) -
Data frame columns that are not numeric, integer, logical, or factor are now an error. Previously
data.matrix()silently coerced them, so a character column reached Stan as alphabetically ordered integer codes. Convert the column explicitly, e.g. withas.integer(), if integer codes are what you want. (#1225) -
Lists of logical vectors/matrices are now converted to integers like logical variables are, instead of erroring. (#1225)
-
Supplying a factor for a variable not declared as
intis now an error. (#1225) -
Factors are now accepted for length-1
intarrays (e.g.array[1] int x), which previously errored. (#1225) -
The
CMDSTANR_NO_VER_CHECKR option and environment variable are deprecated as of CmdStanR 1.0.0; use the lowercasecmdstanr_no_ver_checkforms instead. -
$compile()now works with namedstanc_optionsvalues such ascanonicalize. The values were shell-quoted for Make and the same quoted strings were also passed tostancdirectly, which rejected them. (#1227) -
$compile()now enablesallow-undefinedfor user headers supplied throughcpp_options, not just through theuser_headerargument. (#1227) -
stancfailures during$compile()are now reported immediately, with thestancerror message. Previously they surfaced several steps later. (#1227) -
Errors for include paths that do not exist now report the resolved absolute path. (#1227)
-
Numeric
stanc_optionsvalues such aslist("max-line-length" = 78)are no longer dropped. (#1233) -
CmdStanModel methods now correctly handle
#includedirectories with spaces in their paths. (#820) -
$include_paths()now returns absolute paths, and relative include paths are resolved when the model object is created or$compile()is called rather than on eachstanccall. Previously a model created from a relative path could resolve#includedirectives against the wrong directory if the working directory changed. (#1229) -
$cpp_options()no longer includes aSTAN_VERSIONentry read from the model executable's metadata. It was never a C++ option; use$cmdstan_version()instead. (#1215) -
CmdStanModel methods now use executable metadata regardless of the capitalization of C++ option names. Any executable reporting threading enabled requires the corresponding
threadsorthreads_per_chainargument. (#765, #1100) -
Pathfinder fits used as initial values now use uniform weights when CmdStan already PSIS-resampled their draws, avoiding a second application of importance weights. (#1206)
-
Pathfinder fits used as initial values now correctly treat draws with different initialization parameter values as distinct even when their log weights are equal, and collapse duplicate resampled draws while retaining their selection frequency. (#1207)
-
pathfinder()now passes separately supplied initial values to every path instead of using only the first path's initial values. (#1206) -
pathfinder()now respectssave_single_paths = TRUEinstead of always passing0to CmdStan. -
pathfinder()now usesthreadsargument (num_threadsis deprecated), to be consistent with other methods. -
The
num_pathsdocumentation forpathfinder()now notes that running multiple paths in parallel requires compiling withcpp_options = list(stan_threads = TRUE)and settingthreads. (#896) -
The
save_latent_dynamicsargument is now limited to$sample(),$sample_mpi(), and$variational(), matching the CmdStan algorithms that support diagnostic CSV output. -
Informative error when exposing functions using names that are reserved keywords (@VisruthSK, #1154)
-
save_cmdstan_configandsave_metricdefault toFALSEbut can be set toTRUEfor an entire R session via new global options. (#1159) -
The compilation spinner can now be disabled for an entire R session by setting the new
cmdstanr_spinnerglobal option toFALSE. The spinner shown while installing or rebuilding CmdStan and while checking syntax also respects this option, and is no longer shown when knitting. (#486) -
save_metric_files()now gives an informative error when metric files were not created and keeps saved metric files after the fitted model is garbage-collected. (#1021) -
cmdstan_model()no longer fails whenMAKEFLAGSenables directory-printing output while readingSTANCFLAGSfrommake. (#1163) -
cmdstan_model()now retains include paths when initialized with both a Stan file and a precompiled executable (#1094). -
$generate_quantities()now also acceptsCmdStanMLE,CmdStanLaplace, andCmdStanPathfinderfitted model objects asfitted_params. (#1203) -
$generate_quantities()now reports per-process execution times with CmdStan 2.39 or newer, andread_cmdstan_csv()returns these times from standalone generated quantities CSV files. (#1168) -
laplace()no longer overwrites the internally generated optimizer CSV whenmode = NULLandoutput_basenameis supplied. The internally generated optimizer CSV now uses the filename<output_basename>-mode-1.csv. -
CmdStanModel objects created using
compile_model_methods = TRUEthat are then saved and reloaded no longer error in model fitting methods. Model methods are recompiled lazily if needed. (#1158) -
CmdStan versions older than 2.35.0 are no longer supported. (#1144)
-
Minimum R version increased to 4.0.0. (#1144)
-
Removed legacy Windows toolchain paths for older CmdStan releases. (#1144)
-
CMDSTANR_USE_MSYS_TOOLCHAINis now deprecated and ignored (with a warning). (#1144) -
Removed deprecated items (replacements in parentheses). (#1061)
read_sample_csv()(read_cmdstan_csv())write_stan_tempfile()(write_stan_file())jacobian_adjustmentargument tofit$log_prob()and similar methods (jacobianargument)output_samplesargument tomodel$variational()(drawsargument)hessianargument tofit$init_model_methods()(hessianmethod always compiled now)- several arguments to
model$compile():threads(cpp_options = list(stan_threads = TRUE))compile_hessian_method(always compiled)
- several arguments to
model$sample():coresandnum_cores(parallel_chains)num_chains(chains)num_warmup(iter_warmup)num_samples(iter_sampling)validate_csv(diagnostics)save_extra_diagnostics(save_latent_dynamics)max_depth(max_treedepth)stepsize(step_size)
- Added compatibility for RTools45 (#1066)
- cmdstanr will now use RTools with no additional toolchain updates needed on Windows (CmdStan 2.35+ only; #1065, #1054)
- Improve error messages when calling
sampler_diagnostics()withfixed_param=TRUE - Improve numerical stability in calculation of effective sample size during
loomethod (#1057) - Improve numerical stablity with very small log-ratios in calculation of effective sample size during
loomethod (#1015) - Add warning if input data/inits have been coerced to ints (#994)
- Don't require fixed_param for models with zero parameters (only GQs) for CmdStan >= 2.36 (#1046)
- Improve detection/handling of
make(#1036) - Fix saving of model objects to network drive (#1038, thanks to @bschneidr)
- Update usage of
untarto fix installation errors (#1034) - Respect compilation flags in
make/localwhen exposing functions or model methods (#1003) - Fix passing of include paths to CmdStan (#1000)
- Fix passing of factor data to CmdStan (#999)
- Fix extraction and passing of array data/parameters as model inits (#993)
- Clarifications to usage of
optimizeandloomethods (#1060) - Add documentation for faster model saving with large models (#1042)
- Remove mentions of
rstan::read_stan_csvdue to incompatibility with newer CmdStan outputs (#1018) - Document global option
cmdstanr_print_line_numbersfor printing line numbers (#1017) - Change usage of 'chapter' to 'section' in documentation (#1014)
- Remove examples of updating removed array syntax as functionality no longer supported in CmdStan (#1008)
- Change usages of 'sampling statement' -> 'distribution statement' (#987)
- Added
CMDSTANR_USE_RTOOLSenvironment variable to force stock RTools on Windows by @andrjohns in #980 - Added support for Windows ARM64 by @andrjohns in #990
- Automatically initialise model methods when called, add
inc_warmupargument to$unconstrain_draws()by @andrjohns in #985
- Fix errors when using pathfinder object as initial values by @avehtari in #984
- Fix error with
$unconstrain_draws()returning incorrect assumptions in some cases by @andrjohns in #983 - Fix spurious errors about missing CmdStan config files by @andrjohns in #981
- Fix linking error when exposing SUNDIALS/KINSOL functions or model methods by @andrjohns in #977
- Fix long-standing error with OneDrive paths on Windows by @andrjohns in #990
- Add functionality for passing
CmdStanFitobjects as initial values by @SteveBronder in #937
- Add compatibility with CmdStan 2.35 by @andrjohns in #972
- Add
show_messagesandshow_exceptionsarguments to all methods for controlling output by @andrjohns in #897 - Drop RcppEigen dependency, implement basic Eigen -> C++ interop by @andrjohns in #899
- Add compatibility with CmdStan 2.34 by @andrjohns in #905 #910
- Add a format argument to the
unconstrain_draws()method to specify draws format of return by @andrjohns in #886 - Align
cmdstanrEBFMI diagnostic threshold with CmdStan by @andrjohns in #892 - Add global option
cmdstanr_print_line_numbersto add line number to model printing by @sbfnk in #967 - Add new CmdStan arguments
save_metricandsave_cmdstan_configby @venpopov in #932 - Add documentation for CmdStanR global options by @jgabry in #951
- Add documentation for how to obtain structured output similar to
rstan::extract()using a combination ofcmdstanrandposteriorby @jgabry in #955 - Added coercion generics for CmdStanFit objects by @gowerc in #943
psis_resampleandcalculate_lparguments added to Pathfinder method by @SteveBronder in #903- Documentation and tests for LOO method updated by @jgabry in #923
- Global option
cmdstanr_warn_initsadded to disable warnings about partially specified initial values by @jgabry in #913 - Updates to MCMC
output_dirdocumentation by @jgabry in #929
- Fix broken link in OpenCL documentation by @eipi10 in #908
- Fix a minor typo in the README by @jgabry in #911
- Make exported RNG functions respect changes to R's seed by @andrjohns in #973
- Optimisations for model methods functions by @andrjohns in #960
- Bugfix for passing function for initial values with Pathfinder method and default
num_pathsby @andrjohns in #964 - Continue with compilation if
compile_stanalone=TRUEbut no functions are found by @jgabry in #956 - Update tests and CI for compatibility with MacOS ARM64 by @andrjohns in #958
- Fix handling of
inv_metricargument with only 1 parameter by @venpopov in #935 - Fixes for compatibility with RTools44 by @andrjohns in #952 #959
- New
laplacemethod by @jgabry in #800 - New
pathfindermethod by @SteveBronder in #848
- Add missing link to diagnose method in CmdStanModel doc by @jgabry in #833
- Improvements to compile tests by @martinmodrak in #836
- Changed the delay behavior in wsl_installed by @martinmodrak in #839
- Update array syntax in website vignette by @andrjohns in #841
- Compatibility fixes for cmdstan 2.33+ by @jgabry in #843
- Suggest format method after error due to old syntax by @jgabry in #852
- Clarifications in R-markdown vignette by @jgcolman in #854
- Update linux/wsl detection for install arch by @andrjohns in #856
- Fix handling of single-length inits for containers by @andrjohns in #857
- Add support/tests for exposing functions with tuples by @andrjohns in #860
- Add support/tests for exporting functions with complex types by @andrjohns in #861
- Add option for installing from release archive by @andrjohns in #866
- Improve Pathfinder doc by @avehtari in #875
- Rename
jacobian_adjustmentargument tojacobianby @jgabry in #879 - Fix get_cmdstan_flags('STANCFLAGS') in recursive make by @pearsonca in #881
- Store return codes instead of always querying exit status by @jgabry in #798
- enable jacobian argument for optimization by @jgabry in #799
- Fix init_model_methods for models with no data by @andrjohns in #801
- Document a CmdStan-focused way to pre-compile Stan models in R packages by @wlandau in #809
- Describe how to efficiently save model fit objects by @wlandau in #816
- fix errors in doc for new methods by @jgabry in #823
- Give informative error when exposing stan functions with precompiled model by @andrjohns in #831
- Bugfixes in .stanfunctions, hessian model method, and exposing RNG functions by @andrjohns in #811
- Fix variable_skeleton() with containers by @andrjohns in #832
- Improve handling of user header by @martinmodrak in #818
- change duplicate stdout_file to stderr_file by @jgabry in #834
- New
expose_functions()method to expose Stan functions to R by @andrjohns in #702. See?expose_functions. - New methods for accessing log_prob, grad_log_prob, hessian, un/constrain variables by @andrjohns in #701. See
?init_model_methods.
- mod$variables works w includes in precompile state (fix #680) by @MKyhos in #682
- Update broken link for Stan OpenCL support page by @erictleung in #686
- Add newline to check syntax output by @rok-cesnovar in #689
- Allow exposing functions without sampling by @andrjohns in #705
- Expose skeleton by @andrjohns in #706
- WSL - Run cmdstan and models under WSL filesystem by @andrjohns in #696
- Bugfix - Deep copy method/function environments by @andrjohns in #709
- Add option for including jacobian adjustments in hessian method by @andrjohns in #710
- WSL Optimisations and Bugfixes for CI by @andrjohns in #711
- add stancflags from make/local by @rok-cesnovar in #690
- Update co-authors by @andrjohns in #715
- Update model methods parameter naming and extract skeleton function by @andrjohns in #724
- Add method for unconstraining all parameter draws by @andrjohns in #729
- Improve efficiency of variable matching by @sbfnk in #736
- Add verbosity to download output and errors by @andrjohns in #745
- Update handling of show_messages, add show_exceptions by @andrjohns in #746
- Rtools43 support by @andrjohns in #755
- Add stanc M1 make patch, suppress boost warnings by @andrjohns in #756
- more examples of summary method by @gravesti in #751
- Fix model$format and model$check_syntax for compiled models with include-paths by @adrian-lison in #775
- Generalise RTools config/support by @andrjohns in #777
- New posterior vignette by @gravesti in #719
- Add moment-matching support to $loo() method by @andrjohns in #778
- replace \ with function by @jsocolar in #789
- On Windows, users can now install and use CmdStan with WSL (Windows
Subsystem for Linux). Set
wsl=TRUEininstall_cmdstan()to install CmdStan for use with WSL. This can offer significant speedups compared to native Windows execution. (#677, @andrjohns)
-
In
cmdstan_default_path()we now ignore directories inside.cmdstanthat don't start with"cmdstan-". (#651) -
Fixed Windows issue related to not locating
grep.exeor when it is located in a path with spaces. (@weshinsley, #661, #663) -
Fixed a bug with diagnostic checks when ebfmi is NaN.
-
Fixed a bug that caused issues when using
~or.in paths supplied to thecmdstanr_write_stan_file_dirglobal option. -
Fixed a bug that caused the
time()method fail when some of the chains failed to finish succesfully.
-
Refactored toolchain installation and checks for R 4.x on Windows and added support for Rtools42. (#645)
-
Expanded the use of
CMDSTANenvironment variable to point to CmdStan installation or directory containing CmdStan installations. (#643) -
New vignette on how to handle deprecations using the
$format()method. (#644)
- Temporarily disable
format="draws_rvars"in the$draws()method due to a bug. Until this is fixed users can make use ofposterior::as_draws_rvars()to convert draws from CmdStanR to thedraws_rvarsformat. (#640)
-
Fixed bug that caused stdour/stderr not being read at the end of optimization. (#522)
-
Fixed issue with handling
NAas the reported external process status. (#544, @myshkin) -
Fixed issue with handling models with no parameters and CmdStan 2.27+.
-
Default directory changed to
.cmdstaninstead of.cmdstanrso that CmdStanPy and CmdStanR can use the same CmdStan installations. Using.cmdstanrwill continue to be supported until version 1.0 butinstall_cmdstan()will now default to.cmdstanand CmdStanR will first look for.cmdstanbefore falling back on.cmdstanr. (#454) -
New method
diagnose()for CmdstanModel objects exposes CmdStan'sdiagnosemethod for comparing Stan's gradient computations to gradients computed via finite differences. (#485) -
New method
$variables()for CmdstanModel objects that returns a list of variables in the Stan model, their types and number of dimensions. Does not require the model to be compiled. (#519) -
New method
$format()for auto-formatting and canonicalizing the Stan models. (#625) -
Added the option to create
CmdStanModelfrom the executable only with theexe_fileargument. (#564) -
Added a convenience argument
user_headerto$compile()andcmdstan_model()that simplifies the use of an external .hpp file to compile with the model. -
Added the
cmdstanr_force_recompileglobal option that is used for forcing recompilation of Stan models. (#580) -
New method
$code()for all fitted model objects that returns the Stan code associated with the fitted model. (#575) -
New method
$diagnostic_summary()for CmdStanMCMC objects that summarizes the sampler diagnostics (divergences, treedepth, ebfmi) and can regenerate the related warning messages. (#205) -
New
diagnosticsargument for the$sample()method to specify which diagnostics are checked after sampling. Replacesvalidate_csvargument. (#205) -
Added E-BFMI checks that run automatically post sampling. (#500, @jsocolar)
-
New methods for
posterior::as_draws()for CmdStanR fitted model objects. These are just wrappers around the$draws()method provided for convenience. (#532) -
write_stan_file()now choose file names deterministically based on the code so that models do not get unnecessarily recompiled when calling the function multiple times with the same code. (#495, @martinmodrak) -
The
dirargument forwrite_stan_file()can now be set with a global option. (#537) -
write_stan_json()now handles data of class"table". Tables are converted to vector, matrix, or array depending on the dimensions of the table. (#528) -
Improved processing of named lists supplied to the
dataargument to JSON data files: checking whether the list includes all required elements/Stan variables; improved differentiating arrays/vectors of length 1 and scalars when generating JSON data files; generating floating point numbers with decimal points to fix issue with parsing large numbers. (#538) -
install_cmdstan()now automatically installs the Linux ARM CmdStan when Linux distributions running on ARM CPUs are detected. (#531) -
New function
as_mcmc.list()for converting CmdStanMCMC objects to mcmc.list objects from the coda package. (#584, @MatsuuraKentaro)
-
Fixed issue with retrieving draws with models with spaces in their names. (#453)
-
Fixed bug with spaces in path to the temporary folder on Windows. (#460)
-
Fixed issue with not reporting model executable name clashing with folder name. (#461)
-
New function
as_cmdstan_fit()that creates CmdStanMCMC/MLE/VB objects directly from CmdStan CSV files. (#412) -
read_cmdstan_csv()now also returns chain run times for MCMC sampling CSV files. (#414) -
Faster CSV reading for multiple chains. (#419)
-
New
$profiles()method for fitted model objects accesses profiling information from R if profiling used in the Stan program. Support for profiling Stan programs requires CmdStan >= 2.26. (#434) -
New vignette on profiling Stan programs. (#435)
-
New vignette on running Stan on the GPU with OpenCL. OpenCL device ids can now also be specified at runtime. (#439)
-
New check for invalid parameter names when supplying init values. (#452, @mike-lawrence)
-
Suppressing compilation messages when not in interactive mode. (#462, @wlandau)
-
New
error_on_NAargument forcmdstan_version()to optionally returnNULL(instead of erroring) if the CmdStan path is not found (#467, @wlandau). -
Global option
cmdstanr_max_rowscan be set as an alternative to specifyingmax_rowsargument to the$print()method. (#470) -
New
output_basenameargument for the model fitting methods. Can be used in conjunction withoutput_dirto get completely predictable output CSV file paths. (#471) -
New
formatargument for$draws(),$sampler_diagnostics(),read_cmdstan_csv(), andas_cmdstan_fit(). This controls the format of the draws returned or stored in the object. Changing the format can improve speed and memory usage for large models. (#482)
-
Fixed reading inverse mass matrix with values written in scientific format in the CSV. (#394)
-
Fixed error caused by an empty data list. Previously if a model didn't require data then
datahad to either be NULL or be a non-empty list, but nowlist()is allowed. (#403)
-
Added
$sample_mpi()for MCMC sampling with MPI. (#350) -
Added informative messages on compile errors caused by precompiled headers (PCH). (#384)
-
Added the
cmdstanr_verboseoption for verbose mode. Intended for troubleshooting, debugging and development. See end of How does CmdStanR work? vignette for details. (#392) -
New
$loo()method for CmdStanMCMC objects. Requires computing pointwise log-likelihood in Stan program. (#366) -
The
fitted_paramsargument to the$generate_quantities()method now also accepts CmdStanVB,posterior::draws_array, andposterior::draws_matrixobjects. (#390) -
The
$optimize()method now supports all of CmdStan's tolerance-related arguments for (L)BFGS. (#398) -
The documentation for the R6 methods now uses
@param, which allows package developers to import the CmdStanR documentation using roxygen2's@inheritParams. (#408)
-
Fixed bug with reading Stan CSV when grep used coloring by default (#364,#371)
-
Depend on posterior v0.1.3 to avoid a potential error in
$summary(). (#383)
-
Added support for native execution on the macOS with the M1 ARM-based CPU. (#375)
-
Added threading support via
threadsargument for$optimize()and$variational()(was already available viathreads_per_chainfor$sample()). (#369)
-
Fixed bug with processing stanc_options in
check_syntax(). (#345) -
Fixed bug on access to one variable via
draws(). (#348)
compile()andcheck_syntax()methods gain argumentpedanticfor turning on pedantic mode, which warns about issues with the model beyond syntax errors. (#361)
-
Fix potential indexing error if using
read_cmdstan_csv()with CSV files created by CmdStan without CmdStanR. (#291, #292, @johnlees) -
Fix error when returning draws or sampler diagnostics for a fit with only warmup and no samples. (#288, #293)
-
Fix trailing slashes issue for
dirincmdstan_model()andoutput_dirin fitting methods. (#281, #294) -
Fix dimensions error when processing a list of matrices passed in as
data. (#296, #302) -
Fix reporting of time after using
fixed_parammethod. (#303, #307) -
With
refresh = 0, no output other than error messages is printed with$optimize()and$variational(). (#324) -
Fix issue where names of generated files could clash. (#326, #328)
-
Fix missing
include_pathsin$syntax_check(). (#335, @mike-lawrence)
-
CSV reading is now faster by using
data.table::fread(). (#318) -
install_cmdstan()gains argumentversionfor specifying which version of CmdStan to install. (#300, #308) -
New function
check_cmdstan_toolchain()that checks if the appropriate toolchains are available. (#289) -
$sample()method for CmdStanModel objects gains argumentchain_idsfor specifying custom chain IDs. (#319) -
Added support for the
sig_figsargument in CmdStan versions 2.25 and above. (#327) -
Added checks if the user has the necessary permissions in the RTools and temporary folders. (#343)
- New
$check_syntax()method for CmdStanModel objects. (#276, #277)
-
User is notified by message at load time if a new release of CmdStan is available. (#265, #273)
-
write_stan_file()replaceswrite_stan_tempfile(), which is now deprecated. With the addition of thedirargument, the file written is not necessarily temporary. (#267, #272)
- New knitr engine
eng_cmdstan()and functionregister_knitr_engine()that allow Stan chunks in R markdown documents to be processed using CmdStanR instead of RStan. The new vignette R Markdown CmdStan Engine provides a demonstration. (#261, #264, @bearloga)
- Beta release