Partial Derivative dy/d[wrt]

Share:

Description

Returns the numerical partial derivate of y with respect to [wrt] any regressor for a point of interest. Finite difference method is used with VN.reg estimates as f(x+h) and f(x-h) values.

Usage

1
2
3
dy.d_(B, y, wrt, eval.points = "median", order = NULL, s.t.n = 0.9,
  h = 0.1, n.best = 2, mixed = FALSE, plot = FALSE, precision = "LOW",
  norm = NULL, noise.reduction = NULL)

Arguments

B

Complete dataset of regressors in matrix form.

y

Dependent Variable

wrt

Selects the regressor to differentiate with respect to.

eval.points

Regressor points to be evaluated. Set to eval.points="median" to find partial derivatives at the median of every variable. Set to eval.points="last" to find partial derivatives at the last value of every variable.

order

VN.reg order, defaults to 1 for multivariate regressions. If error, make sure order=1.

s.t.n

Signal to noise parameter, sets the threshold of VN.dep which reduces "order" when order=NULL. Defaults to 0.9 to ensure high dependence for higher "order" and endpoint determination.

h

Percentage step used for finite step method. Defaults to h=.1 representing a 10 percent step from the value of the regressor.

n.best

Sets the number of closest regression points to use in kernel weighting. Defaults to 2.

mixed

If mixed derivative is to be evaluated, set mixed=TRUE. Defaults to FALSE.

plot

Set to plot=TRUE to view plot, defaults to FALSE.

precision

Sets the number of regression points for estimates. Set to "HIGH" where the limit condition of every observation as a regression point. Defaults to "LOW".

norm

Normalizes regressors between 0 and 1 for multivariate regression when set to norm="std", or normalizes regressors according to VN.norm when set to norm="VN". Defaults to NULL.

noise.reduction

In low signal:noise situations, noise.reduction="median" uses medians instead of means for partitions, while noise.reduction="mode" (Default setting) uses modes instead of means for partitions. noise.reduction=NULL allows for maximum possible fit.

Value

Returns the 1st derivative "First Derivative", 2nd derivative "Second Derivative", and mixed derivative "Mixed Derivative" (for two independent variables only).

Author(s)

Fred Viole, OVVO Financial Systems

References

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" http://amzn.com/1490523995

Examples

1
2
3
4
set.seed(123);x_1<-runif(100);x_2<-runif(100); y<-x_1^2*x_2^2
B=cbind(x_1,x_2)
## To find derivatives of y wrt 1st regressor
dy.d_(B,y,wrt=1,eval.points=c(.5,.5))