The function implements a Gibbs sampler for a univariate DLM having one or more unknown variances in its specification.
dlmGibbsDIG(y, mod, a.y, b.y, a.theta, b.theta, shape.y, rate.y,
shape.theta, rate.theta, n.sample = 1,
thin = 0, ind, save.states = TRUE,
progressBar = interactive())
The function returns a list of simulated values.
simulated values of the observation variance.
simulated values of the unknown diagonal elements of the system variance.
simulated values of the state vectors.
data vector or univariate time series
a dlm for univariate observations
prior mean of observation precision
prior variance of observation precision
prior mean of system precisions (recycled, if needed)
prior variance of system precisions (recycled, if needed)
shape parameter of the prior of observation precision
rate parameter of the prior of observation precision
shape parameter of the prior of system precisions (recycled, if needed)
rate parameter of the prior of system precisions (recycled, if needed)
requested number of Gibbs iterations
discard thin
iterations for every saved iteration
indicator of the system variances that need to be estimated
should the simulated states be included in the output?
should a text progress bar be displayed during execution?
Giovanni Petris GPetris@uark.edu
The d-inverse-gamma model is a constant univariate DLM with unknown
observation variance, diagonal system variance with unknown diagonal
entries. Some of these entries may be known, in which case they are
typically zero. Independent inverse gamma priors are assumed for the
unknown variances. These can be specified be mean and variance or,
alternatively, by shape and rate. Recycling is applied for the prior
parameters of unknown system variances. The argument ind
can
be used to specify the index of the unknown system variances, in case
some of the diagonal elements of W
are known. The unobservable
states are generated in the Gibbs sampler and are returned if
save.states = TRUE
. For more details on the model and usage
examples, see the package vignette.
Giovanni Petris (2010), An R Package for Dynamic Linear
Models. Journal of Statistical Software, 36(12), 1-16.
https://www.jstatsoft.org/v36/i12/.
Petris, Petrone, and Campagnoli, Dynamic Linear Models with
R, Springer (2009).
## See the package vignette for an example
Run the code above in your browser using DataLab