diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rDiff/src/locfit/m/scb.m	Thu Feb 14 23:38:36 2013 -0500
@@ -0,0 +1,18 @@
+function z=scb(x,y,varargin)
+
+% Simultaneous Confidence Bands
+%
+% Example:
+%   load ethanol;
+%   z = scb(E,NOx,'h',0.5);
+%
+% result (z) is a matrix with four columns: evaluation points,
+% fitted values, lower confidence limit, upper confidence limit.
+% Most locfit arguments should work.
+
+fit = locfit(x,y,'ev','grid','mg',20,varargin{:});
+kap = kappa0(x,y,varargin{:});
+cb = predict(fit,'fitp','band','g','kappa',kap);
+z = [fit.fit_points.evaluation_points' cb{1} cb{3}];
+
+return;