Distributions (polykin.distributions)¤
convolve_moments_self ¤
convolve_moments_self(
q0: float, q1: float, q2: float, order: int = 1
) -> tuple[float, float, float]
Compute the first three moments of the k-th order convolution of a distribution with itself.
If \(P^k\) is the \(k\)-th order convolution of \(Q\) with itself, defined as:
then the first three moments of \(P^k\) are related to the moments of \(Q\) by:
where \(p_i\) and \(q_i\) denote the \(i\)-th moments of \(P^k\) and \(Q\), respectively.
PARAMETER | DESCRIPTION |
---|---|
q0
|
0-th moment of \(Q\).
TYPE:
|
q1
|
1-st moment of \(Q\).
TYPE:
|
q2
|
2-nd moment of \(Q\).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[float, float, float]
|
0-th, 1-st and 2-nd moments of \(P^k=(Q*Q)*...\). |
Examples:
>>> from polykin.distributions import convolve_moments_self
>>> convolve_moments_self(1., 1e2, 2e4, 2)
(1.0, 300.0, 120000.0)
Source code in src/polykin/distributions/base.py
957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 |
|