EVOLUTION-MANAGER
Edit File: numericDeriv.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 Derivatives Numerically</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 numericDeriv {stats}"><tr><td>numericDeriv {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Evaluate Derivatives Numerically</h2> <h3>Description</h3> <p><code>numericDeriv</code> numerically evaluates the gradient of an expression. </p> <h3>Usage</h3> <pre> numericDeriv(expr, theta, rho = parent.frame(), dir = 1.0) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>The expression to be differentiated. The value of this expression should be a numeric vector.</p> </td></tr> <tr valign="top"><td><code>theta</code></td> <td> <p>A character vector of names of numeric variables used in <code>expr</code>.</p> </td></tr> <tr valign="top"><td><code>rho</code></td> <td> <p>An environment containing all the variables needed to evaluate <code>expr</code>.</p> </td></tr> <tr valign="top"><td><code>dir</code></td> <td> <p>A numeric vector of directions to use for the finite differences.</p> </td></tr> </table> <h3>Details</h3> <p>This is a front end to the C function <code>numeric_deriv</code>, which is described in <em>Writing R Extensions</em>. </p> <p>The numeric variables must be of type <code>real</code> and not <code>integer</code>. </p> <h3>Value</h3> <p>The value of <code>eval(expr, envir = rho)</code> plus a matrix attribute called <code>gradient</code>. The columns of this matrix are the derivatives of the value with respect to the variables listed in <code>theta</code>. </p> <h3>Author(s)</h3> <p>Saikat DebRoy <a href="mailto:saikat@stat.wisc.edu">saikat@stat.wisc.edu</a></p> <h3>Examples</h3> <pre> myenv <- new.env() assign("mean", 0., envir = myenv) assign("sd", 1., envir = myenv) assign("x", seq(-3., 3., len = 31), envir = myenv) numericDeriv(quote(pnorm(x, mean, sd)), c("mean", "sd"), myenv) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>