dkernelBC: Boundary-corrected Kernel Density Function

View source: R/kernelsBC.R

dkernelBCR Documentation

Boundary-corrected Kernel Density Function

Description

Computes the boundary-corrected version of a smoothing kernel density function.

Usage

dkernelBC(x, mean, sd = 1, kernel = "gaussian",
       zerocor = c("none", "weighted", "convolution",
                    "reflection", "bdrykern"))

Arguments

x

Numeric. Values of the function argument, at which the function should be evaluated.

mean

Numeric. The mean of the uncorrected kernel.

sd

Numeric value. The standard deviation of the uncorrected kernel.

kernel

Character string giving the name of the kernel as recognised by match.kernel.

zerocor

String (partially matched) specifying a correction for the boundary effect bias at r=0 when estimating a density on the positive half line. Possible values are "none", "weighted", "convolution", "reflection", and "bdrykern".

Details

The kernel density function identified by kernel with standard deviation sd and mean mean will be computed, and truncated onto the positive half-line. The boundary correction specified by zerocor will then be applied. The result is the vector of corrected density values.

Value

Numeric value or numeric vector.

Author(s)

\adrian

.

See Also

densityBC to compute a density estimate using the boundary-corrected kernel.

dkernel to compute the un-corrected kernel density function, and density.default to compute an uncorrected density estimate.

match.kernel for the list of recognised names of kernels.

Examples

  curve(dkernelBC(x, mean=1, zerocor="none"), to=5)
  curve(dkernelBC(x, mean=1, zerocor="weighted"), to=5)
  curve(dkernelBC(x, mean=1, zerocor="reflection"), to=5)
  curve(dkernelBC(x, mean=1, zerocor="convolution"), to=5)
  curve(dkernelBC(x, mean=1, zerocor="bdrykern"), to=5)

spatstat.univar documentation built on June 8, 2025, 12:52 p.m.