Triangular Distribution - Generating Triangular-distributed Random Variates

Generating Triangular-distributed Random Variates

Given a random variate U drawn from the uniform distribution in the interval (0, 1), then the variate


\begin{matrix}
\begin{cases}
X = a + \sqrt{U(b-a)(c-a)} & \text{ for } 0 < U < F(c) \\ & \\
X = b - \sqrt{(1-U)(b-a)(b-c)} & \text{ for } F(c) \le U < 1
\end{cases}
\end{matrix}

Where F(c) = (c-a)/(b-a)

has a Triangular distribution with parameters a, b and c. This can be obtained from the cumulative distribution function.

Read more about this topic:  Triangular Distribution

Famous quotes containing the word random:

    Novels as dull as dishwater, with the grease of random sentiments floating on top.
    Italo Calvino (1923–1985)