derivative {KneeArrower}R Documentation

Derivative of a function with respect to x

Description

Derivative of a function with respect to x

Usage

derivative(x, y, m = 0, n = 50)

Arguments

x

x coordinates of points in function's domain

y

y coordinates of points in function's range

m

the order of the derivative (0 for y, 1 for y', 2 for y”)

n

number of points in the domain for interpolation

Value

a function representing the mth derivative of y(x) with respect to x

Examples

x <- seq(0,5,0.1)
y <- x^2 - 2*x + 3 # So dy/dx = 2x - 2
fp <- derivative(x, y, 1)
fp(2) # 2
fp(5) # 8

[Package KneeArrower version 1.0.0 Index]