Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Random variables, Risk, and the Poisson distrbution

Introduction

The foundations of probability are built on sets, yet data is more naturally stored and more easily computed on if it is represented numerically.

Random variables match each outcome in our sample space to a value on the number line.

In addition to computational advantages, random variables help us extract from our data the most important characteristics, and they serve as building blocks which we can use to create powerful models. Random variables are also a language we can use to communicate our modeling efforts to other mathematicians, statisticians, and data scientists.

Suppose we hypothesize that the frequency of social media posts on some popular outlet are related to influenza-like illness~(ILI)---a syndromic diagnosis suggesting a patient may have influenza. A patient is diagnosed with ILI if their temperature is measured to be at or above 38C and symptoms resembling the flu. Because influenza is most active in winter and spring, we collect a random sample, each day, of social media posts from September to May and in addition we collect the proportion of patients who are admitted to the hospital and are diagnosed with influenza-like illness at the US national level.

The above hypothesis, data collection, and future inference has numerous details. However, we will see shortly that we can simplify our hypothesis by using random variables.

Maps from the sample space to the number line

Given a sample space G\mathcal{G}, a \textbf{random variable}, (e.g. XX), is a function from each element in G\mathcal{G}---from each outcome---to a value on the real number line. The real number line contains all numbers: integer and decimal, from negative to positive infinity.

\textbf{Example:} Suppose our sample space contains two elements G={a,b}\mathcal{G} = \{ a,b \}. We may decide to define a random variable XX that maps the outcome aa to the value -1 and the outcome bb to the value 1. In otherwords, X(a)=1X(a)=-1 and X(b)=1X(b)=1. We could as well define a random variable YY on the same sample space such that Y(a)=0Y(a)=0 and Y(b)=1Y(b)=1.

\textbf{Example:} Suppose our sample space contains all integers from 0 to 1000 G={0,1,2,3,1000}\mathcal{G} = \{0,1,2,3\cdots,1000 \}. We may be most interested in when an integer is even or odd, and so we can define a random variable Y(y)=0Y(y)=0 when yy, our outcome, is an odd integer and Y(y)=1Y(y)=1 when yy is even. This is an example of how a random variable can distill down a sample space with many outcomes into a random variable with two.

\textbf{Example:} Suppose we decide to study the relationship between the cumulative total number of cigarettes smoked by a person form the date that they started smoking and the presence of lung cancer. We define our sample space to be G={(x,y)xZ,y{0,1}}\mathcal{G} = \{ (x,y) | x \in \mathbb{Z}, y \in \{0,1\} \}. We define two random variables, a random variable XX that maps the outcome (x,y)(x,y) to the value in the first position xx, and a random variable YY that maps the outcome(x,y)outcome (x,y) to the value in the second position yy. Though our outcomes are linked, we can use random variables to think about two separate outcomes---cigarettes smoked and lung cancer---and how they interact.

A new sample space

When we build a random variable (X)(X) that maps outcomes to values on the number line we create a new sample space which we will call the support of XX or supp(X)supp(X). Define a sample space G\mathcal{G} without outcomes oio_{i}. Then the \textbf{support of X} is

supp(X)={xX(o)=x for some outcome o in G}\begin{align} supp(X) = \{x | X(o) = x \text{ for some outcome } o \text{ in } \mathcal{G} \} \end{align}

Our new sample space is the set of all the potential values that our random variable XX can produce. This is a sample space linked to G\mathcal{G}, but in practice after we develop a random variable we often no longer reference G\mathcal{G}.

\ex In our above example where G={a,b}\mathcal{G} = \{a,b\}, the random variable XX has support supp(X)={1,1}supp(X) = \{-1,1\} and supp(Y)={0,1}supp(Y)=\{0,1\}. Lets look at another example, when above G\mathcal{G} is the set of all integers from 0 to 1000. Even though the sample space is quite large, the random variable that maps the integers to 0 when they are odd and 1 when even has a small support (supp(Y)={0,1})(supp(Y) = \{0,1\}).

The probability mass function and the Poisson distribution

Risk, Rates, and Odds