View source: R/residuals.barma.R
| residuals.barma | R Documentation |
Computes various types of residuals for a fitted Beta Autoregressive Moving Average (BARMA) model object of class '"barma"'.
## S3 method for class 'barma'
residuals(object, type = "standardized", ...)
object |
A fitted model object of class '"barma"', typically the result of a call to 'barma()'. |
type |
The type of residuals to compute. Currently, only '"standardized"' (default) is implemented, returning standardized residuals on the predictor scale. |
... |
Additional arguments (currently ignored). |
This function is an S3 method for the generic 'residuals' function, tailored for objects returned by the 'barma()' function.
By default ('type = "standardized"'), it calculates standardized residuals on the predictor scale, defined as:
r_t = \frac{g(y_t) - \hat{\eta}_t}{\sqrt{Var(g(y_t) - \hat{\eta}_t)}}
where Var(g(y_t) - \hat{\eta}_t) \approx (g'(\hat{\mu}_t))^2 \cdot
\frac{\hat{\mu}_t(1-\hat{\mu}_t)}{1+\hat{\phi}}
. These residuals are useful for diagnostic checking, as they are approximately standard normal if the model is correctly specified.
A numeric vector or 'ts' object containing the requested residuals. For standardized residuals, the first 'max_lag' values will be 'NA'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.