fig7_5.m 405 B

123456789101112131415
  1. % Local Regression and Likelihood, Figure 7.5.
  2. %
  3. % Author: Catherine Loader
  4. load border;
  5. fit0 = locfit(day,runs,'cens',no,'family','geom','nn',0.7);
  6. fit1 = locfit(day,runs,'weights',ones(265,1)*0.8,'cens',no,'family','geom','nn',0.7);
  7. xev = lfmarg(fit);
  8. xev = xev{1};
  9. y0 = predict(fit0,xev);
  10. y1 = predict(fit1,xev);
  11. figure('Name','fig7_5');
  12. plot(xev,0.8*exp(y1)-exp(y0));
  13. xlabel('Date');
  14. ylabel('Runs');