dy.dx: Partial Derivative dy/dx

View source: R/dy_dx.R

dy.dxR Documentation

Partial Derivative dy/dx

Description

Returns the numerical partial derivative of y wrt x for a point of interest.

Usage

dy.dx(x, y, eval.point = NULL)

Arguments

x

a numeric vector.

y

a numeric vector.

eval.point

numeric or ("overall"); x point to be evaluated, must be provided. Defaults to (eval.point = NULL). Set to (eval.point = "overall") to find an overall partial derivative estimate (1st derivative only).

Value

Returns a data.table of eval.point along with both 1st and 2nd derivative.

Note

If a vector of derivatives is required, ensure (deriv.method = "FD").

Author(s)

Fred Viole, OVVO Financial Systems

References

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" https://www.amazon.com/dp/1490523995/ref=cm_sw_su_dp

Vinod, H. and Viole, F. (2017) "Nonparametric Regression Using Clusters" https://link.springer.com/article/10.1007/s10614-017-9713-5

Examples

## Not run: 
x <- seq(0, 2 * pi, pi / 100) ; y <- sin(x)
dy.dx(x, y, eval.point = 1.75)

# First derivative
dy.dx(x, y, eval.point = 1.75)[ , first.derivative]

# Second derivative
dy.dx(x, y, eval.point = 1.75)[ , second.derivative]

# Vector of derivatives
dy.dx(x, y, eval.point = c(1.75, 2.5))

## End(Not run)

OVVO-Financial/NNS documentation built on April 22, 2024, 10:26 p.m.