initialize_prior {sectorgap}R Documentation

Prior distribution

Description

Initializes the prior distributions.

Usage

initialize_prior(model, settings, lambda_d = 100, lambda_t = 100, df = 6)

Arguments

model

state space model object, returned by the function define_ssmodel

settings

list with model setting, in the format returned by the function initialize_settings

lambda_d

drift smoothing constant (default: 100)

lambda_t

trend smoothing constant (default: 100)

df

degrees of freedom for inverse gamma distributions

Details

All loadings and autoregressive parameters are assumed to be normal with mean zero and variance 1000.

All variance parameters are assumed to be inverse gamma distributed. The cycle variance has prior mean 1, and the trend variances have prior mean 1/100.

The normal distribution is parametrized via mean and variance.

the inverse gamma distribution is parametrized degrees of freedom nu and scale s.

The mean of the inverse gamma distribution is given by beta / (alpha - 1) = beta / 2 = s, where s = 2 beta, nu = 2 alpha.

Value

A data frame with one row per parameter and the following columns:

variable

name of endogneous variable of equation

parameter_name

name of parameter

par1

first parameter of specified distribution, mean for normal parameters and scale for inverse gamma parameters

par2

second parameter of specified distribution, variance for normal parameters and degrees of freedom for inverse gamma parameters

ini

initial value for Gibbs sampler, i.e. mean of distribution given par1 and par2

distribution

name of prior distribution

Examples

data("data_ch")
settings <- initialize_settings()
data <- prepate_data(
  settings = settings,
  tsl = data_ch$tsl,
  tsl_n = data_ch$tsl_n
)
model <- define_ssmodel(
  settings = settings, 
  data = data
)
prior <- initialize_prior(
  model = model, 
  settings = settings
) 

[Package sectorgap version 0.1.0 Index]