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

Description Usage Arguments Details Value Author(s) References Examples

View source: R/RcppExports.R

Description

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

Usage

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

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.

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.

Value

An object of the class list.

Author(s)

Leopoldo Catania & Nima Nonejad

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. doi: 10.18637/jss.v084.i11.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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 May 2, 2019, 1:43 p.m.