| plot_diagnostics | R Documentation |
Shows three panels that check if the fitted model describes the data:
A Q-Q plot of the one-step-ahead (OSA) residuals against the standard gaussian distribution. If the model is correct, the points follow the diagonal. Bent tails show that the error distribution is wrong, for example that the returns have heavier tails or more skewness than the model allows.
The autocorrelation function (ACF) of the residuals. Bars outside the dashed lines show dependence in the returns that the model does not capture.
The ACF of the squared residuals. Bars outside the dashed lines show volatility clustering that the model does not capture.
plot_diagnostics(x, res = NULL, lag_max = 20, ...)
x |
A |
res |
Optional vector of OSA residuals from |
lag_max |
Maximum lag in the ACF panels. |
... |
Arguments passed to |
By default, the residuals are calculated for all observations with the exact grid method of
residuals, which takes a few seconds. To reuse residuals, calculate them once with
residuals and give them in res.
ggplot object with the three diagnostic panels.
data(spy)
opt <- estimate_parameters(spy$log_return, model = "t", silent = TRUE)
plot_diagnostics(opt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.