gradients.Rdgradients is a generic function which extracts gradients
from objects.
gradients(x, ...)
# S3 method for class 'condensity'
gradients(x, errors = FALSE, ...)
# S3 method for class 'condistribution'
gradients(x, errors = FALSE, ...)
# S3 method for class 'npregression'
gradients(x, errors = FALSE, ...)
# S3 method for class 'qregression'
gradients(x, errors = FALSE, ...)
# S3 method for class 'singleindex'
gradients(x, errors = FALSE, ...)Gradients extracted from the model object x.
This function provides a generic interface for extraction of gradients from objects.
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
This method currently only supports objects from the np library.
x <- runif(10)
y <- x + rnorm(10, sd = 0.1)
gradients(npreg(y~x, gradients=TRUE))
#>
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 /
Multistart 1 of 1 |
Multistart 1 of 1 |
#> [,1]
#> [1,] 1.013449e+00
#> [2,] 1.510146e-05
#> [3,] 1.331491e+00
#> [4,] -7.815702e-01
#> [5,] 1.559822e-01
#> [6,] -6.880549e-01
#> [7,] 7.476167e-01
#> [8,] 3.885481e-01
#> [9,] 2.361475e-01
#> [10,] -4.420755e-01