Learn R Programming

dlm (version 0.7-1)

dlmRandom: Random DLM

Description

Generate a random (constant or time-varying) object of class "dlm", together with states and observations from it.

Usage

dlmRandom(m, p, nobs = 0, JFF, JV, JGG, JW)

Arguments

m
Dimension of the observation vector.
p
Dimension of the state vector.
nobs
Number of states and observations to simulate from the model.
JFF
Should the model have a time-varying FF component?
JV
Should the model have a time-varying V component?
JGG
Should the model have a time-varying GG component?
JW
Should the model have a time-varying W component?

Value

  • The function returns a list with the following components.
  • modAn object of class "dlm".
  • thetaMatrix of simulated state vectors from the model.
  • yMatrix of simulated observations from the model.
  • If nobs is zero, only the mod component is returned.

Details

The function generates randomly the system and oservation matrices and the variances of a DLM having the specified state and observation dimension. The system matrix GG is guaranteed to have eigenvalues strictly less than one, which means that a constant DLM is asymptotically stationary. The default behavior is to generate a constant DLM. If JFF is TRUE then a model for nobs observations in which all the elements of FF are time-varying is generated. Similarly with JV, JGG, and JW.

References

Anderson and Moore, Optimal filtering, Prentice-Hall (1979)

See Also

dlm

Examples

Run this code
dlmRandom(1, 3, 5)

Run the code above in your browser using DataLab