Home > chronux_1_1 > locfit > Book > fig13_1.m

fig13_1

PURPOSE ^

Local Regression and Likelihood, Figure 13.1.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Local Regression and Likelihood, Figure 13.1.
 Author: Catherine Loader

 Minimax local regression.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Local Regression and Likelihood, Figure 13.1.
0002 % Author: Catherine Loader
0003 %
0004 % Minimax local regression.
0005 
0006 load mmsamp;
0007 fit = locfit(x,y,'deg',1,'kern','minmax','alpha',4000,'ev','grid','mg',200,'ll',0,'ur',1);
0008 x0 = fit{4}{1};
0009 y0 = predict(fit);
0010 plot(x0,y0);
0011 hold on;
0012 fit = locfit(x,y,'deg',1,'h',0.05,'ev','grid','mg',200,'ll',0,'ur',1);
0013 x0 = fit{4}{1};
0014 y0 = predict(fit);
0015 plot(x0,y0,'color','red');
0016 
0017 x1 = 0:0.01:1;
0018 y1 = 2-5*x1+5*exp(-(20*x1-10).^2);
0019 plot(x1,y1,'color','green');
0020 
0021 legend('Minimax','Constant h','True mean');
0022 
0023 plot(x,y,'.');
0024 
0025 hold off;

Generated on Sun 13-Aug-2006 11:49:44 by m2html © 2003