lcv.m 359 B

12345678910111213141516171819
  1. function g=lcv(varargin)
  2. %
  3. % likelihood cross-validation.
  4. %
  5. % returned vector consists of log-likelihood, trace(H), trace(H'H)
  6. % and cross-validated deviance (-2 * cross-validated log-likelihood).
  7. %
  8. % Author: Catherine Loader.
  9. fit = locfit(varargin{:},'ev','cros');
  10. rs = rsum(fit);
  11. df0 = rs(1);
  12. df1 = rs(2);
  13. llk = rs(3);
  14. g = [llk df0 df1 -2*llk];
  15. return;