/haR

R package to estimate and forecast the HAR (Heterogeneous Autoregressive) model and its extensions.

Primary LanguageRGNU General Public License v3.0GPL-3.0

Heterogeneous AutoRegressive (HAR) model

CRAN status devel version

Tools for estimating and forecasting using the Heterogeneous AutoRegressive (HAR) model by Corsi (2009) <doi:10.1093/jjfinec/nbp001> and the Partial-Variances Heterogeneous AutoRegressive model by Bollerslev et al. (2022) <doi:10.1016/j.jeconom.2021.04.013>.

Installation

You can install the development version of haR from GitHub with:

# install.packages("devtools")
devtools::install_github("daniGiro/haR")

Example

library(haR)
x <- rnorm(1000)
obj <- har(x)
summary(obj)
#> Call:
#> har(y = x)
#> 
#> Residuals:
#>           Min      1Q   Median     3Q   Max
#> F.H. 1 -2.861 -0.6615 0.009671 0.6948 3.317
#> 
#> Coefficients:
#>         intercept  L1        L5        L22     
#> F.H. 1   0.03158   -0.05467   0.12196  -0.21994
#> 
#> Forecast:
#>       F.H. 1 
#> Mean  0.09406

#coef(obj)
#print(obj)
#fitted(obj)
#residuals(obj)
#predict(obj)