fdCoefficients: Finite difference coefficients.

View source: R/finiteDifferenceDerivatives.R

fdCoefficientsR Documentation

Finite difference coefficients.

Description

Calculation of coefficients for finite-difference approximation of derivative of order p with error of order O(h^(p+k)), given a vector of function values.

Usage

fdCoefficients(p, k)

Arguments

p

Derivative order.

k

Desired accuracy.

h

Grid step size.

f0

Value of function at differentiation point.

fVal

Values of function at points that will be used for approximation.

Details

If p+k is odd, the finite difference scheme will be asymmetric, with one more point on the negative side.

Value

fdCoefficients Vector of coefficients for linear combination of function values that will give the desired finite-difference approximation.

fdDerivative numerical derivative based on vector of function values.


piotrek-orlowski/affineModelR documentation built on July 11, 2022, 3:25 p.m.