num.deriv: Numerical derivative by Ridders' method.

Description Usage Arguments Value Author(s) References See Also Examples

Description

Evaluates numerically the derivative of a function at a point by Ridders' method.

Usage

1
num.deriv(fun, x, h=0.5, ...)

Arguments

fun

function

x

location of function

h

initial stepsize

...

further parameters to function

Value

List with components

deriv

the derivative value.

error

estimate of the error.

Author(s)

Sandro Klippel

References

Press, W., Teukolsky, S., Vetterling, W., Flannery, B., 1992. Numerical Recipes in FORTRAN 77: The Art of Scientific Computing, 2nd Edition. Cambridge University Press, Cambridge.

See Also

F0.1

Examples

1
2
3
4
5
6
7
8
9
# F(x)  = x^3 / 3 - x
# F'(x) = x^2 - 1 
num.deriv(fun=function(x){x^3/3-x},-1)
(-1^2)-1

# F(x)  = sin(x)
# F'(x) = cos(x)
num.deriv(sin, 4)
cos(4)

sandroklippel/fishassess documentation built on June 5, 2019, 10:54 a.m.