fig11_1.m 494 B

12345678910111213141516171819
  1. % Local Regression and Likelihood, Figure 11.1
  2. %
  3. % Variable degree fit, uses module 'vord'. Note there is
  4. % no `lower' degree here; it defaults to 0.
  5. %
  6. % Author: Catherine Loader
  7. load ethanol;
  8. figure('Name','fig11_1a: Variable degree fit');
  9. fit = locfit(E,NOx,'deg',3,'nn',0.3,'module','vord');
  10. lfplot(fit);
  11. figure('Name','fig11_1b: Variable degree fit');
  12. x = fit.fit_points.evaluation_points';
  13. z = predict(fit,'fitp','what','deg');
  14. plot(x,z,'o');
  15. xlabel('Fitting Point');
  16. ylabel('Degree');