

   supsmu {modreg}                              R Documentation

   FFrriieeddmmaann''ss SSuuppeerrSSmmooootthheerr

   DDeessccrriippttiioonn::

        Smooth the (x, y) values by Friedman's "super
        smoother".

   UUssaaggee::

        supsmu(x, y, wt = rep(1, length(y)), span = "cv", periodic = FALSE,
               bass = 0)

   AArrgguummeennttss::

          x: x values for smoothing

          y: y values for smoothing

         wt: case weights

       span: the fraction of the observations in the span of
             the running lines smoother, or `"cv"' to choose
             this by leave-one-out cross-validation.

   periodic: If true, the x values are assumed to be in `[0,
                   1]' and of period 1.

       bass: controls the smoothness of the fitted curve. Val-
             ues of up to 10 indicating increasing smoothness.

   DDeettaaiillss::

        `supsmu' is a running lines smoother which chooses
        between three spans for the lines. The running lines
        smoothers are symmetric, with `k/2' data points each
        side of the predicted point, and values of `k' as 0.5n,
        0.2n and 0.05n. If `span' is specified, as single
        smoother with span `span' * n is used.

        The best of the three smoothers is chosen by cross-val-
        idation for each prediction. The best spans are then
        smoothed by a running lines smoother and the final pre-
        diction chosen by linear interpolation.

        The Fortran code says: ``For small samples (`n < 40')
        or if there are substantial serial correlations between
        observations close in x - value, then a prespecified
        fixed span smoother (`span > 0') should be used. Rea-
        sonable span values are 0.2 to 0.4.''

   VVaalluuee::

        A list with components

          x: the input values in increasing order with dupli-
             cates removed.

          y: the corresponding y values on the fitted curve.

   AAuutthhoorr((ss))::

        B. D. Ripley

   RReeffeerreenncceess::

        Friedman, J. H. (1984) SMART User's Guide.  Laboratory
        for Computational Statistics, Stanford University Tech-
        nical Report No. 1.

        Friedman, J. H. (1984) A variable span scatterplot
        smoother.  Laboratory for Computational Statistics,
        Stanford University Technical Report No. 5.

   SSeeee AAllssoo::

        `ppr'

   EExxaammpplleess::

        data(cars)
        attach(cars)
        plot(speed, dist)
        lines(supsmu(speed, dist))
        lines(supsmu(speed, dist, bass=7), lty=2)
        detach()

