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 variable- X : Ω → Eis said to- HasPDFwith respect to the measure- ℙon- Ωand- μon- Eif the push-forward measure of- ℙalong- Xis absolutely continuous with respect to- μand they- HaveLebesgueDecomposition.
- MeasureTheory.pdf: If- Xis a random variable that- HasPDF X ℙ μ, then- pdf Xis the Radon–Nikodym derivative of the push-forward measure of- ℙalong- Xwith respect to- μ.
- MeasureTheory.pdf.IsUniform: A random variable- Xis 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 variable- X : Ω → Ehas pdf- f, then- 𝔼(g(X)) = ∫ x, f x • g x dxfor all measurable- g : E → F.
- MeasureTheory.pdf.integral_mul_eq_integral: A real-valued random variable- Xwith pdf- fhas expectation- ∫ x, x * f x dx.
- MeasureTheory.pdf.IsUniform.integral_eq: If- Xfollows the uniform distribution with its pdf having support- s, then- Xhas expectation- (λ s)⁻¹ * ∫ x in s, x dxwhere- λis the Lebesgue measure.
TODO #
Ultimately, we would also like to define characteristic functions to describe distributions as it exists for all random variables. However, to define this, we will need Fourier transforms which we currently do not have.
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.