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 : Ω → E
is said toHasPDF
with respect to the measureℙ
onΩ
andμ
onE
if the push-forward measure ofℙ
alongX
is absolutely continuous with respect toμ
and theyHaveLebesgueDecomposition
.MeasureTheory.pdf
: IfX
is a random variable thatHasPDF X ℙ μ
, thenpdf X
is the Radon–Nikodym derivative of the push-forward measure ofℙ
alongX
with respect toμ
.MeasureTheory.pdf.IsUniform
: A random variableX
is 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 : Ω → E
has pdff
, then𝔼(g(X)) = ∫ x, f x • g x dx
for all measurableg : E → F
.MeasureTheory.pdf.integral_mul_eq_integral
: A real-valued random variableX
with pdff
has expectation∫ x, x * f x dx
.MeasureTheory.pdf.IsUniform.integral_eq
: IfX
follows the uniform distribution with its pdf having supports
, thenX
has expectation(λ s)⁻¹ * ∫ x in s, x dx
whereλ
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' : (MeasureTheory.Measure.map X ℙ).HaveLebesgueDecomposition μ
- absolutelyContinuous' : (MeasureTheory.Measure.map X ℙ).AbsolutelyContinuous μ
Instances
Equations
- ⋯ = ⋯
A random variable that HasPDF
is quasi-measure preserving.
Alias of MeasureTheory.HasPDF.congr_iff
.
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
Alias of MeasureTheory.setLIntegral_pdf_le_map
.
Alias of MeasureTheory.map_eq_setLIntegral_pdf
.
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.