61 points · by reqo · 2y ago · 61 comments
Hmm, that sentence at the beginning is already wrong. Random variables can measure anything, not just numbers. Heads or Tails of a coin, or colours of cars etc.
It's fine to restrict yourself to numeric random variables only. But if you are writing a rant telling other people to be more careful in their analysis, you better dot your i's and cross your t's yourself.
When you're asking P(Heads) of a coin, its short hand for "P(event=heads) for all possible events that can happen when flipping a coin". You notice that in this idealized world the event is always two things (heads or tails), and never null, side, cow because we have defined that the P(event=cow) = 0.
Probability functions are at the end of the day models that we can use to analyze real world non-deterministic phenomena with the rigor of mathematics.
[0] - with credit to Prof Gubner https://directory.engr.wisc.edu/ece/Faculty/Gubner_John/
They are functions that map from the space of random events to whatever other space you want. Why restrict yourself to the real number line?
Eg the 'moral character of the next stranger I encounter' is a random variable that maps from some abstract space of random events (we often used the Greek letter Omega for that) onto some space of moral characters.
And if you want to restrict yourself to numbers, why restrict yourself to reals? Why not complex numbers or p-adic numbers or numbers in F_5 or numbers in [0, 1] or 'natural numbers expect 17'?
EDIT: looks like you are right in English! See https://news.ycombinator.com/item?id=40796146 and my reply there.
Edit: I misread. I agree with you. Sorry!
That said, while I appreciate and admire free textbooks published online, I think the exposition would be much improved if the author had a better sense of who he was writing for (the most common writing advice...).
And I take issue with the view that the sample space is where the random phenomenon lives, as it were. In my experience, it's more common to use the random variable itself to model the (observable aspect of) the random phenomenon, and for the sample space to be either a hidden (i.e., more abstract) aspect of the phenomenon or else a purely abstract formalism introduced only for ease of mathematical computation.
It would be helpful also to see some more context, especially historical (who introduced the concept of a sample space, and for what purpose?).
If it maps elsewhere, mathematicians like to call it a random element instead.
I can understand why some might make a cut between pure numbers and other objects, but it's not something that troubles many.
For a random variable we can calculate something called the expected value. We can't do that if the value of the variable is in the domain { red, green, blue }.
Not all probability distributions over real numbers have expected values. See https://en.wikipedia.org/wiki/Cauchy_distribution
Many probability distributions over something other than the real numbers have expected values.
https://en.wikipedia.org/wiki/Girsanov_theorem https://en.wikipedia.org/wiki/Risk-neutral_measure
The fun part comes when you can ask this computation graph: "what parameters for a random variable early on in the chain would be the ones that optimize some function of variables later in the chain?" And, handwaving a ton of nuance here, when those parameters are weights in a neural network, the function is a loss function on the training data, and the optimization is done by automatic differentiation (e.g. https://pytorch.org/tutorials/beginner/introyt/autogradyt_tu...), you have modern AI.
If you're interested in the theoretical underpinnings here, Bishop's PRML is perhaps the classic starting point: https://www.microsoft.com/en-us/research/uploads/prod/2006/0...
In that article, squaring a number in interval arithmetic is different from multiplying two independent numbers with the same interval. Here, squaring a random variable is different from multiplying two independent random variables with the same distribution.
To clarify what I do understand: so you have the variable, like height, and all its possible values along with their probabilities (that's the distribution, if I understand things right). The distribution represents a big part of what the variable is, although I realise the variable maybe has other attributes too (none comes to mind right now though).
X = 1 with probability 0.5, 0 with probability 0.5 Y = 0 when X = 1, 1 when X = 0 (for the \omega for which X(\omega) = 1, Y(\omega) = 0).
They're both bernoulli distributions with p=0.5 (i.e. they follow the same distribution) and P(X=Y) = 0
- You literally identify sets with their indicators: they are the same.
- You identify the “P” operator as expectation (integration) with respect to the underlying measure, and next…
- You note that integration is linear, so you use linear operator notation everywhere you’d use P.
So if “A” is a set, you just write
P A = 0.5
This is equivalent to:
P A = P 1[ω ∈ A] = ∫ 1[ω ∈ A] dP(ω)
in Lebesgue notation.
There’s an example on page 2 of http://www.stat.yale.edu/~pollard/Courses/241.fall2014/notes... although he’s not using measure theory there.
It can be really clean and terse especially when doing bounds for random variables.
It's just like if X~N(0,1), Y~N(0,1) and you want to know the distribution of X-Y. You need to know what the PDF of (X,Y) looks like. Well, you don't know. X and Y could be correlated or they might not be. e.g. if could be that (X,Y)~N( (0,0), [(1,0),(0,1)] ) or maybe (X,Y)~N( (0,0), [(1,1/2),(1/2,1)] ). The distribution of X-Y cares how correlated X and Y are.
A better convention would make clear the distinction between the set of possible outcomes, the act of obtaining a (range of) samples from that set, and the probability that those events match a value range of interest. p(x=X) is not enough to capture all that information. let alone p(x) vs p(X).
I’m so glad I have ChatGPT now, I always ask for applied examples and ask it to explain things intuitively. I would’ve been a 4.0 student if I would’ve had ChatGPT as my personal tutor when I was in school.
This is simply wrong. Random variables are not defined this way.