Description Usage Arguments Details Value References See Also Examples
A generic function for computing the recursive residuals (standardized one step prediction errors) of a linear regression model.
1 2 3 4 5 6 7 |
x, y, formula |
specification of the linear regression model:
either by a regressor matrix |
start, end |
integer. Index of the first and last observation, respectively, for which recursive residuals should be computed. By default, the maximal range is selected. |
tol |
numeric. A relative tolerance for precision of recursive coefficient estimates, see details. |
qr.tol |
numeric. The |
data |
an optional data frame containing the variables in the model. By
default the variables are taken from the environment which |
... |
currently not used. |
Recursive residuals are standardized one-step-ahead prediction errors. Under the usual assumptions for the linear regression model they are (asymptotically) normal and i.i.d. (see Brown, Durbin, Evans, 1975, for details).
The default method computes the initial coefficient estimates via QR
decomposition, using lm.fit
. In subsequent steps, the
updating formula provided by Brown, Durbin, Evans (1975) is employed.
To avoid numerical instabilities in the first steps (with typically
small sample sizes), the QR solution is computed for comparison.
When the relative difference (assessed bey all.equal
)
between the two solutions falls below tol
, only the updating
formula is used in subsequent steps.
A vector containing the recursive residuals.
Brown R.L., Durbin J., Evans J.M. (1975), Techniques for testing constancy of regression relationships over time, Journal of the Royal Statistical Society, B, 37, 149-163.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.