@@ -1149,6 +1149,8 @@ sample <- function(data = NULL,
11491149 show_messages = TRUE ,
11501150 show_exceptions = TRUE ,
11511151 diagnostics = c(" divergences" , " treedepth" , " ebfmi" ),
1152+ save_metric = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL },
1153+ save_cmdstan_config = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL },
11521154 # deprecated
11531155 cores = NULL ,
11541156 num_cores = NULL ,
@@ -1240,7 +1242,8 @@ sample <- function(data = NULL,
12401242 term_buffer = term_buffer ,
12411243 window = window ,
12421244 fixed_param = fixed_param ,
1243- diagnostics = diagnostics
1245+ diagnostics = diagnostics ,
1246+ save_metric = save_metric
12441247 )
12451248 args <- CmdStanArgs $ new(
12461249 method_args = sample_args ,
@@ -1260,7 +1263,8 @@ sample <- function(data = NULL,
12601263 output_basename = output_basename ,
12611264 sig_figs = sig_figs ,
12621265 opencl_ids = assert_valid_opencl(opencl_ids , self $ cpp_options()),
1263- model_variables = model_variables
1266+ model_variables = model_variables ,
1267+ save_cmdstan_config = save_cmdstan_config
12641268 )
12651269 runset <- CmdStanRun $ new(args , procs )
12661270 runset $ run_cmdstan()
@@ -1357,6 +1361,7 @@ sample_mpi <- function(data = NULL,
13571361 show_messages = TRUE ,
13581362 show_exceptions = TRUE ,
13591363 diagnostics = c(" divergences" , " treedepth" , " ebfmi" ),
1364+ save_cmdstan_config = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL },
13601365 # deprecated
13611366 validate_csv = TRUE ) {
13621367
@@ -1420,7 +1425,8 @@ sample_mpi <- function(data = NULL,
14201425 output_dir = output_dir ,
14211426 output_basename = output_basename ,
14221427 sig_figs = sig_figs ,
1423- model_variables = model_variables
1428+ model_variables = model_variables ,
1429+ save_cmdstan_config = save_cmdstan_config
14241430 )
14251431 runset <- CmdStanRun $ new(args , procs )
14261432 runset $ run_cmdstan_mpi(mpi_cmd , mpi_args )
@@ -1500,7 +1506,8 @@ optimize <- function(data = NULL,
15001506 tol_param = NULL ,
15011507 history_size = NULL ,
15021508 show_messages = TRUE ,
1503- show_exceptions = TRUE ) {
1509+ show_exceptions = TRUE ,
1510+ save_cmdstan_config = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL }) {
15041511 procs <- CmdStanProcs $ new(
15051512 num_procs = 1 ,
15061513 show_stderr_messages = show_exceptions ,
@@ -1541,7 +1548,8 @@ optimize <- function(data = NULL,
15411548 output_basename = output_basename ,
15421549 sig_figs = sig_figs ,
15431550 opencl_ids = assert_valid_opencl(opencl_ids , self $ cpp_options()),
1544- model_variables = model_variables
1551+ model_variables = model_variables ,
1552+ save_cmdstan_config = save_cmdstan_config
15451553 )
15461554 runset <- CmdStanRun $ new(args , procs )
15471555 runset $ run_cmdstan()
@@ -1632,7 +1640,8 @@ laplace <- function(data = NULL,
16321640 jacobian = TRUE , # different default than for optimize!
16331641 draws = NULL ,
16341642 show_messages = TRUE ,
1635- show_exceptions = TRUE ) {
1643+ show_exceptions = TRUE ,
1644+ save_cmdstan_config = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL }) {
16361645 if (cmdstan_version() < " 2.32" ) {
16371646 stop(" This method is only available in cmdstan >= 2.32" , call. = FALSE )
16381647 }
@@ -1706,7 +1715,8 @@ laplace <- function(data = NULL,
17061715 output_basename = output_basename ,
17071716 sig_figs = sig_figs ,
17081717 opencl_ids = assert_valid_opencl(opencl_ids , self $ cpp_options()),
1709- model_variables = model_variables
1718+ model_variables = model_variables ,
1719+ save_cmdstan_config = save_cmdstan_config
17101720 )
17111721 runset <- CmdStanRun $ new(args , procs )
17121722 runset $ run_cmdstan()
@@ -1786,7 +1796,8 @@ variational <- function(data = NULL,
17861796 output_samples = NULL ,
17871797 draws = NULL ,
17881798 show_messages = TRUE ,
1789- show_exceptions = TRUE ) {
1799+ show_exceptions = TRUE ,
1800+ save_cmdstan_config = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL }) {
17901801 procs <- CmdStanProcs $ new(
17911802 num_procs = 1 ,
17921803 show_stderr_messages = show_exceptions ,
@@ -1827,7 +1838,8 @@ variational <- function(data = NULL,
18271838 output_basename = output_basename ,
18281839 sig_figs = sig_figs ,
18291840 opencl_ids = assert_valid_opencl(opencl_ids , self $ cpp_options()),
1830- model_variables = model_variables
1841+ model_variables = model_variables ,
1842+ save_cmdstan_config = save_cmdstan_config
18311843 )
18321844 runset <- CmdStanRun $ new(args , procs )
18331845 runset $ run_cmdstan()
@@ -1929,7 +1941,8 @@ pathfinder <- function(data = NULL,
19291941 psis_resample = NULL ,
19301942 calculate_lp = NULL ,
19311943 show_messages = TRUE ,
1932- show_exceptions = TRUE ) {
1944+ show_exceptions = TRUE ,
1945+ save_cmdstan_config = if (cmdstan_version() > " 2.34.0" ) { TRUE } else { NULL }) {
19331946 procs <- CmdStanProcs $ new(
19341947 num_procs = 1 ,
19351948 show_stderr_messages = show_exceptions ,
@@ -1976,7 +1989,8 @@ pathfinder <- function(data = NULL,
19761989 sig_figs = sig_figs ,
19771990 opencl_ids = assert_valid_opencl(opencl_ids , self $ cpp_options()),
19781991 model_variables = model_variables ,
1979- num_threads = num_threads
1992+ num_threads = num_threads ,
1993+ save_cmdstan_config = save_cmdstan_config
19801994 )
19811995 runset <- CmdStanRun $ new(args , procs )
19821996 runset $ run_cmdstan()
0 commit comments