Kernel density derivative estimate for 1- to 6-dimensional data.
kdde(x, H, h, deriv.order=0, gridsize, gridtype, xmin, xmax, supp=3.7,
eval.points, binned=FALSE, bgridsize, positive=FALSE, adj.positive, w,
deriv.vec=TRUE, verbose=FALSE)# S3 method for kdde
predict(object, ..., x)
matrix of data values
bandwidth matrix/scalar bandwidth. If these are missing, Hpi
or hpi
is called by default.
derivative order (scalar)
vector of number of grid points
not yet implemented
vector of minimum/maximum values for grid
effective support for standard normal
vector or matrix of points at which estimate is evaluated
flag for binned estimation. Default is FALSE.
vector of binning grid sizes
flag if 1-d data are positive. Default is FALSE.
adjustment applied to positive 1-d data
vector of weights. Default is a vector of all ones.
flag to compute all derivatives in vectorised derivative. Default is TRUE. If FALSE then only the unique derivatives are computed.
flag to print out progress information. Default is FALSE.
object of class kdde
other parameters
A kernel density derivative estimate is an object of class
kdde
which is a list with fields:
data points - same as input
vector or list of points at which the estimate is evaluated
density derivative estimate at eval.points
scalar bandwidth (1-d only)
bandwidth matrix
"linear"
flag for estimation on a grid
flag for binned estimation
variable names
weights
derivative order (scalar)
each row is a vector of partial derivative indices
For each partial derivative, for grid estimation, the estimate is a
list whose elements
correspond to the partial derivative indices in the rows of deriv.ind
.
For points estimation, the estimate is a matrix whose columns correspond to
rows of deriv.ind
.
If the bandwidth H
is missing from kdde
, then
the default bandwidth is the plug-in selector
Hpi
. Likewise for missing h
.
The effective support, binning, grid size, grid range, positive
parameters are the same as kde
.
# NOT RUN {
set.seed(8192)
x <- rmvnorm.mixt(1000, mus=c(0,0), Sigmas=invvech(c(1,0.8,1)))
fhat <- kdde(x=x, binned=TRUE, deriv.order=1) ## gradient [df/dx, df/dy]
predict(fhat, x=x[1:5,])
## See other examples in ? plot.kdde
# }
Run the code above in your browser using DataLab