Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

kde.truncate

Truncated kernel density derivative estimate


Description

Truncated kernel density derivative estimate for 2-dimensional data.

Usage

kde.truncate(fhat, boundary) 
kdde.truncate(fhat, boundary)

Arguments

fhat

object of class kde or kdde

boundary

two column matrix delimiting the boundary for truncation

Details

A simple truncation is performed on the kernel estimator. All the points in the estimation grid which are outside of the regions delimited by boundary are set to 0, and their probability mass is distributed proportionally to the remaining density (derivative) values.

Value

A truncated kernel density (derivative) estimate inherits the same object class as the input estimate.

See Also

Examples

library(oz)
data(grevillea)
wa.coast <- ozRegion(section=1)
wa.polygon <- cbind(wa.coast$lines[[1]]$x, wa.coast$lines[[1]]$y)
fhat <- kde(x=grevillea)
fhat <- kde.truncate(fhat, wa.polygon)
oz(section=1)
plot(fhat, add=TRUE, cont=seq(10,90,by=10), col=2, drawlabels=FALSE, drawpoints=TRUE)

ks

Kernel Smoothing

v1.12.0
GPL-2 | GPL-3
Authors
Tarn Duong [aut, cre], Matt Wand [ctb], Jose Chacon [ctb], Artur Gramacki [ctb]
Initial release
2021-02-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.