fig7_4.m 594 B

12345678910111213141516171819202122
  1. % Local Regression and Likelihood, Figure 7.4.
  2. %
  3. % Censored Local Likelihood
  4. %
  5. % Author: Catherine Loader
  6. %
  7. % NEED: this is given problems for unknown reasons. something
  8. % to do with censored observations and the ibeta routine.
  9. % if i replace this by
  10. % res[ZLIK] = th*y-y*log(p)
  11. % res[ZDLL] = y*p
  12. % res[ZDDLL] = y*p*(1-p)
  13. % works fine. Memory leak somewhere??
  14. % also works if i ignore censoring.
  15. load border;
  16. fit = locfit(day,runs,'cens',no,'family','geom','alpha',0.7);
  17. figure('Name','fig7_4: censored local likelihood;' );
  18. lfplot(fit);
  19. xlabel('Date');
  20. ylabel('Runs');