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. "Dynamic Model Averaging for Practitioners in Economics and Finance: The eDMA Package." arXiv preprint arXiv:1606.05656 (2016).

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 


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


## End(Not run)


eDMA documentation built on May 19, 2017, 3:18 p.m.
Search within the eDMA package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.