BoundedDensity | R Documentation |
"BoundedDensity"
This class deals with generic estimations of a bounded densities. The probability density function is approximated by providing a set of data points in a lower and upper bounded interval and their associated densities. Using this information, the methods implemented in the class can be used to compute densities, values of the distribution function, quantiles, sample the distribution and obtain graphical representations.
Objects can be created by using the generator function boundedDensity
.
dataPointsCache
:a numeric vector containing points within the [lower.limit,upper.limit]
interval
densityCache
:a numeric vector containing the density for each point in dataPointsCache
distributionCache
:a numeric vector used to cache the values of the distribution function. This slot is included to improve the performance of the methods when multiple calculations of the distribution function are used
lower.limit
:a numeric value for the lower limit of the bounded interval for the data
upper.limit
:a numeric value for the upper limit of the bounded interval for the data
See "density"
for details
See "distribution"
for details
See "quantile"
for details
See "rsample"
for details
See "plot"
for details
See "getdataPointsCache"
for details
See "getdensityCache"
for details
See "getdistributionCache"
for details
Guzman Santafe, Borja Calvo and Aritz Perez
# data points and its densities a <- seq(0,1,0.01) b <- dbeta(a,5,10) # create the density model model <- boundedDensity(x=a,densities=b) # examples of usual functions density(model,0.5) distribution(model,0.2,discreteApproximation=FALSE) distribution(model,0.2,discreteApproximation=TRUE) # graphical representation hist(b,freq=FALSE) lines(model, col="red",lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.