estimate_ssmodel {sectorgap} | R Documentation |
Bayesian estimation via Gibbs sampling
Description
Estimates the parameters and states of a multi-dimensional state space model by Bayesian methods using a Gibbs sampling procedure.
Usage
estimate_ssmodel(
model,
settings,
data,
prior = initialize_prior(model),
R = 10000,
burnin = 0.5,
thin = 1,
HPDIprob = 0.68,
fit = NULL
)
Arguments
model |
state space model object, returned by the function
|
settings |
list with model setting, in the format returned by the
function |
data |
list with at least two named components: |
prior |
list of matrices, each list item corresponds to one endogenous
variable. See |
R |
number of draws, the default is |
burnin |
share of draws as burnin period, the default is |
thin |
thinning parameter defining how many draws are discarded.
|
HPDIprob |
probability of highest posterior density interval, the
default is |
fit |
already fitted object of class |
Details
If fit
is supplied, the function will continue drawing
R
additional repetitions. In this case, all input variables except
for fit
and R
are ignored.
Value
An object of class ss_fit
.
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
)
fit <- estimate_ssmodel(
model = model,
settings = settings,
data = data,
prior = prior,
R = 100
)