| initialize_prior | R Documentation |
Initializes the prior distributions.
initialize_prior(model, settings, lambda_d = 100, lambda_t = 100, df = 6)
model |
state space model object, returned by the function
|
settings |
list with model setting, in the format returned by the
function |
lambda_d |
drift smoothing constant (default: 100) |
lambda_t |
trend smoothing constant (default: 100) |
df |
degrees of freedom for inverse gamma distributions |
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.
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
|
distribution |
name of prior distribution |
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.