kernelest: Runs Kernel Density Estimation for abundance data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/kernelest.R

Description

This function will perform a Kernel Density Estimation

Usage

1
2
kernelest(data, kernel = "gaussian", bandwidth = NULL,
  numberofdatapoints = 1024, CheckData = TRUE)

Arguments

data

data-frame; This is the data the distributions shall be fitted for. It must have two columns, one wih date-objects one with numeric values.

kernel

string; the kerel which shall be used. Can be "gaussian", "epanechnikov", "rectangular", "triangular" or "biweight".

bandwidth

numeric; the bandwidth for the kernel density estimation. If is null it will be determined by the unbiased cross validation using the h.ucv() function from the 'kedd' package.

numberofdatapoints

numeric, whole number; determines, how much datapoints shall be produced by the density() function. As can be seen in the help of density() this shall be a power of two.

CheckData

logical; If TRUE the function will check the data input whether it fits the requirements using the CheckData function. If FALSE it will process without, which might result in wrong results so to use the default value (TRUE) is strongly recommended.

Details

This function performs a simple Kernel Density estimation using the density() function. By default the bandwidth will be selected using the h.ucv() function from the 'kedd' package.

Value

returns a lit with 5 levels: data = results of the kernel density estimation (dataframe) with sublevels 'x' and 'y',estimationmethod = 'kernel density estimation', kernel = used kernel, bandwidth = used bandwidth, startpoint = first date in the data level, endpoint = last point in data level)

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

1
2
3
4
5
a     <- c(1:10)
dates <- as.Date(a, origin = '2017-01-01')
count <- c(1,1,3,4,6,9,5,4,2,1)
dat   <- data.frame(dates, count)
kernelest(dat)

biometry/phenologicalOverlap documentation built on May 21, 2019, 2:31 a.m.