Learn R Programming

RVCompare (version 0.1.8)

cumulativeFromDensity: Get the cumulative distribution function given the distribution function.

Description

Get the cumulative distribution function given the distribution function.

Usage

cumulativeFromDensity(densityX, xlims, sanityChecks = TRUE)

Value

a callable function representing the cumulative distribution.

Arguments

densityX

The probability density function.

xlims

the domain of definition of the density function.

sanityChecks

(optional parameter, default = TRUE) boolean value indicating wether to check if the density function is correctly defined.

Examples

Run this code
cumulativeProbability <- cumulativeFromDensity(normalDensity(0,1), c(-4,4), FALSE)
x <- seq(-4, 4, length.out=101)
plot(x, cumulativeProbability(x), type = "l")

Run the code above in your browser using DataLab