annotate rDiff/src/locfit/m/smooth_lf.m @ 3:29a698dc5c7e default tip

Merge multiple heads.
author Dave Bouvier <dave@bx.psu.edu>
date Mon, 27 Jan 2014 14:15:36 -0500
parents 0f80a5141704
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
1 function z=smooth_lf(x,y,varargin)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 % must (unlike R smooth.lf() function) give x and y.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 % also R's direct=T is automatic.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 xev = x;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 if (k>1)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 if (strcmp(varargin{1},'xev'))
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 xev = varargin{2};
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 varargin(1:2) = [];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12 end;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 end;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14 fit = locfit(x,y,varargin{:},'ev',xev,'module','simple');
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 z = lfknots(fit);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16 fv = invlink(z(:,1),fit.fit_points.family_link);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18 z = { xev, fv };
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
19
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
20 return;