SimulateDLM: Simulate from DLM of West and Harrison (1999).

View source: R/RcppExports.R

SimulateDLMR Documentation

Simulate from DLM of West and Harrison (1999).

Description

Simulate from DLM of West and Harrison (1999), as in Section 2 of Catania and Nonejad (2016).

Usage

    SimulateDLM(iT, mX, vBeta0, mW, dV, dPhi)

Arguments

iT

numeric, positive integer number of observations to simulate.

mX

matrix of dimension iT x N where N is the number of covariates.

vBeta0

numeric vector with initial value for the regressor coefficients.

mW

matrix symmetric positive-semidefinite covariance matrix of the state equation. Zero and rank-deficient covariance matrices are supported.

dV

numeric nonnegative variance of the observation (measurement equation).

dPhi

numeric value for the autoregressive parameter of the regressors. It imposes that all the regressors have the same autoregressive parameters, if dPhi = 1, then the regressors evolve as random-walks.

Details

The function returns a list of two elements: vY and mBeta. vY is a iT x 1 numeric vector of simulated dependent variables. mBeta is a matrix of dimension ncol(mX) x iT of regressor coefficients.

Value

An object of the class list.

Author(s)

Leopoldo Catania

References

Catania, Leopoldo, and Nima Nonejad (2018). "Dynamic Model Averaging for Practitioners in Economics and Finance: The eDMA Package." Journal of Statistical Software, 84(11), 1-39. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v084.i11")}.

West, Mike. Bayesian forecasting. John Wiley & Sons, Inc., 1999.

Examples


set.seed(7892)

iT <- 500
iK <- 3

dV <- 0.1
mW <- diag(iK + 1) * 0.01
dPhi <- 1

vBeta0 <- rep(0, iK + 1)
mX <- cbind(1, matrix(rnorm(iT * (iK)), iT, iK))

lOut <- SimulateDLM(iT, mX, vBeta0, mW, dV, dPhi)
vY <- lOut$vY


eDMA documentation built on Oct. 19, 2026, 5:07 p.m.