kernel: Univariate and multivariate kernel density estimation

View source: R/kernel.R

Univariate and multivariate kernel density estimationR Documentation

Univariate and multivariate kernel density estimation

Description

Univariate and multivariate kernel density estimation.

Usage

kernel(x, h = "silverman", parallel = FALSE, cores = 0)

Arguments

x

A numerical vector or a matrix with the data.

h

The bandwidth, it can be a value, a vector of values or NULL, in which case Silverman's rule is applied.

parallel

A boolean value for parallel version.

cores

In case you set parallel = TRUE, then you need to specify the number of cores.

Details

The function computes the kernel density estimate, using a Gaussian kernel, for a vector or a matrix. The user provides the bandwidth, other Silverman's rule is applied. For the case of multivariate data the data are standardized (variable-wise) first and the same bandwith is used.

Value

If h is a single number, then this is a vector with the estimated values. If h is a vector of values this is a matrix where each column corresponds to a value of h.

Author(s)

Michail Tsagris and Manos Papadakis.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Manos Papadakis papadakm95@gmail.com.

See Also

boot.student2, perm.ttest2, welch.tests, jack.mean

Examples

x <- rexp(50)
a <- kernel(x, h = 1)

Rfast2 documentation built on April 11, 2025, 6:15 p.m.