residuals.m 631 B

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