ptriangle {rotRPackage}R Documentation

Cumulative Distribution Function of a triangular distribution

Description

This function computes the CDF of the triangular distribution over the given input vector.

Usage

ptriangle(x, a=0, m=0.5, b=1)

Arguments

x Point(s) where the CDF is computed, vector
a The lower bound of the Triangular distribution, real.
m The most likely value of the Triangular distribution, real, a <= m <= b.
b The upper bound of the Triangular distribution, real, b > a

Details

The triangular distribution has the following density function: $$ f(x, a, m, b) = 2 (x - a) / ((m - a)(b - a)) if a <= x <= m f(x, a, m, b) = 2 (b - x) / ((b - m)(b - a)) if m < x <= b $$

Value

The CDF value(s), vector

Author(s)

Pierre-Matthieu Pair, Régis Lebrun.

Examples

# Standard Triangular distribution example. 

x <- (1000) * 8 
plot(x, ptriangle(x, 1, 3, 7))

[Package rotRPackage version 1.4.3 Index]