Learn R Programming

tfarima (version 0.4.1)

polyderivEvalR: Evaluate the k-th derivative of a polynomial at point z

Description

Evaluate the k-th derivative of a polynomial at point z

Usage

polyderivEvalR(pol, z, k = 0)

Value

Numeric value of the k-th derivative of P(z).

Arguments

pol

Numeric vector of polynomial coefficients in ascending order (pol[1] = constant term, pol[2] = coefficient of z, etc.)

z

Numeric value where the polynomial (or its derivative) is evaluated.

k

Integer. Derivative order (0 = original polynomial).

Examples

Run this code
pol <- c(1, 2, 3, 4)  # P(z) = 1 + 2z + 3z² + 4z³
polyderivEvalR(pol, 2, 0)  # 49
polyderivEvalR(pol, 2, 1)  # 62

Run the code above in your browser using DataLab