diff rDiff/src/locfit/m/smooth_lf.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/smooth_lf.m	Thu Feb 14 23:38:36 2013 -0500
@@ -0,0 +1,20 @@
+function z=smooth_lf(x,y,varargin)
+
+% must (unlike R smooth.lf() function) give x and y.
+% also R's direct=T is automatic.
+%
+
+xev = x;
+if (k>1)
+  if (strcmp(varargin{1},'xev'))
+    xev = varargin{2};
+    varargin(1:2) = [];
+  end;
+end;
+fit = locfit(x,y,varargin{:},'ev',xev,'module','simple');
+z = lfknots(fit);
+fv = invlink(z(:,1),fit.fit_points.family_link);
+
+z = { xev, fv };
+
+return;