fig1_1.m 394 B

123456789101112
  1. % Local Regression and Likelihood, Figure 1.1.
  2. %
  3. % A linear regression and plot for Spencer's mortality
  4. % data. Unlike the book, I use locfit for this!
  5. %
  6. % Setting 'ev','none' means that locfit computes only
  7. % the parametric fit. In this case, 'deg',1; i.e. linear.
  8. load spencer;
  9. fit = locfit(age,mortality,'deg',1,'ev','none');
  10. figure('Name','fig1_1: locfit linear regression');
  11. lfplot(fit);