resid.mix: Calculate the residuals of a mixture of linear regressions.
Description
Calculates the residuals from each component of the mixture
and the matrix of probabilities that each observation was generated
by each component.
Usage
resid.mix(object, x, y, std=FALSE)
Arguments
object
List describing the fitted mixture of regressions as returned by
mixreg.
x
The matrix of predictors to which the mixture has been fitted.
If there is only one predictor then x may be a vector.
y
The vector of observed values to which the mixture has been fitted.
std
Logical argument; if TRUE then the residuals are standardized
(by dividing them by their estimated standard deviation).
Value
A list (of class "mresid") with components
residThe residuals of the model in a matrix. The k-th column of
this matrix is the vector of residuals from the k-th component
of the model.
gammaThe matrix of probabilities that each observation was generated
by each component
xThe x argument of the call to resid.mix
yThe y argument of the call to resid.mix
Details
The calculation of the estimated standard deviations of the
residuals is a little bit complicated since each component of
the model is fitted using weighted regression in a setting in
which the weights are NOT the reciprocals of error variances.
See the reference below for more detail.
References
Turner, T. R. (2000) Estimating the rate of spread of a viral infection
of potato plants via mixtures of regressions. Appl. Statist. vol. 49,
Part 3, pp. 371 -- 384.