Generate a random (constant or time-varying) object of class
"dlm"
, along with states and observations from it.
dlmRandom(m, p, nobs = 0, JFF, JV, JGG, JW)
dimension of the observation vector.
dimension of the state vector.
number of states and observations to simulate from the model.
should the model have a time-varying FF
component?
should the model have a time-varying V
component?
should the model have a time-varying GG
component?
should the model have a time-varying W
component?
The function returns a list with the following components.
An object of class "dlm"
.
Matrix of simulated state vectors from the model.
Matrix of simulated observations from the model.
The function generates randomly the system and observation 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 implies 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
.
Anderson and Moore, Optimal filtering, Prentice-Hall (1979)
# NOT RUN {
dlmRandom(1, 3, 5)
# }
Run the code above in your browser using DataLab