Moments and moment-generating function #
Main definitions #
ProbabilityTheory.moment X p μ
:p
th moment of a real random variableX
with respect to measureμ
,μ[X^p]
ProbabilityTheory.centralMoment X p μ
:p
th central moment ofX
with respect to measureμ
,μ[(X - μ[X])^p]
ProbabilityTheory.mgf X μ t
: moment-generating function ofX
with respect to measureμ
,μ[exp(t*X)]
ProbabilityTheory.cgf X μ t
: cumulant-generating function, logarithm of the moment-generating function
Main results #
ProbabilityTheory.IndepFun.mgf_add
: if two real random variablesX
andY
are independent and their moment-generating functions are defined att
, thenmgf (X + Y) μ t = mgf X μ t * mgf Y μ t
ProbabilityTheory.IndepFun.cgf_add
: if two real random variablesX
andY
are independent and their cumulant-generating functions are defined att
, thencgf (X + Y) μ t = cgf X μ t + cgf Y μ t
ProbabilityTheory.measure_ge_le_exp_cgf
andProbabilityTheory.measure_le_le_exp_cgf
: Chernoff bound on the upper (resp. lower) tail of a random variable. Fort
nonnegative such that the cumulant-generating function exists,ℙ(ε ≤ X) ≤ exp(- t*ε + cgf X ℙ t)
. See alsoProbabilityTheory.measure_ge_le_exp_mul_mgf
andProbabilityTheory.measure_le_le_exp_mul_mgf
for versions of these results usingmgf
instead ofcgf
.
Moment of a real random variable, μ[X ^ p]
.
Instances For
Central moment of a real random variable, μ[(X - μ[X]) ^ p]
.
Equations
Instances For
Moment-generating function of a real random variable X
: fun t => μ[exp(t*X)]
.
Instances For
Cumulant-generating function of a real random variable X
: fun t => log μ[exp(t*X)]
.
Equations
- ProbabilityTheory.cgf X μ t = Real.log (ProbabilityTheory.mgf X μ t)
Instances For
Alias of ProbabilityTheory.exp_cgf
.
The moment-generating function is monotone in the random variable for t ≥ 0
.
The moment-generating function is antitone in the random variable for t ≤ 0
.
This is a trivial application of IndepFun.comp
but it will come up frequently.
Chernoff bound on the upper tail of a real random variable.
Chernoff bound on the lower tail of a real random variable.
Chernoff bound on the upper tail of a real random variable.
Chernoff bound on the lower tail of a real random variable.