Continuous Distribution Measures (Moments & Cumulants)

This module provides functions to compute moments and cumulants from continuous probability distribution functions.

moment_generating_function(generating_function, symbols, symbols_in_result, velocity=None)

Computes the moment generating function of a probability distribution. It is defined as:

\[F[f(\mathbf{x})](t) = \int e^{<\mathbf{x}, t>} f(\mathbf{x})\; dx\]
Parameters:
  • generating_function – sympy expression

  • symbols – a sequence of symbols forming the vector \(\mathbf{x}\)

  • symbols_in_result – a sequence forming the vector t

  • velocity – if the generating function generates central moments, the velocity needs to be substracted. Thus the velocity symbols need to be passed. All generating functions need to have the same parameters.

Returns:

an expression that depends now on symbols_in_result (symbols have been integrated out)

Return type:

transformation result F

Note

This function uses sympys symbolic integration mechanism, which may not work or take a large amount of time for some functions. Therefore this routine does some transformations/simplifications on the function first, which are taylored to expressions of the form exp(polynomial) i.e. Maxwellian distributions, so that these kinds of functions can be integrated quickly.

central_moment_generating_function(func, symbols, symbols_in_result, velocity=(u_0, u_1, u_2))

Computes central moment generating func, which is defined as:

\[K( \mathbf{\Xi} ) = \exp ( - \mathbf{\Xi} \cdot \mathbf{u} ) M( \mathbf{\Xi} ).\]

For parameter description see moment_generating_function().

cumulant_generating_function(func, symbols, symbols_in_result, velocity=None)

Computes cumulant generating func, which is the logarithm of the moment generating func:

\[C(\mathbf{\Xi}) = \log M(\mathbf{\Xi})\]

For parameter description see moment_generating_function().

continuous_moment(func, moment, symbols=None)

Computes moment of given function.

Parameters:
  • func – function to compute moments of

  • moment – tuple or polynomial describing the moment

  • symbols – if moment is given as polynomial, pass the moment symbols, i.e. the dof of the polynomial

continuous_central_moment(func, moment, symbols=None, velocity=(u_0, u_1, u_2))

Computes central moment of given function.

Parameters:
  • func – function to compute moments of

  • moment – tuple or polynomial describing the moment

  • symbols – if moment is given as polynomial, pass the moment symbols, i.e. the dof of the polynomial

continuous_cumulant(func, moment, symbols=None)

Computes cumulant of continuous function.

for parameter description see continuous_moment()