Releases: stan-dev/cmdstanr
cmdstanr v0.5.0
Bug fixes
-
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+.
New features
-
Default directory changed to
.cmdstaninstead of.cmdstanrso that
CmdStanPy and CmdStanR can use the same CmdStan installations. Using.cmdstanr
will 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'sdiagnose
method 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 the
exe_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)
cmdstanr v0.4.0
Bug fixes
-
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 features
-
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 specifying
max_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)
cmdstanr v0.3.0
Bug fixes
-
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 thendatahad to either be NULL or be a non-empty list, but nowlist()
is allowed. (#403)
New features
-
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_matrix
objects. (#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)
cmdstanr v0.2.2
cmdstanr v0.2.0
You can install version 0.2.0 using either of the following lines:
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
remotes::install_github("stan-dev/cmdstanr", ref = "v0.2.0")Bug fixes
-
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_dir
in 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)
New features
-
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)
cmdstanr v0.1.0 (beta release)
Overview
CmdStanR is a lightweight interface to Stan for R users (see CmdStanPy for Python).
We recommend starting with these vignettes:
Goals
-
A clean interface to Stan services so that CmdStanR can keep up with Stan
releases. -
R code that doesn't interface directly with C++, only calls compiled executables.
-
Modularity: CmdStanR runs Stan's algorithms and lets downstream modules do the
analysis. -
Flexible BSD-3 license.
Installation
You can install the beta release of the cmdstanr R package with
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))or you can install the latest development version from GitHub:
# install.packages("devtools")
devtools::install_github("stan-dev/cmdstanr")