varkernel: Kernel Estimates of Empirical Distributions

varkernelR Documentation

Kernel Estimates of Empirical Distributions

Description

Density, CDF, quantile, and RNG functions for empirical distributions estimated with variable-bandwidth kernels.

Usage

dvarkde(x, obj, log = FALSE)

pvarkde(x, obj, log.p = FALSE)

qvarkde(x, obj, log.p = FALSE)

rvarkde(n, obj)

Arguments

x

Vector of quantiles

obj

A varkde object returned by kde

log

Flag indicating that log density should be returned

log.p

Flag indicating that DF probabilities are logs

n

Number of random values to generate

p

Vector of probabilities

Details

In the RNG functions for built-in distributions n can be passed as a vector, in which case the length of the vector is the number of deviates to generate. The main purpose of this functionality seems to be to generate subtle and hard to debug errors; therefore, it is not supported here. Passing a vector for n will generate a warning, and the first value will be used.

Functions

  • dvarkde: Density function

  • pvarkde: Cumulative distribution function

  • qvarkde: Quantile function

  • rvarkde: Random deviate generator

Caution

For all of these functions we evaluate the kernel density estimate on a grid of x (or p) values and construct an interpolating function. Because of this it isn't guaranteed that the mathematical relationships between the functions will necessarily hold exactly. That is, pkde will not necessarily equal the integral of dkde, and qkde may not be an exact inverse of qkde.


rplzzz/varkde documentation built on May 25, 2022, 2:58 p.m.