fig11_4.m 416 B

12345678910111213
  1. % Local Regression and Likelihood, Figure 11.4.
  2. % Author: Catherine Loader
  3. %
  4. % Local Adaptive Smooth - Dopler example.
  5. %
  6. % NEED: Improve plot - curve is hard to see.
  7. x = (0:2047)'/2047;
  8. m = 20*sqrt(x.*(1-x)) .* sin(2*pi*1.05 ./ (x+0.05));
  9. y = m + normrnd(0,1,2048,1);
  10. fit = locfit(x,y,'pen',4,'acri','cp','maxk',500);
  11. figure('Name','fig11_4: local adaptive smooth: dopler example');
  12. lfplot(fit,'red');