0
|
1 function z=scb(x,y,varargin)
|
|
2
|
|
3 % Simultaneous Confidence Bands
|
|
4 %
|
|
5 % Example:
|
|
6 % load ethanol;
|
|
7 % z = scb(E,NOx,'h',0.5);
|
|
8 %
|
|
9 % result (z) is a matrix with four columns: evaluation points,
|
|
10 % fitted values, lower confidence limit, upper confidence limit.
|
|
11 % Most locfit arguments should work.
|
|
12
|
|
13 fit = locfit(x,y,'ev','grid','mg',20,varargin{:});
|
|
14 kap = kappa0(x,y,varargin{:});
|
|
15 cb = predict(fit,'fitp','band','g','kappa',kap);
|
|
16 z = [fit.fit_points.evaluation_points' cb{1} cb{3}];
|
|
17
|
|
18 return;
|