EVOLUTION-MANAGER
Edit File: predict.bSpline.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: Evaluate a Spline at New Values of x</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.bSpline {splines}"><tr><td>predict.bSpline {splines}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Evaluate a Spline at New Values of x</h2> <h3>Description</h3> <p>The <code>predict</code> methods for the classes that inherit from the virtual classes <code>bSpline</code> and <code>polySpline</code> are used to evaluate the spline or its derivatives. The <code>plot</code> method for a spline object first evaluates <code>predict</code> with the <code>x</code> argument missing, then plots the resulting <code>xyVector</code> with <code>type = "l"</code>.</p> <h3>Usage</h3> <pre> ## S3 method for class 'bSpline' predict(object, x, nseg = 50, deriv = 0, ...) ## S3 method for class 'nbSpline' predict(object, x, nseg = 50, deriv = 0, ...) ## S3 method for class 'pbSpline' predict(object, x, nseg = 50, deriv = 0, ...) ## S3 method for class 'npolySpline' predict(object, x, nseg = 50, deriv = 0, ...) ## S3 method for class 'ppolySpline' predict(object, x, nseg = 50, deriv = 0, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>An object that inherits from the <code>bSpline</code> or the <code>polySpline</code> class.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>A numeric vector of <code>x</code> values at which to evaluate the spline. If this argument is missing a suitable set of <code>x</code> values is generated as a sequence of <code>nseq</code> segments spanning the range of the knots.</p> </td></tr> <tr valign="top"><td><code>nseg</code></td> <td> <p>A positive integer giving the number of segments in a set of equally-spaced <code>x</code> values spanning the range of the knots in <code>object</code>. This value is only used if <code>x</code> is missing.</p> </td></tr> <tr valign="top"><td><code>deriv</code></td> <td> <p>An integer between 0 and <code>splineOrder(object) - 1</code> specifying the derivative to evaluate.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Value</h3> <p>an <code>xyVector</code> with components </p> <table summary="R valueblock"> <tr valign="top"><td><code>x</code></td> <td> <p>the supplied or inferred numeric vector of <code>x</code> values</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>the value of the spline (or its <code>deriv</code>'th derivative) at the <code>x</code> vector</p> </td></tr> </table> <h3>Author(s)</h3> <p>Douglas Bates and Bill Venables</p> <h3>See Also</h3> <p><code><a href="xyVector.html">xyVector</a></code>, <code><a href="interpSpline.html">interpSpline</a></code>, <code><a href="periodicSpline.html">periodicSpline</a></code> </p> <h3>Examples</h3> <pre> require(graphics); require(stats) ispl <- interpSpline( weight ~ height, women ) opar <- par(mfrow = c(2, 2), las = 1) plot(predict(ispl, nseg = 201), # plots over the range of the knots main = "Original data with interpolating spline", type = "l", xlab = "height", ylab = "weight") points(women$height, women$weight, col = 4) plot(predict(ispl, nseg = 201, deriv = 1), main = "First derivative of interpolating spline", type = "l", xlab = "height", ylab = "weight") plot(predict(ispl, nseg = 201, deriv = 2), main = "Second derivative of interpolating spline", type = "l", xlab = "height", ylab = "weight") plot(predict(ispl, nseg = 401, deriv = 3), main = "Third derivative of interpolating spline", type = "l", xlab = "height", ylab = "weight") par(opar) </pre> <hr /><div style="text-align: center;">[Package <em>splines</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>