check_prior: Check prior distributions

View source: R/check_prior.R

check_priorR Documentation

Check prior distributions

Description

Check prior distributions

Usage

check_prior(priors = NULL)

Arguments

priors

(list) a list of arguments specifying priors for each parameter involved in the model (see Details). If priors=NULL then predefined priors will be returned.

Details

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.

Value

a matrix contatining priors (numeric codes, see Details) and their parameters

Examples


## 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)

ssMousetrack documentation built on April 4, 2025, 1:43 a.m.