fig10_1.m 556 B

12345678910111213141516171819202122
  1. % Local Regression and Likelihood, Figure 10.1.
  2. %
  3. % uses 'module','allcf' rather than 'deriv',[1 1] to get the
  4. % second derivative coefficient
  5. %
  6. % Author: Catherine Loader
  7. load geyser;
  8. a = [0.5 0.75 1];
  9. f=['a','b','c','d'];
  10. for (i=1:3)
  11. figure('Name', sprintf( 'figure10_1%c', f(i) ) );
  12. fit = locfit(geyser,'deg',2,'link','ident','kern','gauss','ev','grid','mg',501,'ll',1,'ur',6,'module','allcf','h',a(i));
  13. x = fit.fit_points.evaluation_points;
  14. y = lfknots(fit);
  15. y = y(:,3);
  16. plot(x,y.^2);
  17. itgl = [0.5 ones(1,499) 0.5] * (y.^2) / 100
  18. end;