symbolicD: Symbolic Derivatives

View source: R/symbolicD.R

symbolicDR Documentation

Symbolic Derivatives

Description

Constructs symbolic derivatives of some mathematical expressions

Usage

symbolicD(tilde, ..., .order)

Arguments

tilde

a tilde expression with the function call on the left side and the w.r.t. variables on the right side.

...

additional parameters, typically default values for mathematical parameters

.order

a number specifying the order of a derivative with respect to a single variable

Details

Uses the Derivs package for constructing the derivative The .order argument is just for convenience when programming high-order derivatives, e.g. the 5th derivative w.r.t. one variable.

When re-assigning default values for arguments in a function being called, as in D(dnorm(x, mean=3) ~ x), you will get a numerical derivative even when the analytic form is known. To avoid this (when possible) use D(dnorm(x) ~ x, mean=3)

Value

a function implementing the derivative

Author(s)

Daniel Kaplan (kaplan@macalester.edu)

See Also

D, numD, antiD, plotFun

Examples

symbolicD( a*x^2 ~ x)
symbolicD( a*x^2 ~ x&x)
symbolicD( a*sin(x)~x, .order=4)
symbolicD( a*x^2*y+b*y ~ x, a=10, b=100 )
symbolicD( dnorm(x, mn, sd) ~ x, mn=3, sd=2)

mosaicCalc documentation built on Sept. 11, 2024, 9:10 p.m.