approxD: Approximate Function Derivatives

Description Usage Arguments Value

View source: R/modular_functions.R

Description

approxD approximates the derivative of a specified function at a specified value using a central finite difference approach.

Usage

1
approxD(f, f_params = NULL, x, n = 1, h = sqrt(.Machine$double.eps))

Arguments

f

The function to evaluate, as an expression.

f_params

A list of any associated parameters of f.

x

The value at which to evaluate the derivative of f.

n

The order of derivative to calculate, 1 or 2. Default is 1.

h

The finite difference to use in the approximation. The default value is sqrt(.Machine$double.eps) by which the absolute value of x will be multiplied unless x is 0.

Value

The approximated derivative of the function at the specified value.


bsearchinger/ARS documentation built on Dec. 19, 2021, 12:44 p.m.