Homework 05

Homework 05#

  1. Suppose \(X\) is a random variable with support \(supp(X) = \{-2,-1,0,1,2,3\}\) and \(Y = |X|\). Further assume the c.m.f of \(X\) is

    (307)#\[\begin{align} F_{X}(x) \begin{cases} 0.05 & \text{ if } x=-2\\ 0.15 & \text{ if } x=-1\\ 0.35 & \text{ if } x=0\\ 0.65 & \text{ if } x=1\\ 0.95 & \text{ if } x=2\\ 1.00 & \text{ if } x=3 \end{cases} \end{align}\]
    1. Define the support of \(Y\)

    2. Build the p.m.f of \(Y\)

    3. Build the c.m.f of \(Y\)

  2. Suppose the random variable \(X\) describes the number of patients who arrive at a clinic infected with respiratory syncytial virus (RSV). We will assume that \(X \sim \text{Poisson}(\lambda)\). To prepare, the hospital buts antiviral kits however kits come in packs of two. Lets use \(Y\) to describe the random variable

(308)#\[\begin{align} Y = \lceil X/2 \rceil \end{align}\]

where \(\lceil x \rceil\) rounds up \(x\) to the nearest integer. For example \(\lceil 0.5\rceil = 1;\lceil 2.3\rceil = 3\) and etc. Please derive the support for \(Y\) and also the pmf for this random variable.

  1. Please write a python script that:

    1. Simulates 500 draws from a Poisson random variable with \(\lambda=5\) (ie X)

    2. Computes the transformation \(Y = \lceil X/2 \rceil\) for each of the simulated X values above.

    3. Describes the pmf in (2) as a function that takes arguments y and lambda and ouputs the probability for y given lambda. Hint: This function will likely have an if/else.

    4. Plots a figure with two panels. In the first panel is a histrogram of X (density = True). In the second panel is a histogram of Y (density = True) as well as a line that shows the theoretical pmf.

  2. Let \(X\) be the time, in days, until an infected person seeks treatment after symptom onset. We will assume that \(X \sim \text{Exponential}(\lambda)\). Further suppose that we use a random variable \(Y = \frac{1}{1+X}\) to describe the probability that an individual is not yet recovered by the time they seek treatment. Please compute the support, cdf, and pdf for \(Y\).

  3. Please write a python script that:

    1. Simulates 500 draws from an Exponential random variable with \(\lambda=2\) (ie X)

    2. Computes the transformation \(Y = \frac{1}{1+X}\) for each of the simulated X values above.

    3. Describes the pmf in (2) as a function that takes arguments y and lambda and ouputs the probability for y given lambda. Hint: This function will likely have an if/else.

    4. Plots a figure with two panels. In the first panel is a histrogram of X (density = True). In the second panel is a histogram of Y (density = True) as well as a line that shows the theoretical pmf.

  4. The oxygen saturation level (\(S\))of a patient’s blood is used to assess respiratory health. Suppose that due to natural variations and measurement errors, the recorded oxygen saturation (as a proportion between 0 and 1) follows a Beta distribution:

(309)#\[\begin{align} S &\sim Beta(\alpha,\beta) \\ f_{S}(s) &= \frac{1}{B(\alpha,\beta)} s^{\alpha-1} (1-s)^{\beta-1}\\ supp(S) &= [0,1] \end{align} \]

Instead of reporting the proportion of Oxygen saturation level, we wish to report the odds. The odds is defined as

(310)#\[\begin{align} Y = \frac{S}{1-S} \end{align} \]

Please compute the support and probability density function for \(Y\).

  1. In a clinical study, blood pressure deviations from a baseline measurement, \(X\), are assumed to follow a normal distribution due to physiological variations. In some medical analyses, doctors are more interested in the absolute deviation from the baseline

(311)#\[\begin{align} Y = |X| \end{align} \]

Please compute the support and probability density function for \(Y\).