dens.estimator: Density Estimator

Description Usage Arguments Value Author(s) Examples

Description

This function takes between 1 and 4 arguments to estimate density of data.

Usage

1
dens.estimator(x,d,h,method="naive")

Arguments

x

is data given as a vector of numbers, to estimate density from.

d

is a number or a vector of numbers, that specifies what points density should be returned for. If nothing is chosen, a table of relevant values are given: Min, 1st quantile, median, mean, 3rd quantile and max of the input data x.

h

is a positive number that specifies the bandwidth used for the density estimation. If nothing is chosen, h is estimated using either Struges method or Silverman's method, depending on the method parameter.

method

is an argument that is either "naive" or "kernel", deciding the method of estimating the density. Defaults to "naive".

Value

Depending on input, either returns density on specific points d, or returns a bandwidth as well as a table of densities estimated at points on data given as: minimum, 1st quantile, median, mean, 3rd quantile, and maximum of x.

Author(s)

Nguyen Khanh Le Ho & Emil H. Andersen
Department of Mathematics and Computer Science (IMADA)
University of Southern Denmark, Denmark
emila14@student.sdu.dk
ngho14@student.sdu.dk

Examples

1
2
3
dens.estimator(cars$speed)
dens.estimator(cars$speed,method="kernel")
dens.estimator(cars$speed,10,3,method="naive")

Chaiji/LemilExamST522 documentation built on May 6, 2019, 9:55 a.m.