Skip to content
All library documents

Extracting the Long-Run Component from a Component GARCH Fit

Article Quant Q&A · Author: qwerty123123123

Summary

This exchange addresses how to retrieve the long-run variance component from a component GARCH model fitted with the rugarch package in R. The questioner can obtain conditional volatility with the package’s standard accessor but needs the time-varying long-run component, rather than a single unconditional variance estimate.

The accepted response reports that the fitted model object stores the filtered component in its fit data, accessible as q. An alternative, if the package does not expose the series, is to reproduce its recursion using the fitted parameters, conditional mean residuals, and the same initialization convention. The explanation notes that initialization may use the full sample, a specified initial subset, or an exponential backcast weight, so a manual reconstruction must match the estimation setup. The exchange provides a package-specific answer and a general workaround, but does not show validation against a numerical example or discuss whether internal object fields may change across package versions.

Key ideas

  • A component GARCH fit can retain the filtered long-run variance series separately from conditional volatility.
  • The accepted answer locates that series in the fitted object’s stored fit data.
  • If the series is unavailable, it can be reconstructed recursively from fitted inputs and the model’s initialization.
  • Manual reconstruction must use the same initialization convention as the original fit.

Tags

Full text
# Extract the short-run and long-run volatility of any time series with component sGarch (rugarch)


# Extract the short-run and long-run volatility of any time series with component sGarch (rugarch)












I try to estimate a component sGarch model with the rugarch package in R. My goal is to extract the short-run and long-run volatility components of any time series. I am not interested in the coefficients.

Does someone here know how I get such an output?

I know that `sigma(fitted model)` is giving me $\sigma^2_t$ but I cannot get an output for $q_t$. If I use `uncvariance(fitted model)`, it is just giving a single number.

Thanks in advance!

Here is some code:

```
# With an arbitrary data input, here I used some spot rate data

garchspec <- ugarchspec(variance.model = list(model = "csGARCH", garchOrder = c(1,1)))

garchfit <- ugarchfit(garchspec, SpotRates)

print(garchfit)

sig <- sigma(garchfit)
sig2 <- uncvariance(garchfit)
```

And a description of the model (taken from 'Introduction to the rugarch_package'):

## Answer by qwerty123123123 (score 1)

https://quant.stackexchange.com/a/53110

OP here. I wrote an E-Mail to the package author and he gave me a tip. To help more people, I post a solution here:

```
garchspec <- ugarchspec(any spec)

garchfit <- ugarchfit(any fit)

q_t <- garchfit@fit$q
```

Thanks @Stéphane for Input!

## Answer by St&#233;phane (score 0)

https://quant.stackexchange.com/a/51333

It is not impossible that the authors of the package did not include this option.

In that case, if you know how they initialize their filtering, you can just recuperate what they do give you (parameters, conditional variance, mean equation residuals) and filter out your series for $q_t$ recursively yourself. Here is how you control the initialization for the estimation in the package:

```
The option rec.init, introduced in version 1.0-14 allows to set the 
type of method for the conditional recursion initialization, with 
default value ’all’ indicating that all the data is used to calculate 
the mean of the squared residuals from the conditional mean 
filtration. To use the first ’n’ points for the calculation, a 
positive integer greater than or equal to one (and less than the total 
estimation datapoints) can instead be provided. If instead a positive 
numeric value less than 1 is provided, this is taken as the weighting 
in an exponential smoothing backcast method for calculating the 
initial recursion value.
```

Once you picked an option, even if the package doesn't allow you to obtain the filtered series you want, you can always recompute things recursively yourself using what they do give you.

Yes, it's stupid and a waste because they already computed it elsewhere... but, oh well.

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.