Estimating Conditional Variance with Mean and GARCH Models
Summary
Conditional variance describes how the uncertainty of returns changes with information available from the past. Unlike unconditional variance, which summarizes dispersion across the full sample, conditional variance can rise and fall over time, as in periods when large return moves cluster together. The document outlines a common modeling sequence: estimate a conditional mean, subtract it to obtain residuals, then model their time-varying variance with a GARCH-family model. A GARCH(1,1) example makes current variance depend on a constant, the previous squared residual, and previous variance.
Parameters can be estimated by maximum likelihood after choosing a distribution for standardized residuals; the explanation illustrates this with a normal likelihood. A recursive filter applies the mean and variance specifications to returns, producing variance estimates and standardized residuals. The account is introductory: it notes that model choice, starting values, and estimation can be difficult, and that stochastic volatility and more advanced specifications are alternatives. Centering returns by a sample average may not capture a time-varying conditional mean, so the mean model should match the data and task.
Key ideas
- Unconditional variance is a single summary, while conditional variance varies with past information.
- Model the conditional mean first and use its residuals when estimating conditional variance.
- GARCH models represent volatility clustering through dependence on past squared residuals and variance.
- Maximum likelihood estimation requires a distributional assumption for standardized residuals.
- Model specification and starting values can complicate estimation.
Tags
Full text
# How to calculate the conditional variance of a time series?
# How to calculate the conditional variance of a time series?
I am reading a paper where the term conditional variance is mentioned, but I am not really sure what is meant by this and how this can be calculated:
> Fig. 2 shows the conditional variances of the centered returns of the series of prices under study.
As far is know the term conditional variances is used only in GARCH models. So, I assume that in order to calculate these variances one has to use a GARCH Model for the returns. First, one has to calculate the returns $r_t = \ln(p_t) - \ln(p_{t-1})$. Then, the returns should be centered via $\hat{r}_t = r_t-\bar{r}$ (quite unsure if this meant by centered). The last step would be to apply a GARCH model. Is this going into the right direction or am I completely lost here?
## Answer by Malick (score 15)
https://quant.stackexchange.com/a/21928
Let’s take a simple example to answer a broad but interesting question:
Imagine that we have a daily return serie denoted $r_{t}$ ( which is assumed to be stationary) and let's take a little time to define main concepts :
Mean Process (First moment process)
- The unconditional mean of $r_{t}$ denoted $u$ is just its expectation $E(r_{t})$. It is not time varying. You can compute it directly using the expectation formula.
- The conditional mean process refers to the expectation of the serie at time $t$ given previous information: $E_{t}(y_{t}|\Omega_{t-1})$. It is time varying and that is the reason way we write it using a time subscript: $u_{t}$. This process is usually estimated using autoregressive–moving-average (ARMA) models. The intuition is that we can detect some autocorrelations in the returns series (ex: if day one is up, the day after has more probability to be down...it is an example)
So far so good, we may assume that we can compute a simple "average" return (unconditional mean) or a time-varying (i.e conditional) "average" return.
However usually people are also concerned with risk. If you know that your returns in average follow a process, you are likely also interested in uncertainty/risk. In finance, risk is usually approximated using the second moment (ie the variance).
Now let's jump to the variance part:
Conditional variance Process (Second moment)
- Similarly that for the mean process, we are able to estimate the unconditional variance of our return serie using a simple variance formula $\sigma^{2} = Var(r_{t}) $.
- Now imagine our return series exhibits "large changes followed by large changes..." during few days and goes back to its original unconditional variance level. We may realize that the variance is in fact time varying : we observe some "volatility clustering". In a same way that for the conditional mean process we can build a conditional variance process. To this end we use different tools : the Garch family models which allows us to model a time-varying variance : $\sigma_{t}^{2} = Var_{t}(r_{t}|\Omega_{t-1}) $. (Others models exist such as Stochastic volatility models).
Now we have defined the main concepts we can jump to your question :
### How to calculate the conditional variance of a time series?
Intuition
Firstly we model the conditional mean process (using a ARMA,ARFIMA...) and subtract it from the original returns series to obtain the "return residuals" : $r_{t}-\mu_{t} =\epsilon_{t} = \sigma_{t} z_{t}$ where $z_{t}$ is an i.i.d process with $E_{t}(z_{t}) = 0$ and $Var_{t}(z_{t}) =1$. Note that the conditional variance of $\epsilon_{t}$ is equal to $\sigma_{t}^{2}$.
However since we know that the variance is time varying we also know that $\sigma_{t}^{2}$ has a time dependent structure and exhibits autocorrelations (so do the squares returns residuals). We can model it using GARCH class of models which can (very roughly) be seen as ARMA models for the conditional variance process.
> Example of a Garch(1,1) : $\sigma_{t}^{2} = a + \alpha \epsilon_{t-1}^{2} + \beta \sigma_{t-1}^{2} $
Once we fit our conditional variance models we will be left with the conditional variance process $\sigma_{t}^{2} $.At this point we know the conditional variance process $\sigma_{t}^{2} $ and $\epsilon_{t}^{2}$. This allow us to obtain the final standardized residuals series $z_{t}$ which is i.i.d and equal to $\epsilon_{t}/\sigma_{t} = z_{t}$.
Estimation
How do we estimate it ?
The simplest way is to rely on the Maximum Likelihood Estimation (MLE) method. We need to assume a distribution for the $z_{t}$ (the final residuals). Since we know that these residuals are i.i.d it is easy to compute the log-likelihood for a given $z_{t}$ serie. (to be more precise the typical arguments for the likelihood function are $\epsilon_{t}^{2}$ and $\sigma_{t}^{2}$)
> Example : If we assume a normal distribution for $z_{t}$ the log likelihood (assuming no constant) is given by : $LogLik = -\frac{1}{2} \sum_{1}^{T} \left[ \log(2 \pi) + \log(\sigma_{t}^{2}) + z_{t}^{2} \right] \qquad (= -\frac{1}{2} \sum_{1}^{T} \left[ \log(2 \pi) + \log(\sigma_{t}^{2}) + \frac{\epsilon_{t}^{2}}{\sigma_{t}^{2}} \right])$
But how can we practically obtain $z_{t}$ ? A solution is to use what we called "filters" takings as input the returns series and, based on a particular specifications (ex: arma(1,1)-garch(1,1)), returning $\sigma_{t}^{2}$. By "filtering" we mean that we applied the autoregressive framework (recursive algorithm on both the mean and variance) on the input serie (the return serie) to obtain as output the $ z_{t}$ .
> An example ? : see this very nice post (see Solution added by the author) : Algorithm to fit AR(1)/GARCH(1,1) model of log-returns
Next we can use some maximization algorithms to find the parameters producing a $z_{t}$ serie which maximize the likelihood.
> Ex: we run the filter with AR parameter = 0.1 ; next we try another value, and so on with all parameters to obtain the final parameters maximizing the likelihood.
Finally to obtain the standards errors of the estimated parameters we may use the Hessian.
Ok, but in practice ?
You can use "click to run" softwares to estimate (and much more) the conditional variance/mean processes. Matlab, R , and Ox (among others) have packages devoted to this estimation.
> Example of packages : Matlab: Financial Toolbox, kevin sheppard Toolbox. R: arfima,rugarch, packages - see also Rmetrics – see How to fit ARMA+GARCH Model In R? Ox: G@rch package of S. Laurent . Others : see comments.
Remarks
-This is a simplification example: models currently used in the literature are much more advanced, for instance the Arch-in-mean class of models add the conditional variance as an explanatory variable in the conditional mean process.
-You are not forced to use filters if you can compute directly the likelihood based on the parameters.
-In reality, the estimation part is far more difficult to do, as illustration the choice of starting values is a tricky part.
-If you want to recommend another software/package just add it in the comments.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.