bashtage / arch

ARCH models in Python
Other
1.32k stars 245 forks source link

Clarification on `.simulated_variances` attribute of `ARCHModelForecast` object. #684

Closed Vasudeva-bit closed 11 months ago

Vasudeva-bit commented 11 months ago

If method is not analytic (i.e., simulation or bootstrap) in estimator object of arch_model from arch, result object will have a attribute .simulated_variance, which in turn has .values attribute. If we calculate the quantiles of these, will it give desired results of predicting quantiles.

For reference kindly have a look at here.

What I meant by calculating quantiles is, numpy.quantile(forecast_result.simulated_variance.values[-1], list_of_quantiles, axis=0)

bashtage commented 11 months ago

You can see here where I use similar values to plot all paths.

https://bashtage.github.io/arch/univariate/univariate_volatility_scenarios.html#Comparing-the-paths

If you want the simulated variance, you need to directly use the variances or residual_variances attributes like I do in the notebook linked above. These will be the same if the mean model is simple (Constant or ZeroMean), but will differ for autoregressive mean models (if the AR parameters are non-zero).

Vasudeva-bit commented 11 months ago

Thanks for your response. I would like to know if any of the following code snippets would give desired results of calculating quantiles:

  1. numpy.quantile(forecast_result.simulated_variances.values[-1], list_of_quantiles, axis=0)
  2. numpy.quantile(forecast_result.simulations.values[-1], list_of_quantiles, axis=0)

or is there any method in arch to get quantiles? @bashtage

Vasudeva-bit commented 10 months ago

Kindly help me understand whether above operation is valid? @bashtage