smooth_lf.m 388 B

1234567891011121314151617181920
  1. function z=smooth_lf(x,y,varargin)
  2. % must (unlike R smooth.lf() function) give x and y.
  3. % also R's direct=T is automatic.
  4. %
  5. xev = x;
  6. if (k>1)
  7. if (strcmp(varargin{1},'xev'))
  8. xev = varargin{2};
  9. varargin(1:2) = [];
  10. end;
  11. end;
  12. fit = locfit(x,y,varargin{:},'ev',xev,'module','simple');
  13. z = lfknots(fit);
  14. fv = invlink(z(:,1),fit.fit_points.family_link);
  15. z = { xev, fv };
  16. return;