


Local Regression and Likelihood, Figure 9.2. Hardle's Motorcycle accelaration dataset. Local Variance Estimation. Author: Catherine Loader NEED: lfknots function to extract fit points.


0001 % Local Regression and Likelihood, Figure 9.2. 0002 % 0003 % Hardle's Motorcycle accelaration dataset. 0004 % Local Variance Estimation. 0005 % 0006 % Author: Catherine Loader 0007 % 0008 % NEED: lfknots function to extract fit points. 0009 0010 load mcyc; 0011 fit = locfit(time,'y',accel,'nn',0.1); 0012 y = -2*predict(fit,'fitp','what','lik'); 0013 w = predict(fit,'fitp','what','rdf'); 0014 x = fit{4}{1}'; 0015 fitv = locfit(x,y,'weights',w,'family','gamma','nn',0.4); 0016 lfplot(fitv); 0017 xlabel('Time'); 0018 ylabel('Variance');