1%feature("docstring") OT::Triangular
2"Triangular distribution.
3
4Available constructors:
5    Triangular(*a=-1.0, m=0.0, b=1.0*)
6
7Parameters
8----------
9a : float
10    Lower bound.
11m : float, :math:`a \leq m \leq b`
12    Mode.
13b : float, :math:`a < b`
14    Upper bound.
15
16
17Notes
18-----
19Its probability density function is defined as:
20
21.. math::
22
23    f_X(x) = \left\{
24                 \begin{array}{ll}
25                 \displaystyle \frac{2(x - a)}{(m - a)(b - a)}
26                               & a \leq x \leq m \\
27                 \displaystyle \frac{2(b - x)}{(b - m)(b - a)}
28                               & m \leq x \leq b
29                 \end{array}
30             \right., \quad x \in [a, b]
31
32Its first moments are:
33
34.. math::
35    :nowrap:
36
37    \begin{eqnarray*}
38        \Expect{X} & =  & \frac{1}{3}\,(a+m+b) \\
39        \Var{X} & = & \frac{1}{18} (a^2+b^2+m^2-ab-am-bm)
40    \end{eqnarray*}
41
42Examples
43--------
44Create a distribution:
45
46>>> import openturns as ot
47>>> distribution = ot.Triangular(1.0, 2.5, 4.0)
48
49Draw a sample:
50
51>>> sample = distribution.getSample(5)"
52
53// ---------------------------------------------------------------------
54
55%feature("docstring") OT::Triangular::getA
56"Accessor to the distribution's lower bound.
57
58Returns
59-------
60a : float
61    Lower bound."
62
63// ---------------------------------------------------------------------
64
65%feature("docstring") OT::Triangular::getB
66"Accessor to the distribution's upper bound.
67
68Returns
69-------
70b : float
71    Upper bound."
72
73// ---------------------------------------------------------------------
74
75%feature("docstring") OT::Triangular::getM
76"Accessor to the distribution's mode.
77
78Returns
79-------
80m : float
81    Mode."
82
83// ---------------------------------------------------------------------
84
85%feature("docstring") OT::Triangular::setAMB
86"Accessor to the distribution's parameters.
87
88Parameters
89----------
90a : float
91    Lower bound.
92m : float, :math:`a \leq m \leq b`
93    Mode.
94b : float, :math:`a < b`
95    Upper bound."
96
97