fig5_6.m 542 B

123456789101112131415161718192021
  1. % Local Regression and Likelihood, Figure 5.6.
  2. % Author: Catherine Loader
  3. %
  4. % Cumulative Distribution Function
  5. %
  6. % This function uses cdfplot() from Matlab's add-on statistics toolbox.
  7. %
  8. % NEED:
  9. % predict should backtr by default?
  10. load geyser;
  11. fit = locfit(geyser,'nn',0.1,'h',1.2,'renorm',1);
  12. x = (1:0.01:6)';
  13. z = predict(fit,x);
  14. figure('Name','fig5_6: Cumulative distribution function' );
  15. plot(x,0.01*cumsum(exp(z)));
  16. xlabel('Eruption Duration (Minutes)');
  17. ylabel('Cumulative Distribution Function');
  18. hold on;
  19. cdfplot(geyser);
  20. hold off;