Learn R Programming

alR (version 2.2.0)

DD: Calculate derivatives.

Description

Calculate higher order derivatives for use in exact moment calculations.

Usage

DD(expr, name, order)

Arguments

expr

An R expression of the function to be differentiated.

name

A qoted string containing the name of the variable with respect to which the derivative is calculated.

order

The order of the derivative saught.

Value

An R expression of the calculated derivative.

Examples

Run this code
# NOT RUN {
DD(expression(exp(m*t+(1/2)*(s^2)*(t^2))), "t", 1) ## m
DD(expression(exp(m*t+(1/2)*(s^2)*(t^2))), "t", 2) ## m^2+s^2

# }

Run the code above in your browser using DataLab