% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/residuals.barma.R
\name{residuals.barma}
\alias{residuals.barma}
\title{Calculate Residuals for a barma Model Object}
\usage{
\method{residuals}{barma}(object, type = "standardized", ...)
}
\arguments{
\item{object}{A fitted model object of class `"barma"`, typically the 
result of a call to `barma()`.}

\item{type}{The type of residuals to compute. Currently, only 
`"standardized"` (default) is implemented, returning standardized 
residuals on the predictor scale.}

\item{...}{Additional arguments (currently ignored).}
}
\value{
A numeric vector or `ts` object containing the requested residuals. 
  For standardized residuals, the first `max_lag` values will be `NA`.
}
\description{
Computes various types of residuals for a fitted Beta Autoregressive Moving 
Average (BARMA) model object of class `"barma"`.
}
\details{
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:
\deqn{r_t = \frac{g(y_t) - \hat{\eta}_t}{\sqrt{Var(g(y_t) - \hat{\eta}_t)}}}
where \eqn{Var(g(y_t) - \hat{\eta}_t) \approx (g'(\hat{\mu}_t))^2 \cdot}
\deqn{\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.
}
