Calculates the residuals from each component of the mixture and the matrix of probabilities that each observation was generated by each component.
residMix(object, x, y, std=FALSE)
List describing the fitted mixture of regressions as returned by mixreg.
The matrix of predictors to which the mixture has been fitted. If there is only one predictor then x may be a vector.
The vector of observed values to which the mixture has been fitted.
Logical argument; if TRUE then the residuals are standardized (by dividing them by their estimated standard deviation).
A list (of class "mresid") with components
The 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.
The matrix of probabilities that each observation was generated by each component
The x argument of the call to residMix
The y argument of the call to residMix
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.
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.
bootcomp, cband, covmix, mixreg, plot.cband, plot.mresid, qqMix
# NOT RUN {
#See \link{mixreg} for examples.
# }
Run the code above in your browser using DataCamp Workspace