| gradients | R Documentation |
gradients is a generic function which extracts gradients
from objects.
gradients(x, ...)
## S3 method for class 'condensity'
gradients(x, errors = FALSE, gradient.order = NULL, ...)
## S3 method for class 'condistribution'
gradients(x, errors = FALSE, gradient.order = NULL, ...)
## S3 method for class 'npregression'
gradients(x, errors = FALSE, gradient.order = NULL, ...)
## S3 method for class 'qregression'
gradients(x, errors = FALSE, ...)
## S3 method for class 'singleindex'
gradients(x, errors = FALSE, ...)
Object to interrogate and whether gradient standard errors are requested.
x |
an object for which the extraction of gradients is meaningful. |
errors |
a logical value specifying whether or not standard
errors of gradients are desired. Defaults to |
Optional local-polynomial derivative order controls.
gradient.order |
for |
Further method-specific arguments.
... |
other arguments. |
This function provides a generic interface for extraction of gradients
from objects. For npregression, condensity, and
condistribution objects fitted with regtype="lp",
gradient.order identifies the stored continuous-predictor
derivative order to extract; it is not a post-fit recomputation
control. For qregression objects,
errors=TRUE returns
asymptotic standard errors for the quantile gradients when the object was
fitted with gradients=TRUE.
Gradients extracted from the model object x.
This method currently only supports objects from the np library.
Tristen Hayfield tristen.hayfield@gmail.com, Jeffrey S. Racine racinej@mcmaster.ca
See the references for the method being interrogated via
gradients in the appropriate help file. For example, for
the particulars of the gradients for nonparametric regression see the
references in npreg
fitted, residuals, coef,
and se, for related methods;
np for supported objects.
x <- runif(10)
y <- x + rnorm(10, sd = 0.1)
gradients(npreg(y~x, gradients=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.