sim.egcm {egcm} | R Documentation |
Generate simulated data from an Engle-Granger cointegration model
Description
Given an Engle-Granger cointegration model and the number of steps to simulate, generates a simulated realization of that model for the specified number of steps.
Usage
sim.egcm(E, nsteps, X0, Y0)
Arguments
E |
the Engle-Granger model to be simulated. See |
nsteps |
the number of steps to simulate |
X0 |
the starting value of |
Y0 |
the starting value of |
Value
Returns a two-column data.frame, where the first column contains the simulated values of X
, and the second column contains the simulated
values of Y
.
Author(s)
Matthew Clegg matthewcleggphd@gmail.com
See Also
Examples
# Generate a random pair of cointegrated vectors
cv1 <- rcoint(1000)
# Construct a cointegration model from them
e1 <- egcm(cv1)
# Simulate the model for an additional 1000 steps
cv2 <- sim.egcm(e1, 1000)
# Construct a cointegration model from the simulated data
e2 <- egcm(cv2)
# Compare the original model to the model obtained from simulation
e1
e2
[Package egcm version 1.0.13 Index]