File: continuous_triang.rst

package info (click to toggle)
python-scipy 0.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 75,464 kB
  • ctags: 79,406
  • sloc: python: 143,495; cpp: 89,357; fortran: 81,650; ansic: 79,778; makefile: 364; sh: 265
file content (46 lines) | stat: -rw-r--r-- 1,925 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

.. _continuous-triang:

Triangular Distribution
=======================

One shape parameter :math:`c\in[0,1]` giving the distance to the peak as a percentage of the total extent of
the non-zero portion. The location parameter is the start of the non-
zero portion, and the scale-parameter is the width of the non-zero
portion. In standard form we have :math:`x\in\left[0,1\right].`

.. math::
   :nowrap:

    \begin{eqnarray*}
        f\left(x;c\right) & = & \left\{
                                    \begin{array}{ccc}
                                        2\frac{x}{c} &  & x < c \\
                                        2\frac{1-x}{1-c} &  & x \geq c
                                    \end{array}
                                \right.\\
        F\left(x;c\right) & = & \left\{
                                    \begin{array}{ccc}
                                        \frac{x^{2}}{c} &  & x < c \\
                                        \frac{x^{2}-2x+c}{c-1} &  & x \geq c
                                    \end{array}
                                \right.\\
        G\left(q;c\right) & = & \left\{
                                    \begin{array}{ccc}
                                        \sqrt{cq} &  & q < c \\
                                        1-\sqrt{\left(1-c\right)\left(1-q\right)} &  & q \geq c
                                    \end{array}
                                \right.
    \end{eqnarray*}

.. math::
   :nowrap:

    \begin{eqnarray*} \mu & = & \frac{c}{3}+\frac{1}{3}\\ \mu_{2} & = & \frac{1-c+c^{2}}{18}\\ \gamma_{1} & = & \frac{\sqrt{2}\left(2c-1\right)\left(c+1\right)\left(c-2\right)}{5\left(1-c+c^{2}\right)^{3/2}}\\ \gamma_{2} & = & -\frac{3}{5}\end{eqnarray*}

.. math::
   :nowrap:

    \begin{eqnarray*} h\left(X\right) & = & \log\left(\frac{1}{2}\sqrt{e}\right)\\  & \approx & -0.19314718055994530942.\end{eqnarray*}

Implementation: `scipy.stats.triang`