sim.egcm: Generate simulated data from an Engle-Granger cointegration...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/egcm.R

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

1
sim.egcm(E, nsteps, X0, Y0)

Arguments

E

the Engle-Granger model to be simulated. See egcm

nsteps

the number of steps to simulate

X0

the starting value of X to be used in the simulation. If not specified, uses the last value of X in E.

Y0

the starting value of Y to be used in the simulation. If not specified, uses the last value of Y in E.

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 [email protected]

See Also

egcm rcoint

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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

egcm documentation built on Sept. 18, 2017, 5:03 p.m.