Mercurial > repos > vipints > rdiff
comparison rDiff/src/locfit/m/lfsmooth.m @ 0:0f80a5141704
version 0.3 uploaded
author | vipints |
---|---|
date | Thu, 14 Feb 2013 23:38:36 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0f80a5141704 |
---|---|
1 function yhat=lfsmooth(varargin) | |
2 % | |
3 % a simple interface to locfit. | |
4 % output is a vector of smoothed values, at each data point. | |
5 % all locfit options, except evaluation structures, are valid. | |
6 % | |
7 % Example, to smooth a time series of observations, | |
8 % | |
9 % t = (1:100)'; | |
10 % y = 2*sin(t/10) + normrnd(0,1,100,1); | |
11 % plot(t,y,'.'); | |
12 % hold on; | |
13 % plot(t,lfsmooth(t,y,'nn',0.5)); | |
14 % hold off; | |
15 % | |
16 | |
17 % Minimal input validation | |
18 if nargin < 1 | |
19 error( 'At least one input argument required' ); | |
20 end | |
21 | |
22 fit = locfit(x,varargin{:},'module','simple'); | |
23 yhat = fit.fit_points.fitted_values; | |
24 | |
25 return; |