fig6_7.m 533 B

12345678910111213141516171819
  1. % Local Regression and Likelihood, Figure 6.6.
  2. % Author: Catherine Loader
  3. %
  4. % Penny data, piecewise smoothing.
  5. %
  6. load penny;
  7. u = find(year <= 1958);
  8. fit1 = locfit(year(u),thickness(u),'alpha',[0 10],'deg',1);
  9. u = find((year>1958) & (year <= 1974));
  10. fit2 = locfit(year(u),thickness(u),'alpha',[0 10],'deg',1);
  11. u = find(year > 1974);
  12. fit3 = locfit(year(u),thickness(u),'alpha',[0 10],'deg',1);
  13. figure('Name','fig6_7: Piecewise smoothing of penny data' );
  14. lfplot(fit1);
  15. hold on;
  16. lfplot(fit2);
  17. hold on;
  18. lfplot(fit3);