stan_opts | R Documentation |
Defines a list specifying the arguments passed to underlying stan
backend functions via stan_sampling_opts()
and stan_vb_opts()
. Custom
settings can be supplied which override the defaults.
stan_opts(
object = NULL,
samples = 2000,
method = c("sampling", "vb", "laplace", "pathfinder"),
backend = c("rstan", "cmdstanr"),
init_fit = NULL,
return_fit = TRUE,
...
)
object |
Stan model object. By default uses the compiled package
default if using the "rstan" backend, and the default model obtained using
|
samples |
Numeric, default 2000. Overall number of posterior samples. When using multiple chains iterations per chain is samples / chains. |
method |
A character string, defaulting to sampling. Currently supports MCMC sampling ("sampling") or approximate posterior sampling via variational inference ("vb") and, as experimental features if the "cmdstanr" backend is used, approximate posterior sampling with the laplace algorithm ("laplace") or pathfinder ("pathfinder"). |
backend |
Character string indicating the backend to use for fitting stan models. Supported arguments are "rstan" (default) or "cmdstanr". |
init_fit |
|
return_fit |
Logical, defaults to TRUE. Should the fit stan model be returned. |
... |
Additional parameters to pass to underlying option functions,
|
A <stan_opts>
object of arguments to pass to the appropriate
rstan functions.
stan_sampling_opts()
stan_vb_opts()
# using default of [rstan::sampling()]
stan_opts(samples = 1000)
# using vb
stan_opts(method = "vb")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.