Learn R Programming

provenance (version 0.2)

getKDE: Create a kernel density estimate

Description

Turns a vector of numbers into an object of class KDE using a combination of the Botev (2010) bandwidth selector and the Abramson (1982) adaptive kernel bandwidth modifier.

Usage

getKDE(x, from = NA, to = NA, bw = NA, adaptive = TRUE, log = FALSE)

Arguments

x
a vector of numbers
from
minimum age of the time axis. If NULL, this is set automatically
to
maximum age of the time axis. If NULL, this is set automatically
bw
the bandwidth of the KDE. If NULL, bw will be calculated automatically using botev()
adaptive
boolean flag controlling if the adaptive KDE modifier of Abramson (1982) is used
log
transform the ages to a log scale if TRUE

Examples

Run this code
fname <- system.file("DZ.csv",package="provenance")
DZ <- read.DZdata(fname)
samp <- DZ$x[['N1']]
dens <- getKDE(samp,0,3000)
plot(dens)

Run the code above in your browser using DataLab