Local Regression and Likelihood, Figure 7.5. Author: Catherine Loader
0001 % Local Regression and Likelihood, Figure 7.5. 0002 % 0003 % Author: Catherine Loader 0004 0005 load border; 0006 fit0 = locfit(day,runs,'cens',no,'family','geom','nn',0.7); 0007 fit1 = locfit(day,runs,'weights',ones(265,1)*0.8,'cens',no,'family','geom','nn',0.7); 0008 xev = lfmarg(fit); 0009 xev = xev{1}; 0010 y0 = predict(fit0,xev); 0011 y1 = predict(fit1,xev); 0012 figure('Name','fig7_5'); 0013 plot(xev,0.8*exp(y1)-exp(y0)); 0014 xlabel('Date'); 0015 ylabel('Runs');