fig2_4.m 399 B

123456789101112131415
  1. % Local Regression and Likelihood, Figure 2.4.
  2. %
  3. % Bivariate Local Regression.
  4. load ethanol;
  5. alp = [0.25 0.3 0.49 0.59];
  6. lab = {'Local Constant' 'Local Linear' 'Local Quadratic' 'Local Cubic'};
  7. f=['a','b','c','d'];
  8. for (i=1:4)
  9. figure('Name', sprintf( 'figure2_4%c: Bivariate local regression', f(i) ) );
  10. fit = locfit(E,NOx,'deg',i-1,'alpha',alp(i));
  11. lfplot(fit);
  12. title(lab(i));
  13. end;