Description Usage Arguments Details Value Author(s) Examples
This function generates data from a user-specified Vector Autoregression (VAR)
1 2 | rvar(nobs, coefficients, intercept, vcv, nburn = 1000,
y0 = matrix(0, nlag, neq))
|
nobs |
Integer; the number of observations to generate. |
coefficients |
A list of numeric vectors; each vector specifies the coefficients of one of the VAR equations. |
intercept |
A numeric vector containing the intercepts. |
vcv |
A numeric matrix representing the variance-covariance matrix of the innovations. |
nburn |
An integer, the number of draws to discard before generating draws from the VAR. |
y0 |
A matrix containing the inital values of the series. |
Let β_1 represent the first element of the coefficients list and suppose that there are k equations with l lags. The first equation of the DGP is
y[t,1] = intercept[1] + c(y[t-(1:l),1],…,y[t-(1:l),k]) %*% coefficients[[1]] + epsilon[t,1]
.
A data frame with nobs rows containing the generated series and all of their lags. This is redundant information, but makes it easier to use these results directly in a regression model.
Gray Calhoun gcalhoun@iastate.edu
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.