fig6_6.m 516 B

1234567891011121314151617
  1. % Local Regression and Likelihood, Figure 6.6.
  2. % Author: Catherine Loader
  3. %
  4. % Penny data, estimating jump size using left and
  5. % right smooths.
  6. %
  7. load penny;
  8. midp = (1945:1988)'+0.5;
  9. fitl = locfit(year,thickness,'style','l','alpha',[0 10],'ev',midp,'deg',1);
  10. fitr = locfit(year,thickness,'style','r','alpha',[0 10],'ev',midp,'deg',1);
  11. pl = predict(fitl);
  12. pr = predict(fitr);
  13. figure('Name','fig6_6: Estimating jump size' );
  14. plot(midp,(pr-pl).*(pr-pl),'.-');
  15. xlabel('Year');
  16. ylabel('\Delta^2(Year)');