Learn R Programming

HARModel (version 1.0)

HARSimulate: HAR simulation

Description

Simulates a HAR model. From using the AR representation of the HAR model.

Usage

HARSimulate(len=1500, periods = c(1, 5, 22), 
            coef = c(0.01, 0.36 ,0.28 , 0.28), errorTermSD = 0.001)

Arguments

len

An integer determining the length of the simulated process.

periods

A numeric of lags for constructing the model, standard is c(1,5,22).

coef

A numeric of coefficients which will be used to simulate the process.

errorTermSD

A numeric determining the standard deviation of the error term.

Value

A '>HARSim object

References

Corsi, F. 2009, A Simple Approximate Long-Memory Model of Realized Volatility, Journal of Financial Econometrics, 174--196.

Examples

Run this code
# NOT RUN {
set.seed(123)
#Simulate the process of size 10000
HARSim = HARSimulate(len = 10000, periods = c(1, 5, 22),
                     coef = c(0.01, 0.36, 0.28, 0.28), errorTermSD = 0.001)
HARFit = HAREstimate(HARSim@simulation, periods = c(1, 5, 22))

# }

Run the code above in your browser using DataLab