dlmGibbsDIG {dlm} | R Documentation |
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)
y |
data vector or univariate time series |
mod |
a dlm for univariate observations |
a.y |
prior mean of observation variance |
b.y |
prior variance of observation variance |
a.theta |
prior mean of system variances |
b.theta |
prior variance of system variances |
shape.y |
shape parameter of the prior of observation variance |
rate.y |
rate parameter of the prior of observation variance |
shape.theta |
shape parameter of the prior of system variances |
rate.theta |
rate parameter of the prior of system variances |
n.sample |
requested number of Gibbs iterations |
thin |
discard thin iterations for every saved iteration |
ind |
indicator of the system variances that need to be estimated |
save.states |
should the simulated states be included in the output |
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.
The function returns a list of simulated values.
dV |
simulated values of the observation variance. |
dW |
simulated values of the unknown diagonal elements of the system variance. |
theta |
simulated values of the state vectors. |
Giovanni Petris GPetris@uark.edu
## See the package vignette for an example