0
|
1 function y = residuals(fit,type)
|
|
2
|
|
3 % Residuals (or a few other things) from a locfit() fit.
|
|
4 %
|
|
5 % Input arguments:
|
|
6 % fit - the locfit() fit.
|
|
7 % type (optional) type of residuals. Valid types are
|
|
8 % 'dev' (deviance, the default)
|
|
9 % 'd2' (deviance squared)
|
|
10 % 'pearson'(Pearson)
|
|
11 % 'raw' (observed - fitted)
|
|
12 % 'ldot' (derivative of log-likelihood)
|
|
13 % 'lddot' (second derivative)
|
|
14 % 'fit' (fitted values - no transformation)
|
|
15 % 'mean' (fitted values - with back transformation)
|
|
16 %
|
|
17 % Author: Catherine Loader.
|
|
18
|
|
19 if (nargin<2) type = 'dev'; end;
|
|
20
|
|
21 y = predict(fit,'d','restyp',type);
|
|
22
|
|
23 return;
|