Learn R Programming

eDMA (version 1.5-4)

SimulateDLM: 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)

Value

An object of the class list.

Arguments

iT

numeric, number of observation to simulate.

mX

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

vBeta0

numeric vector with initial value for the regressor coefficients.

mW

matrix covariance matrix of the state equation.

dV

numeric 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.

Author

Leopoldo Catania & Nima Nonejad

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 iT x ncol(mX) of regressor coefficients.

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. tools:::Rd_expr_doi("10.18637/jss.v084.i11").

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

Examples

Run this code

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

Run the code above in your browser using DataLab