EVOLUTION-MANAGER
Edit File: predict.loess.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: Predict Loess Curve or Surface</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 predict.loess {stats}"><tr><td>predict.loess {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Predict Loess Curve or Surface</h2> <h3>Description</h3> <p>Predictions from a <code>loess</code> fit, optionally with standard errors. </p> <h3>Usage</h3> <pre> ## S3 method for class 'loess' predict(object, newdata = NULL, se = FALSE, na.action = na.pass, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>an object fitted by <code>loess</code>.</p> </td></tr> <tr valign="top"><td><code>newdata</code></td> <td> <p>an optional data frame in which to look for variables with which to predict, or a matrix or vector containing exactly the variables needs for prediction. If missing, the original data points are used.</p> </td></tr> <tr valign="top"><td><code>se</code></td> <td> <p>should standard errors be computed?</p> </td></tr> <tr valign="top"><td><code>na.action</code></td> <td> <p>function determining what should be done with missing values in data frame <code>newdata</code>. The default is to predict <code>NA</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>arguments passed to or from other methods.</p> </td></tr> </table> <h3>Details</h3> <p>The standard errors calculation is slower than prediction. </p> <p>When the fit was made using <code>surface = "interpolate"</code> (the default), <code>predict.loess</code> will not extrapolate – so points outside an axis-aligned hypercube enclosing the original data will have missing (<code>NA</code>) predictions and standard errors. </p> <h3>Value</h3> <p>If <code>se = FALSE</code>, a vector giving the prediction for each row of <code>newdata</code> (or the original data). If <code>se = TRUE</code>, a list containing components </p> <table summary="R valueblock"> <tr valign="top"><td><code>fit</code></td> <td> <p>the predicted values.</p> </td></tr> <tr valign="top"><td><code>se</code></td> <td> <p>an estimated standard error for each predicted value.</p> </td></tr> <tr valign="top"><td><code>residual.scale</code></td> <td> <p>the estimated scale of the residuals used in computing the standard errors.</p> </td></tr> <tr valign="top"><td><code>df</code></td> <td> <p>an estimate of the effective degrees of freedom used in estimating the residual scale, intended for use with t-based confidence intervals. </p> </td></tr> </table> <p>If <code>newdata</code> was the result of a call to <code><a href="../../base/html/expand.grid.html">expand.grid</a></code>, the predictions (and s.e.'s if requested) will be an array of the appropriate dimensions. </p> <p>Predictions from infinite inputs will be <code>NA</code> since <code>loess</code> does not support extrapolation. </p> <h3>Note</h3> <p>Variables are first looked for in <code>newdata</code> and then searched for in the usual way (which will include the environment of the formula used in the fit). A warning will be given if the variables found are not of the same length as those in <code>newdata</code> if it was supplied. </p> <h3>Author(s)</h3> <p>B. D. Ripley, based on the <code>cloess</code> package of Cleveland, Grosse and Shyu. </p> <h3>See Also</h3> <p><code><a href="loess.html">loess</a></code></p> <h3>Examples</h3> <pre> cars.lo <- loess(dist ~ speed, cars) predict(cars.lo, data.frame(speed = seq(5, 30, 1)), se = TRUE) # to get extrapolation cars.lo2 <- loess(dist ~ speed, cars, control = loess.control(surface = "direct")) predict(cars.lo2, data.frame(speed = seq(5, 30, 1)), se = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>