get_model | R Documentation |
The functions get_model
, get_time
, get_params
, get_sim
, and get_seed_best_run
provide convenient access to specific components of model output objects of class SANmcmc
(fitted via MCMC) or SANvi
(fitted via variational inference).
Specifically:
get_model
: returns a character string specifying the model type used;
get_time
: returns the total runtime of the estimation procedure;
get_params
: returns a list containing data and prior hyperparameters;
get_sim
: returns the fitted quantities, such as posterior draws (MCMC) or variational estimates (VI);
get_seed_best_run
: (only for SANvi
) returns the random seed associated with the run that achieved the highest ELBO.
get_model(object, ...)
## S3 method for class 'SANvi'
get_model(object, ...)
## S3 method for class 'SANmcmc'
get_model(object, ...)
get_time(object, ...)
## S3 method for class 'SANvi'
get_time(object, ...)
## S3 method for class 'SANmcmc'
get_time(object, ...)
get_params(object, ...)
## S3 method for class 'SANvi'
get_params(object, ...)
## S3 method for class 'SANmcmc'
get_params(object, ...)
get_sim(object, ...)
## S3 method for class 'SANvi'
get_sim(object, ...)
## S3 method for class 'SANmcmc'
get_sim(object, ...)
get_seed_best_run(object, ...)
## S3 method for class 'SANvi'
get_seed_best_run(object, ...)
object |
An object of class |
... |
ignored. |
The requested component from the fitted model object. See the function descriptions above for details.
set.seed(123)
y <- c(rnorm(40, 0, 0.3), rnorm(20, 5, 0.3))
g <- c(rep(1:6, each = 10))
out <- fit_fSAN(y = y, group = g, est_method = "MCMC",
mcmc_param = list(nrep = 500, burn = 200))
get_model(out)
get_time(out)
hp <- get_params(out)
sims <- get_sim(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.