stan or sampling for
final inferences and only using vb to get a rough idea of the parameter
distributions.## S3 method for class 'stanmodel':
vb(object, data = list(), pars = NA, include = TRUE,
seed = sample.int(.Machine$integer.max, 1),
init = 'random',
check_data = TRUE, sample_file = tempfile(fileext = '.csv'),
algorithm = c("meanfield", "fullrank"), ...)stanmodel .list or environment
providing the data for the model or a character vector
for all the names of objects used as data.
See the notes in stan.NA, then a character vector naming parameters,
which are included in the output if include = TRUE and excluded
if include = FALSE. By default, all parameters are included.parsas.integer will be applied to
it. If as.integer produc0, string "0" or "random",
a function that returns a list, or a named list of initial parameter
values.
"0": initialize all to be zero on the unconstrained support;
"TRUE, the data would be preprocessed;
otherwise not. If the data is not checked and preprocessed, it is safe
to leave it to be the default TRUE. See the notes in
staniter(positiveinteger), the maximum number of iterations,
defaults to 10000.grad_samples(positiveintegerstanfit-classstanmodel
The manuals of CmdStan and Stan.m <- stan_model(model_code = 'parameters {real y;} model {y ~ normal(0,1);}')
f <- vb(m)Run the code above in your browser using DataLab