Routines to convert central (co)moments to raw (co)moments. (cmomy.convert)#

Functions:

to_raw_moments(x[, axis, dtype, order, out])

Convert central moments to raw moments.

to_raw_comoments(x[, axis, dtype, order, out])

Convert central moments to raw moments.

to_central_moments(x[, axis, dtype, order, out])

Convert central moments to raw moments.

to_central_comoments(x[, axis, dtype, ...])

Convert raw comoments to central comoments.

cmomy.convert.to_raw_moments(x, axis=-1, dtype=None, order=None, out=None)[source]#

Convert central moments to raw moments.

Parameters:
  • x (ndarray) –

    Central moments array. The expected structure is:

    • x[..., 0] : weight

    • x[..., 1] : mean

    • x[..., k] : kth central moment

  • axis (int, default -1) – Axis location of moments in x.

  • dtype (str, optional) – Optional numpy data type to apply to output.

  • order (str, optional) – Optional ordering (‘c’, ‘f’, etc) to apply to output.

  • out (ndarray, optional) – Optional numpy output array. Should have same shape as x.

Returns:

out (ndarray) – Raw moments array. The expected structure is:

  • out[..., 0] : weight

  • out[..., k] : kth moment \(\langle a^k \rangle\)

cmomy.convert.to_raw_comoments(x, axis=(-2, -1), dtype=None, order=None, out=None)[source]#

Convert central moments to raw moments.

Parameters:
  • x (ndarray) –

    Central comoments array. The expected structure is:

    • x[..., 0, 0] : weight

    • x[..., 1, 0] : mean of a

    • x[....,0, 1] : mean of b

    • x[..., i, j]: \(\langle (\delta a)^i (\delta b)^j \rangle\), where a and b are the variables being considered.

  • axis (tuple of int, default (-2,-1)) – Axis locations of moments in comoments array x

  • dtype (str, optional) – Optional numpy data type to apply to output.

  • order (str, optional) – Optional ordering (‘c’, ‘f’, etc) to apply to output.

  • out (ndarray, optional) – Optional numpy output array. Should have same shape as x.

Returns:

out (ndarray) – Raw comoments array. The expected structure is:

  • out[..., 0, 0] : weight

  • out[..., i, j] : \(\langle a^i b^j \rangle\), where a and b are the variables being considered.

cmomy.convert.to_central_moments(x, axis=-1, dtype=None, order=None, out=None)[source]#

Convert central moments to raw moments.

Parameters:
  • x (ndarray) –

    Raw moments array. The expected structure is:

    • x[..., 0] : weight

    • x[..., k] : kth moment \(\langle a^k \rangle\)

  • axis (int, default -1) – Axis location of moments in x.

  • dtype (str, optional) – Optional numpy data type to apply to output.

  • order (str, optional) – Optional ordering (‘c’, ‘f’, etc) to apply to output.

  • out (ndarray, optional) – Optional numpy output array. Should have same shape as x.

Returns:

out (ndarray) – Central moments array. The expected structure is:

  • out[..., 0] : weight

  • out[..., 1] : mean

  • out[..., k] : kth central moment

cmomy.convert.to_central_comoments(x, axis=(-2, -1), dtype=None, order=None, out=None)[source]#

Convert raw comoments to central comoments.

Parameters:
  • x (ndarray) –

    Raw comoments array. The expected structure is:

    • x[..., 0, 0]: weight

    • x[..., i, j] : \(\langle a^i b^j \rangle\), where a and b are the variables being considered.

  • axis (tuple of int, default (-2,-1)) – Axis locations of moments in comoments array x

  • dtype (str, optional) – Optional numpy data type to apply to output.

  • order (str, optional) – Optional ordering (‘c’, ‘f’, etc) to apply to output.

  • out (ndarray, optional) – Optional numpy output array. Should have same shape as x.

Returns:

out (ndarray) – Central comoments array. The expected structure is:

  • out[..., 0, 0] : weight

  • out[..., 1, 0] : mean of a

  • out[....,0, 1] : mean of b

  • out[..., i, j] : \(\langle (\delta a)^i (\delta b)^j \rangle\), where a and b are the variables being considered.