// Home / Documentation / Gallery of Distributions / Triangular distribution

Triangular distribution

Where do you meet this distribution?

Shape of Distribution

Basic Properties

  • Three parameters a, b, c are required (How can you get these).
    a<c<b

    These parameters are minimum value of variable, maximum value of variable and mode of the distribution respectively.

  • Continuous distribution defined on bounded range a\leq x \leq b
  • This distribution can be symmetric or asymmetric.

Probability

  • Cumulative distribution function
    F(x)=\begin{cases}\frac{(x-a)^2}{(b-a)(c-a)}\quad&(a\leq x<c)\\1-\frac{(b-x)^2}{(b-a)(b-c)}\quad&(c\leq x\leq b)\end{cases}
  • Probability density function
    f(x)=\begin{cases}\frac{2(x-a)}{(b-a)(c-a)}\quad&(a\leq x<c)\\\frac{2(b-x)}{(b-a)(b-c)}\quad&(c\leq x\leq b)\end{cases}
  • How to compute these on Excel.
     
    1
    2
    3
    4
    5
    6
    7
       
    8
       
    A B
    Data Description
    1.5 Value for which you want the distribution
    1 Value of parameter Min
    3 Value of parameter Max
    1.4 Value of parameter Mode
    Formula Description (Result)
    =NTTRIANGULARDIST(A2,A3,A4,A5,TRUE) Cumulative distribution function for the terms above
    =NTTRIANGULARDIST(A2,A3,A4,A5,FALSE) Probability density function for the terms above
  • Function reference : NTTRIANGULARDIST

Triangular distribution

Quantile

  • Inverse function of cumulative distribution function
    F^{-1}(P)=\begin{cases}\sqrt{P(c-a)(b-a)}+a\quad&\left(P< \frac{c-a}{b-a}\right)\\-\sqrt{(1-P)(b-c)(b-a)}+b\quad&\left(P\geq \frac{c-a}{b-a}\right)\end{cases}[/latex]</div> </li> <li>How to compute this on Excel.  <table class="table_example"> <tbody> <tr> <td class="table_number"> <table> <tbody> <tr> <th class="underthick"> </th> </tr> <tr> <th>1</th> </tr> <tr> <th>2</th> </tr> <tr> <th>3</th> </tr> <tr> <th>4</th> </tr> <tr> <th>5</th> </tr> <tr> <th>6</th> </tr> <tr> <th>7    </th> </tr> </tbody> </table> </td> <td> <table> <tbody> <tr> <th class="underthick">A</th> <th class="underthick">B</th> </tr> <tr> <th class="elements">Data</th> <th class="elements">Description</th> </tr> <tr> <td>0.5</td> <td>Probability associated with the distribution</td> </tr> <tr> <td>1</td> <td>Value of parameter Min</td> </tr> <tr> <td>3</td> <td>Value of parameter Max</td> </tr> <tr> <td>1.4</td> <td>Value of parameter Mode</td> </tr> <tr> <th class="elements">Formula</th> <th class="elements">Description (Result)</th> </tr> <tr> <td>=NTTRIANGULARINV(A2,A3,A4,A5)</td> <td>Inverse of the cumulative distribution function for the terms above</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </li> <li>Function reference : <a href="/nttriangularinv/">NTTRIANGULARINV</a></li> </ul> </div> <h2>Characteristics</h2> <h3>Mean<span class="sub"> - Where is the ``center'' of the distribution? (<a href="/glossary/#local_mean">Definition</a>)</span></h3> <div class="detail"> <ul class="dot"> <li><a href="/glossary/#local_mean">Mean</a> of the distribution is given as <div class="eq">[latex]\frac{a+b+c}{3}
  • How to compute this on Excel
     
    1
    2
    3
    4
    5
    6
    A B
    Data Description
    1 Value of parameter Min
    3 Value of parameter Max
    1.4 Value of parameter Mode
    Formula Description (Result)
    =NTTRIANGULARMEAN(A2,A3,A4) Mean of the distribution for the terms above
  • Function reference : NTTRIANGULARMEAN

Standard Deviation – How wide does the distribution spread? (Definition)

  • Variance of the distribution is given as
    \frac{a^2+b^2+c^2-ab-bc-ca}{18}

    Standard Deviation is a positive square root of Variance.

  • How to compute this on Excel
     
    1
    2
    3
    4
    5
    6
       
    A B
    Data Description
    1 Value of parameter Min
    3 Value of parameter Max
    1.4 Value of parameter Mode
    Formula Description (Result)
    =NTTRIANGULARSTDEV(A2,A3,A4) Standard deviation of the distribution for the terms above
  • Function reference : NTTRIANGULARSTDEV

Skewness – Which side is the distribution distorted into? (Definition)

  • Skewness of the distribution is given as
    \frac{\sqrt{2}(a+b-2c)(2a-b-c)(a-2b+c)}{5(a^2+b^2+c^2-ab-bc-ca)^{3/2}}
  • How to compute this on Excel
     
    1
    2
    3
    4
    5
    6
       
    A B
    Data Description
    1 Value of parameter Min
    3 Value of parameter Max
    1.4 Value of parameter Mode
    Formula Description (Result)
    =NTTRIANGULARSKEW(A2,A3,A4) Skewness of the distribution for the terms above
  • Function reference : NTTRIANGULARSKEW

Kurtosis – Sharp or Dull, consequently Fat Tail or Thin Tail (Definition)

  • Kurtosis is -0.6 .

Random Numbers

  • Random number x is generated by inverse function method, which is for uniform random U,
    x=\begin{cases}\sqrt{U(c-a)(b-a)}+a\quad&\left(U< \frac{c-a}{b-a}\right)\\-\sqrt{(1-U)(b-c)(b-a)}+b\quad&\left(U\geq \frac{c-a}{b-a}\right)\end{cases}[/latex]
  • How to generate random numbers on Excel.
     
    1
    2
    3
    4
    5
    6
       
    A B
    Data Description
    0 Value of parameter A
    3 Value of parameter B
    1.8 Value of parameter C
    Formula Description (Result)
    =NTRANDTRIANGULAR(100,A2,A3,A5,0) 100 triangular deviates based on Mersenne-Twister algorithm for which the parameters above

    Note The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select the range A6:A105 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER.

NtRand Functions

Reference

 

Comments are closed.