Probability density function #
This file defines the probability density function of random variables, by which we mean
measurable functions taking values in a Borel space. The probability density function is defined
as the Radon–Nikodym derivative of the law of X. In particular, a measurable function f
is said to the probability density function of a random variable X if for all measurable
sets S, ℙ(X ∈ S) = ∫ x in S, f x dx. Probability density functions are one way of describing
the distribution of a random variable, and are useful for calculating probabilities and
finding moments (although the latter is better achieved with moment-generating functions).
This file also defines the continuous uniform distribution and proves some properties about random variables with this distribution.
Main definitions #
MeasureTheory.HasPDF: A random variableX : Ω → Eis said toHasPDFwith respect to the measureℙonΩandμonEif the push-forward measure ofℙalongXis absolutely continuous with respect toμand theyHaveLebesgueDecomposition.MeasureTheory.pdf: IfXis a random variable thatHasPDF X ℙ μ, thenpdf Xis the Radon–Nikodym derivative of the push-forward measure ofℙalongXwith respect toμ.MeasureTheory.pdf.IsUniform: A random variableXis said to follow the uniform distribution if it has a constant probability density function with a compact, non-null support.
Main results #
MeasureTheory.pdf.integral_pdf_smul: Law of the unconscious statistician, i.e. if a random variableX : Ω → Ehas pdff, then𝔼(g(X)) = ∫ x, f x • g x dxfor all measurableg : E → F.MeasureTheory.pdf.integral_mul_eq_integral: A real-valued random variableXwith pdffhas expectation∫ x, x * f x dx.MeasureTheory.pdf.IsUniform.integral_eq: IfXfollows the uniform distribution with its pdf having supports, thenXhas expectation(λ s)⁻¹ * ∫ x in s, x dxwhereλis the Lebesgue measure.
A random variable X : Ω → E is said to have a probability density function (HasPDF)
with respect to the measure ℙ on Ω and μ on E
if the push-forward measure of ℙ along X is absolutely continuous with respect to μ
and they have a Lebesgue decomposition (HaveLebesgueDecomposition).
- aemeasurable' : AEMeasurable X ℙ
- haveLebesgueDecomposition' : (Measure.map X ℙ).HaveLebesgueDecomposition μ
- absolutelyContinuous' : (Measure.map X ℙ).AbsolutelyContinuous μ
Instances
A random variable that HasPDF is quasi-measure-preserving.
X HasPDF if there is a pdf f such that map X ℙ = μ.withDensity f.
If X is a random variable, then pdf X ℙ μ
is the Radon–Nikodym derivative of the push-forward measure of ℙ along X with respect to μ.
Equations
- MeasureTheory.pdf X ℙ μ = (MeasureTheory.Measure.map X ℙ).rnDeriv μ
Instances For
The Law of the Unconscious Statistician for nonnegative random variables.
The Law of the Unconscious Statistician: Given a random variable X and a measurable
function f, f ∘ X is a random variable with expectation ∫ x, pdf X x • f x ∂μ
where μ is a measure on the codomain of X.
A random variable that HasPDF transformed under a QuasiMeasurePreserving
map also HasPDF if (map g (map X ℙ)).HaveLebesgueDecomposition μ.
quasiMeasurePreserving_hasPDF is more useful in the case we are working with a
probability measure and a real-valued random variable.
A real-valued random variable X HasPDF X ℙ λ (where λ is the Lebesgue measure) if and
only if the push-forward measure of ℙ along X is absolutely continuous with respect to λ.
If X is a real-valued random variable that has pdf f, then the expectation of X equals
∫ x, x * f x ∂λ where λ is the Lebesgue measure.
Random variables are independent iff their joint density is a product of marginal densities.