check_prior | R Documentation |
Check prior distributions
check_prior(priors = NULL)
priors |
(list) a list of arguments specifying priors for each parameter involved in the model (see Details). If |
The function is used to specify the prior-related arguments of the state-space modeling function run_ssm
. Priors are specified in terms of distributions and associated parameters as implemented in the rstan package.
The available options are as follows:
lognormal(mu,sigma)
(code = 1, required parameters = 2)
normal(mu,sigma)
(code = 2, required parameters = 2)
normal(mu,sigma)T(min,max)
(code = 201, required parameters = 4)
chi_square(df)
(code = 3, required parameters = 1)
inv_chi_square(df)
(code = 4, required parameters = 1)
gamma(alpha,beta)
(code = 5, required parameters = 2)
pareto(min,alpha)
(code = 6, required parameters = 2)
uniform(min,max)
(code = 7, required parameters = 2)
This is an internal function, generally not to be called by the user.
a matrix contatining priors (numeric codes, see Details) and their parameters
## Not run:
## Define priors for all the paramaters
priors_list <- list("lognormal(1,1)","normal(2,3)T(0,10)","normal(3,1)")
priors_out <- check_prior(priors_list)
print(priors_out)
## Define priors for some of the paramaters
priors_list <- list(NULL,"pareto(1,1.2)",NULL)
priors_out <- check_prior(priors_list)
print(priors_out)
## Use pre-defined vague priors for all the parameters
priors_list <- list(NULL,NULL,NULL)
priors_out <- check_prior(priors_list)
print(priors_out)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.