annotate rDiff/src/locfit/m/scb.m @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
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=scb(x,y,varargin)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 % Simultaneous Confidence Bands
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 % Example:
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6 % load ethanol;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 % z = scb(E,NOx,'h',0.5);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 % result (z) is a matrix with four columns: evaluation points,
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 % fitted values, lower confidence limit, upper confidence limit.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 % Most locfit arguments should work.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 fit = locfit(x,y,'ev','grid','mg',20,varargin{:});
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14 kap = kappa0(x,y,varargin{:});
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 cb = predict(fit,'fitp','band','g','kappa',kap);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16 z = [fit.fit_points.evaluation_points' cb{1} cb{3}];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18 return;