What I'm trying to do is estimate the following GARCH(1,1) model in R
with the garchFit function from the fGarch
package:
Mean equation:
$Y_t = a + bX_t + e_t$
$e_t = z_th_t^{0.5}$
$e_t \sim N(0,h_t)$, $z_t \sim N(0,1)$
Variance equation:
$h_t = \omega + k_0e^2_{t-1} + k_1h_{t-1}$
In the above, $Y_t$ is the response of my mean equation and $X_t$ is the predictor. I will estimate this equation within the GARCH framework because of heteroscedasticity of residuals.
I want estimates of both the mean equation and the variance equation (similar to what EViews
would give). However, the garchFit function has two inputs that I'm concerned about:
- formula – ARMA(m,n) + GARCH/APARCH(p,q) mean and variance specification
As you can see in my equations, my mean equation is not of the ARMA(m,n) form.
- data – any univariate time series which can be converted into a timeSeries using the generic function as.timeSeries
I'm modeling both $Y_t$ and $X_t$ together; thus it shouldn't be univariate.
If I put this model through EViews
, It'll give me parameter estimates of $a$ and $b$. This is what I want, but in R
. In R
, I can do garchFit(data=Y)
(where Y
is the column of $Y_t$), and it'll do a GARCH(1,1) over $Y_t = \mu(Y) + e_t$; but it doesn't give me $a$ or $b$ in the mean equation that I want!
Best Answer
The solution is to use another package called
rugarch
.Let's construct a (Tx2) matrix called
data
, where column 1 is $Y_t$ and column 2 is $X_t$.We can then compute the GARCH(1,1) model that I described in my question:
Comparing this to
EViews
: TheR
coefficient estimates that are greater than $0.01$ differ to theEViews
estimates by approximately $1-2\%$, which is acceptable in my mind. $t$-statistics differ by more but it doesn't effect inference.