Description Usage Arguments Value Examples
View source: R/paramFitKernelDensity.R
paramFitKernelDensity
first fits a kernel density to a
sample X with weight vector w. It then calculates the parameters of the
piecewise linear function defined to be the upper convex hull of
(X,log(y)).
1 | paramFitKernelDensity(X, w, cvh, h = apply(X, 2, sd) * n^(-1/(d + 4)))
|
X |
Set of data points (one sample per row) |
w |
Vector with weights for X ( |
cvh |
Matrix where each row is a set of indices of points in X describing one face of conv(X) |
h |
Scalar parameter that governs the Gaussian kernel |
A list containing the description of the upper convex hull of (X,log(y)) in term of hyperplane parameters:
a |
A matrix where each row constitutes the normal vector of a face |
b |
A vector where each entry constitutes the offset of a face |
1 2 3 4 5 6 | # draw samples from normal distribution
X <- matrix(rnorm(200),100,2)
# calculate parameters of convex hull of X
r <- calcCvxHullFaces(X)
# find initial hyperplane parameters based on a kernel density estimator with Gaussian kernel
params <- paramFitKernelDensity(X, rep(1 / nrow(X), nrow(X)), r$cvh)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.