Description Usage Arguments Details See Also
View source: R/integrable_function.R
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.
1 | IntegrableFunction(fun, support = NULL, subdivisions = 1000L, ...)
|
fun |
a |
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. |
subdivisions |
positive numeric scalar; the subdivisions parameter for
the function |
... |
additional parameters to keep fixed during the evaluation of
|
Integrable functions as R functions are required to
be vectorised in its argument, taking a single numeric argument, returning a numerical vector of the same length only,
return zero for inputs outside their compact support,
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
fun is a R function (the represented function) taking a
single numeric argument (additional to the fixed arguments in ...)
and returning a numeric vector of the same length. This function should
return near zero outside of the interval given in the support entry.
support is a numeric vector of length 2 containing a lower-
and upperbound for the support of the function stored in fun in its
first and second entry respectively. In particular the values -Inf
and Inf are allowed.
subdivisions is a positive numeric scalar used as the
subdivisions parameter for integrate_primitive. The function
fun should be integrable (the relative error converges). Therefore
the subdivisions parameter should to be large enough, such that
integrate_primitive yields a sufficiently accurate result.
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.
integrate_primitive for the integration method used,
Kernel/Density for more information about
kernels/densities.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.