Mercurial > repos > vipints > rdiff
annotate rDiff/src/locfit/m/smooth_lf.m @ 0:0f80a5141704
version 0.3 uploaded
| author | vipints |
|---|---|
| date | Thu, 14 Feb 2013 23:38:36 -0500 |
| parents | |
| children |
| rev | line source |
|---|---|
| 0 | 1 function z=smooth_lf(x,y,varargin) |
| 2 | |
| 3 % must (unlike R smooth.lf() function) give x and y. | |
| 4 % also R's direct=T is automatic. | |
| 5 % | |
| 6 | |
| 7 xev = x; | |
| 8 if (k>1) | |
| 9 if (strcmp(varargin{1},'xev')) | |
| 10 xev = varargin{2}; | |
| 11 varargin(1:2) = []; | |
| 12 end; | |
| 13 end; | |
| 14 fit = locfit(x,y,varargin{:},'ev',xev,'module','simple'); | |
| 15 z = lfknots(fit); | |
| 16 fv = invlink(z(:,1),fit.fit_points.family_link); | |
| 17 | |
| 18 z = { xev, fv }; | |
| 19 | |
| 20 return; |
