ffunCreate: Create density or distribution of probabilities functions...

Description Usage Arguments Value See Also Examples

View source: R/densities.R

Description

ffunCreate creates a density or a distribution of probabilites function from a given set of data. The resulting function will interpolate the intermediate values using the given aprxf approximation function.

Usage

1
ffunCreate(x.data, aprxf = dapproxfun, accumulate = FALSE, ...)

Arguments

x.data

A numeric vector containing the data.

aprxf

A function used to create an interpolation function.

accumulate

If TRUE, it indicates that the resulting function is a distribution function, i.e., an accumulated density function; otherwise, the result will be a density of probabilities function.

...

All the other, optional, parameters required by density function to generate a kernel density estimation from the data.

Value

Either a denstity or a distribution function from the data. If the parameter accumulate is TRUE, the resulting function will be an accumulated density of probabilities function, also known as a distribution of probabilities function, otherwise, the resulting function will be a density of probabilities function.

To perform its task, ffunCreate generates a series of points in the domain and then interpolates using the interpolation function resulting from applying the given aprxf approximation function.

See Also

density

Examples

1
2
3
4
5
6
7
X <- log(rgamma(150,5)) # Random data generation
dfun <- ffunCreate(X)   # To create a density function from X
dfun(c(0.45, 1.84, 2.3))
plot(dfun, xlim=c(-0.1, 3.0))

pfun <- ffunCreate(X, dsplinefun, accumulate=T) # To create a distribution spline interpolated function
plot(pfun, xlim=c(-0.1, 3.0))

juliosergio/spitools documentation built on May 24, 2019, 5:01 a.m.