Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mef/schema/random_deviate.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ beta-deviate = element beta-deviate { expression, expression }
histogram = element histogram { expression, bin+ }

bin = element bin { expression, expression }

triangle = element triangle { expression, expression, expression }
1 change: 1 addition & 0 deletions mef/schema/stochastic_layer.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ random-deviate =
| gamma-deviate
| beta-deviate
| histogram
| triangle

test-event = test-initiating-event | test-functional-event
15 changes: 15 additions & 0 deletions mef/stochastic_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ As for arithmetic operators and built-ins, this list can be extended on demand.
+-----------------------+------------+-------------------------------------------------------------------------------------------------------------+
| **histograms** | any | discrete distributions defined by means of a list of pairs |
+-----------------------+------------+-------------------------------------------------------------------------------------------------------------+
| **triangle** | 3 | triangle (or triangular) distribution defined by its two limits and mode |
+-----------------------+------------+-------------------------------------------------------------------------------------------------------------+

Uniform Deviates
These primitives describe uniform distributions in a given range
Expand Down Expand Up @@ -713,6 +715,19 @@ Histograms
with the initial value
:math:`x_0 = 0, x_1 = 2m_1, \text{ and } x_i = x_{i-1} + 2(m_i - x_{i-1})`.

Triangle Distributions
A triangle (or triangular) distribution is a special case of a piecewise-linear distribution
defined only by three bounds :math:`(a, b, c)`,
a lower limit, mode, and upper limit respectively.
The lower and upper limit weights are 0,
and the most probable value :math:`b` has :math:`\frac{2}{c - a}` weight.

The expected value of a triangle distribution is the arithmetic mean of its bounds.

.. math::

E(x) = \frac{a + b + c}{3}


XML Representation
------------------
Expand Down