paramFitKernelDensity: Parameter Initialization Based on a Kernel Density

Description Usage Arguments Value Examples

View source: R/paramFitKernelDensity.R

Description

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)).

Usage

1
paramFitKernelDensity(X, w, cvh, h = apply(X, 2, sd) * n^(-1/(d + 4)))

Arguments

X

Set of data points (one sample per row)

w

Vector with weights for X (sum(w) == 1)

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

Value

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

Examples

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)

fmlogcondens documentation built on May 2, 2019, 8:29 a.m.