EVOLUTION-MANAGER
Edit File: supsmu.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Friedman's SuperSmoother</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for supsmu {stats}"><tr><td>supsmu {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Friedman's SuperSmoother</h2> <h3>Description</h3> <p>Smooth the (x, y) values by Friedman's ‘super smoother’. </p> <h3>Usage</h3> <pre> supsmu(x, y, wt =, span = "cv", periodic = FALSE, bass = 0, trace = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>x values for smoothing</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>y values for smoothing</p> </td></tr> <tr valign="top"><td><code>wt</code></td> <td> <p>case weights, by default all equal</p> </td></tr> <tr valign="top"><td><code>span</code></td> <td> <p>the fraction of the observations in the span of the running lines smoother, or <code>"cv"</code> to choose this by leave-one-out cross-validation.</p> </td></tr> <tr valign="top"><td><code>periodic</code></td> <td> <p>if <code>TRUE</code>, the x values are assumed to be in <code>[0, 1]</code> and of period 1.</p> </td></tr> <tr valign="top"><td><code>bass</code></td> <td> <p>controls the smoothness of the fitted curve. Values of up to 10 indicate increasing smoothness.</p> </td></tr> <tr valign="top"><td><code>trace</code></td> <td> <p>logical, if true, prints one line of info “per spar”, notably useful for <code>"cv"</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>supsmu</code> is a running lines smoother which chooses between three spans for the lines. The running lines smoothers are symmetric, with <code>k/2</code> data points each side of the predicted point, and values of <code>k</code> as <code>0.5 * n</code>, <code>0.2 * n</code> and <code>0.05 * n</code>, where <code>n</code> is the number of data points. If <code>span</code> is specified, a single smoother with span <code>span * n</code> is used. </p> <p>The best of the three smoothers is chosen by cross-validation for each prediction. The best spans are then smoothed by a running lines smoother and the final prediction chosen by linear interpolation. </p> <p>The FORTRAN code says: “For small samples (<code>n < 40</code>) or if there are substantial serial correlations between observations close in x-value, then a pre-specified fixed span smoother (<code>span > 0</code>) should be used. Reasonable span values are 0.2 to 0.4.” </p> <p>Cases with non-finite values of <code>x</code>, <code>y</code> or <code>wt</code> are dropped, with a warning. </p> <h3>Value</h3> <p>A list with components </p> <table summary="R valueblock"> <tr valign="top"><td><code>x</code></td> <td> <p>the input values in increasing order with duplicates removed.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>the corresponding y values on the fitted curve.</p> </td></tr> </table> <h3>References</h3> <p>Friedman, J. H. (1984) SMART User's Guide. Laboratory for Computational Statistics, Stanford University Technical Report No. 1. </p> <p>Friedman, J. H. (1984) A variable span scatterplot smoother. Laboratory for Computational Statistics, Stanford University Technical Report No. 5. </p> <h3>See Also</h3> <p><code><a href="ppr.html">ppr</a></code></p> <h3>Examples</h3> <pre> require(graphics) with(cars, { plot(speed, dist) lines(supsmu(speed, dist)) lines(supsmu(speed, dist, bass = 7), lty = 2) }) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>