multiLocal.knn: Estimate a multivariate density function using the LGDE and...

Description Usage Arguments Value Examples

View source: R/multivariate_estimation.R

Description

Estimate a multivariate density function using the LGDE and kNN bandwidths.

Usage

1
2
3
multiLocal.knn(data, k.mat = NULL, gsize = 15, grid = apply(data, 2,
  function(x) seq(quantile(x, 0.001), quantile(x, 0.999), length.out = gsize)),
  test = seq(20, 100, by = 3))

Arguments

data

The data matrix, one row per observation.

k.mat

A matrix of k. Must be in the same format as is produced by the kLocal-function.

gsize

If grid is not provided, the density will be estimated at gsize points going diagonally through the data.

grid

The grid at which to estimate the density. Must be a matrix with the same number of columns as the data matrix.

Value

A list with 6 elements: $f.est are the density estimates at the grid points, $d is the dimension, $loc.cor are the local correlations, $k.mat is the matrix of k's that was used, $pairs is a two-column matrix indicating all pairs of variables, $grid is the grid at which the density has been estimated, $test is a vector of k's to test for cross-validation.

Examples

1
2
data <- cbind(rt(100, df = 10), rt(100, df = 10))
multiLocal.knn(data)

hotneim/lgde documentation built on May 17, 2019, 4:52 p.m.