IntegrableFunction: Integrable Functions

Description Usage Arguments Details See Also

View source: R/integrable_function.R

Description

Many functions of the KDE package work with densities and kernels, which are integrable in the mathematical sense. See 'Details' for exact requirements. The S3 class IntegrableFunction tries to ensure some of the properties of integrable functions and serves as superclass for the more specific S3 classes Density and Kernel.

Usage

1
IntegrableFunction(fun, support = NULL, subdivisions = 1000L, ...)

Arguments

fun

a R function taking a single numeric argument and returning a numeric vector of the same length. See 'Details' for further requirements.

support

numerical vector of length 2; the lower- and upper bound of the compact support in the first and second entry respectively. In particular non-finite values are prohibited. IntegrableFunction will try to find bounds on the support itself if NULL is passed.

subdivisions

positive numeric scalar; the subdivisions parameter for the function integrate_primitive.

...

additional parameters to keep fixed during the evaluation of fun.

Details

Integrable functions as R functions are required to

  1. be vectorised in its argument, taking a single numeric argument, returning a numerical vector of the same length only,

  2. return zero for inputs outside their compact support,

  3. can be integrated over their support using integrate_primitive and the given number of subdivisions (the relative error converges).

Notice that a compact support may sound like a strong restriction, but since every integrable function is near zero outside of a compact set this is computatianlly always given for integrable functions.

The functions in this package don't just take R functions satisfying these conditions, but objects of S3 class IntegrableFunction (or one of its subclasses Kernel, Density).

The S3 class IntegrableFunction exists to ensure some of the most basic properties of integrable functions. The class is build on lists containing three named entries fun, support and subdivisions

The constructor IntegrableFunction tries to construct a valid IntegrableFunction object based on the passed arguments. Returned objects are guaranteed to pass the validator validate_IntegrableFunction.

Attention: This does not guarantee the conditions in the first 'Details' paragraph. See validate_IntegrableFunction for further information.

See Also

integrate_primitive for the integration method used, Kernel/Density for more information about kernels/densities.


hericks/KDE documentation built on Aug. 22, 2020, 12:04 a.m.