## S3 method for class 'default':
recresid(x, y, start = ncol(x) + 1, end = nrow(x),
tol = sqrt(.Machine$double.eps), ...)
## S3 method for class 'formula':
recresid(formula, data = list(), ...)
## S3 method for class 'lm':
recresid(x, data = list(), ...)x and a response variable y,
or by a formula or by a fitted object x of class "lm".recresid is
called from. Specifying data might also be necessary when applying
recrelm.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 between the two solutions falls below
tol, only the updating formula is used in subsequent steps.efpx <- rnorm(100) + rep(c(0, 2), each = 50)
rr <- recresid(x ~ 1)
plot(cumsum(rr), type = "l")
plot(efp(x ~ 1, type = "Rec-CUSUM"))Run the code above in your browser using DataLab