EVOLUTION-MANAGER
Edit File: ksmooth.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: Kernel Regression Smoother</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 ksmooth {stats}"><tr><td>ksmooth {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Kernel Regression Smoother</h2> <h3>Description</h3> <p>The Nadaraya–Watson kernel regression estimate. </p> <h3>Usage</h3> <pre> ksmooth(x, y, kernel = c("box", "normal"), bandwidth = 0.5, range.x = range(x), n.points = max(100L, length(x)), x.points) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>input x values. Long vectors are supported.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>input y values. Long vectors are supported.</p> </td></tr> <tr valign="top"><td><code>kernel</code></td> <td> <p>the kernel to be used. Can be abbreviated.</p> </td></tr> <tr valign="top"><td><code>bandwidth</code></td> <td> <p>the bandwidth. The kernels are scaled so that their quartiles (viewed as probability densities) are at <i>+/-</i> <code>0.25*bandwidth</code>.</p> </td></tr> <tr valign="top"><td><code>range.x</code></td> <td> <p>the range of points to be covered in the output.</p> </td></tr> <tr valign="top"><td><code>n.points</code></td> <td> <p>the number of points at which to evaluate the fit.</p> </td></tr> <tr valign="top"><td><code>x.points</code></td> <td> <p>points at which to evaluate the smoothed fit. If missing, <code>n.points</code> are chosen uniformly to cover <code>range.x</code>. Long vectors are supported.</p> </td></tr> </table> <h3>Value</h3> <p>A list with components </p> <table summary="R valueblock"> <tr valign="top"><td><code>x</code></td> <td> <p>values at which the smoothed fit is evaluated. Guaranteed to be in increasing order.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>fitted values corresponding to <code>x</code>.</p> </td></tr> </table> <h3>Note</h3> <p>This function was implemented for compatibility with S, although it is nowhere near as slow as the S function. Better kernel smoothers are available in other packages such as <a href="https://CRAN.R-project.org/package=KernSmooth"><span class="pkg">KernSmooth</span></a>. </p> <h3>Examples</h3> <pre> require(graphics) with(cars, { plot(speed, dist) lines(ksmooth(speed, dist, "normal", bandwidth = 2), col = 2) lines(ksmooth(speed, dist, "normal", bandwidth = 5), col = 3) }) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>