Zulip Chat Archive

Stream: Is there code for X?

Topic: Conditional variance


Yaël Dillies (Jan 17 2025 at 07:44):

I'm looking for the conditional variance of a random variable according to a sigma-subalgebra. Searching through mathlib, I notice that in fact we don't have the usual variance of a non-real-valued random variable. Indeed, docs#ProbabilityTheory.variance only works for X : Ω → ℝ.

Rémy Degenne (Jan 17 2025 at 08:04):

That's correct: we don't have a specific definition for the conditional variance (but it's not hard to define with existing tools), and we have only variance of real random variables.

Yaël Dillies (Jan 17 2025 at 08:06):

I'm somewhat confused as to why we only have variance of real-valued random variables. The definition straightforwardly generalises to a normed space-valued random variable. Am I missing something? Was this simplification done for usability? (eg to use X ^ 2 instead of fun ω ↦ ‖X ω‖ ^ 2). Was this an oversight?

Rémy Degenne (Jan 17 2025 at 08:16):

In R^n the useful object is the covariance matrix and the matrix you get for cov(X,X) is sometimes called variance, and then there are several notions of real valued variance used in different places: trace of the covariance matrix (what you get with your def) or determinant of that matrix.

Rémy Degenne (Jan 17 2025 at 08:17):

It's not absolutely clear that your generalization should be the one with name variance.

Yaël Dillies (Jan 17 2025 at 08:41):

Okay I see. Wouldn't it be fine to do this generalisation anyway, since it has the same type as the variance of a real-valued random variable, and add a disclaimer that there are other kinds of variances?

Kexing Ying (Jan 17 2025 at 08:48):

I think it would be better just to define covariance directly instead of generalizing variance to non-real valued RVs.

Kexing Ying (Jan 17 2025 at 08:49):

There was a small discussion about this here


Last updated: May 02 2025 at 03:31 UTC