%feature("docstring") OT::Event
"Event.

Available constructor:
    Event()

    Event(*antecedent, comparisonOperator, threshold*)

    Event(*antecedent, domain*)

    Event(*process, domain*)

Parameters
----------
antecedent : :class:`~openturns.RandomVector` of dimension 1
    Output variable of interest.
comparisonOperator : :class:`~openturns.ComparisonOperator`
    Comparison operator used to compare *antecedent* with *threshold*.
threshold : float
    *threshold* we want to compare to *antecedent*.
domain : :class:`~openturns.Domain`
    Domain failure.
process : :class:`~openturns.Process`
    Stochastic process.

Notes
-----
An event is defined as follows:

.. math::

    \cD_f = \{\vect{X} \in \Rset^n \, / \, g(\vect{X},\vect{d}) \le 0\}

where :math:`\vect{X}` denotes a random input vector, representing the sources
of uncertainties, :math:`\vect{d}` is a determinist vector, representing the
fixed variables and :math:`g(\vect{X},\vect{d})` is the limit state function of
the model.
The probability content of the event :math:`\cD_f` is :math:`P_f`:

.. math::

    P_f = \int_{g(\vect{X},\vect{d})\le 0}f_\vect{X}(\vect{x})\di{\vect{x}}

Here, the event considered is explicited directly from the limit state function
:math:`g(\vect{X}\,,\,\vect{d})` : this is the classical structural reliability
formulation. However, if the event is a threshold exceedance, it is useful to
explicite the variable of interest :math:`Z=\tilde{g}(\vect{X}\,,\,\vect{d})`,
evaluated from the model :math:`\tilde{g}(.)`. In that case, the event
considered, associated to the threshold :math:`z_s` has the formulation:

.. math::

    \cD_f = \{ \vect{X} \in \Rset^n \, / \, Z=\tilde{g}(\vect{X}\,,\,\vect{d}) > z_s \}

and the limit state function is:

.. math::

    g(\vect{X}\,,\,\vect{d}) &= z_s - Z \\
                             &= z_s - \tilde{g}(\vect{X}\,,\,\vect{d})

:math:`P_f` is the threshold exceedance probability, defined as:

.. math::

    P_f &= P(Z \geq z_s) \\
        &= \int_{g(\vect{X}, \vect{d}) \le 0} \pdf\di{\vect{x}}

Examples
--------
An event created from a limit state function:

>>> import openturns as ot
>>> myFunction = ot.SymbolicFunction(['E', 'F', 'L', 'I'], ['-F*L^3/(3*E*I)'])
>>> myDistribution = ot.Normal([50.0, 1.0, 10.0, 5.0], [1.0]*4, ot.IdentityMatrix(4))
>>> vect = ot.RandomVector(myDistribution)
>>> output = ot.RandomVector(myFunction, vect)
>>> myEvent = ot.Event(output, ot.Less(), -3.0)

A composite random vector based event:

>>> X = ot.RandomVector(ot.Normal(2))
>>> model = ot.SymbolicFunction(['x0', 'x1'], ['x0', 'x1'])
>>> Y = ot.RandomVector(model, X)
>>> # The domain: [0, 1]^2
>>> domain = ot.Interval(2)
>>> # The event
>>> event = ot.Event(Y, domain)

A process based event:

>>> # The input process
>>> X = ot.WhiteNoise(ot.Normal(2))
>>> # The domain: [0, 1]^2
>>> domain = ot.Interval(2)
>>> # The event
>>> event = ot.Event(X, domain)
"
