Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

Below a R code wrote by the moderator @richardh (whom I want to thank again) about ARCH/GARCH models.

ret <- diff.xts(log(MSFT$MSFT.Adjusted))[-1]
arch_model <- garch(ret, order=c(0, 3))
garch_model <- garch(ret, order=c(3, 3))

My focus is to understand if the volatility of the returns is constant during all the series. I don't understand how ARCH/GARCH models could help me understading this kind of aspect, at the moment the operations I do are:

  • Calculate the % returns of the stocks
  • Linear regressione like: lm(A~B) where A and B are the stocks returns (%)
  • Passing the residuals of the linear regression to the unit root tests.

now the problem is to understand if the volatility is constant (take a look at the chart below, that problem is clearly visible), so the question is:

How can I understand if the volatility is not constant reading ARCH/GARCH model Non stationary volatility


garch_model <- garch(rnorm(1000), order=c(3, 3))
> summary(garch_model)

garch(x = rnorm(1000), order = c(3, 3))


      Min        1Q    Median        3Q       Max 
-3.394956 -0.668877 -0.008454  0.687890  3.221826 

    Estimate  Std. Error  t value Pr(>|t|)
a0 7.133e-01   7.156e+00    0.100    0.921
a1 1.752e-02   3.750e-02    0.467    0.640
a2 6.388e-03   1.924e-01    0.033    0.974
a3 6.486e-14   1.711e-01    0.000    1.000
b1 7.396e-02   1.098e+01    0.007    0.995
b2 8.052e-02   1.120e+01    0.007    0.994
b3 8.493e-02   4.279e+00    0.020    0.984

Diagnostic Tests:
        Jarque Bera Test

data:  Residuals 
X-squared = 1.4114, df = 2, p-value = 0.4938

        Box-Ljung test

data:  Squared.Residuals 
X-squared = 0.0061, df = 1, p-value = 0.9377


garch_model$fitted.values enter image description here

share|improve this question
just want to have a quick question: how can we get all the graphs when plotting a "garch" object? R just request us to skip through all of those until the ACF graphs. Thanks –  user5046 Apr 1 '13 at 8:52
add comment

2 Answers

ARCH and GARCH are, by essence heteroskedastic models, that is, with non-constant volatility.

If you fit these models to your sample, it will provide you with a time series of the volatility for each point (you can construct it actually). If the values are not the same for all $t$, then the volatility is not constant, according to these models.

What you are looking to do here is to fit the model (GARCH or ARCH) to your time series (look at the GARCH definition). That means that the algorithm in your garch fonction basically finds the parameters that match the best your sample.

As you can see on the description of the garch function, you get different information on the returns.

With your parameters you can recreate your $\sigma_t^2$, which is the volatility at time $t$ (hence, it's a time series).

If it's not constant (or say, relatively constant) you can see that you detected volatility clusters in your series.

To say it differently, plot your time series of $\sigma_t^2$. If it is a straight line, the vol. is constant.

share|improve this answer
thank you so much for the reply. I have two doubts about your answer: 1. what do you mean with "With your parameters you can recreate your σ2t, which is the volatility at time t." ? can you give me a small example with R? 2. Saying "If it's not constant (or say, relatively constant) you can see that you detected volatility clusters in your series." probably means that you checked the volatility, the doubt is HOW you can estabilish that the volatility is NOT constant. Do I have to apply KPSS test (or other unit root test) to σ2t? Let me know, thank you! –  Dail Nov 14 '11 at 9:41
I added the summary(garch_model) on my question. I have used for convenience rnorm(1000) as "timeseries" –  Dail Nov 14 '11 at 9:59
try plotting garch_model$fitted.values, I think you find your volatilities –  SRKX Nov 14 '11 at 10:04
the problem is that I need to test it "programmatically" so how could I "write": "plot your time series of σ2t. If it is a straight line, the vol. is constant." in R? I can't do a visual check.. Maybe some values in the GARCH's returns help me to understand if it is constant or not? And what about GARCH(3,3) is it the standard? I also see 1,1. What to apply? A lot of thanks! –  Dail Nov 14 '11 at 10:05
The plots are helpful, but to determine if the GARCH model fits, you should use statistics. Look at the log-likelihood, sum-of-squared-residuals, and information criteria across various specifications to see which fits best. Then perform joint test of the GARCH coefficients. If you fail to reject that all coefficients are jointly zero, then you don't need a GARCH model. –  Richard Herron Nov 14 '11 at 14:24
show 4 more comments

"How can I understand if the volatility is not constant reading ARCH/GARCH model ":

Garch models essentially add conditional variance terms to the regression equation in order to capture time-varying variance and volatility clustering. Just to tame your excitement a bit, do not expect to extract a whole lot of value from the application of ARCH/GARCH models in terms of predicting volatility clusters or variance dynamics, they generally perform very poorly in that regards. Academicians may get extremely excited when the market confirms their models that S&P 500 index/futures vol at 60 levels does not drop back to 20 levels overnight. At the same time one too many funds and trading desks got killed by an over reliance on GARCH models in their quest to predict volatility dynamics. Volatility in the end of the day trades and reacts to extreme but unpredictable events in a very similar fashion than any other asset class. That is why traditionally most models fail in high volatility environments while they track a lot better in low vol environments, but hey, isn't that a self-fulfilling prophesy? Fact, however, remains that most all models are incapable to predict regime changes which confirms my own basic tenet of how to approach trading and risk management in general: Reactive rather than predictive. Just sharing my own non-quantitative take and summary of market experience.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.