Discrete-continuous random variable

In summary, the question is asking for the variance of a random variable $X$ that takes on two different normal distributions, depending on the outcome of a Bernoulli random variable $B$. The solution involves finding the total variance by considering the individual variances and means of the normal distributions, as well as the probability of the Bernoulli variable. The final result is $p \sigma_1^2 + (1-p) \sigma_2^2 + p(1-p)(\mu_1-\mu_2)^2$, where $\sigma_1$ and $\sigma_2$ are the variances of the normal distributions and $\mu_1$ and $\mu_2$ are the means.
  • #1
OhMyMarkov
83
0
Hello everyone!

I'm looking at the following random variables:

$Z_1$ is normally distributed with zero mean and variance $\sigma _1 ^2$
$Z_2$ is normally distributed with zero mean and variance $\sigma _2 ^2$

$B$ is Bernoulli with probability of success $p$.

$X$ is a random variable that takes $Z_1$ if $B=1$ and $Z_2$ if $B=0$.

What is the variance of $X$?
 
Physics news on Phys.org
  • #2
Re: Dicrete-continuous random variable!

OhMyMarkov said:
Hello everyone!

I'm looking at the following random variables:

$Z_1$ is normally distributed with zero mean and variance $\sigma _1 ^2$
$Z_2$ is normally distributed with zero mean and variance $\sigma _2 ^2$

$B$ is Bernoulli with probability of success $p$.

$X$ is a random variable that takes $Z_1$ if $B=1$ and $Z_2$ if $B=0$.

What is the variance of $X$?

The 'instinctive' answer should be...

$\displaystyle \sigma_{X}^{2}= p\ \sigma_{1}^{2} + (1-p)\ \sigma_{2}^{2}$ (1)

Kind regards

$\chi$ $\sigma$
 
  • #3
Re: Dicrete-continuous random variable!

My statistics are a bit rusty, but we have:

$$P(B = 1) = p$$
$$P(B = 0) = 1 - p$$

And we're given that:

$$VAR(X | B = 1) = \sigma_1^2$$
$$VAR(X | B = 0) = \sigma_2^2$$

And since $Z_1$ and $Z_2$ are independent, you can just add the variances up:

$$VAR(X) = P(B = 1) VAR(X | B = 1) + P(B = 0) VAR(X | B = 0)$$

Which gives:

$$VAR(X) = p \sigma_1^2 + (1 - p) \sigma_2^2 = \sigma_1^2 + (\sigma_2^2 - \sigma_1^2) p$$

I've checked the result empirically.
 
  • #4
Re: Dicrete-continuous random variable!

Bacterius said:
[snip]

And since $Z_1$ and $Z_2$ are independent, you can just add the variances up:

$$VAR(X) = P(B = 1) VAR(X | B = 1) + P(B = 0) VAR(X | B = 0)$$

[snip]
Hi Bacterius,

I don't think that is true, in general. Have you thought about what would change if $Z_1$ and $Z_2$ did not have the same mean?

Suggestion: You might start with
$$var[X] = E[X^2] - E[X]^2$$
 
  • #5
Re: Dicrete-continuous random variable!

awkward said:
Hi Bacterius,

I don't think that is true, in general. Have you thought about what would change if $Z_1$ and $Z_2$ did not have the same mean?

Suggestion: You might start with
$$var[X] = E[X^2] - E[X]^2$$

Yes, it only works in this particular case. I did not consider beyond the problem asked.
 
  • #6
Re: Dicrete-continuous random variable!

Cool problem.

Assign $Z_{i}$ to have mean $\mu_{i}$ and pdf $f_{i}(x)$.

Everything should follow if we find a pdf $f(x)$ for $X$.

$f(x)=P(X=x)=P(X=x|Z_{1})P(Z_{1})+P(X=x|Z_{2})P(Z_{2})$
(Law of Total Probability)
$=pf_{1}(x)+(1-p)f_{2}(x).$

$E(X)=\int_{\mathbb{R}}x*f(x)dx$
$=\int_{\mathbb{R}}{x*[pf_{1}(x)+(1-p)f_{2}(x)]}dx $
$=p\int_{\mathbb{R}}{x*f_{1}(x)dx} + (1-p)\int_{\mathbb{R}}{{x}*f_{2}dx}$
$=pE(Z_{1})+(1-p)E(Z_{2})$
$=p\mu_{1}+(1-p)\mu_{2}$.

$E(X^{2})=\int_{\mathbb{R}}{x^{2}}f(x)dx$
$=\int_{\mathbb{R}}{x^{2}}[pf_{1}(x)+(1-p)f_{2}(x)]dx $
$=p\int_{\mathbb{R}}{x^{2}f_{1}(x)dx}+(1-p)\int_{\mathbb{R}}{x^{2}f_{2}(x)dx}$
$=pE(Z_{1}^{2})+(1-p)E(Z_{2}^{2}) $
$=p(\sigma_{1}^{2}+\mu_{1}^2)+(1-p)(\sigma_{2}^{2}+\mu_{2}^2)$
(Because we know $var(Z)=E(Z^{2})-E(Z)^{2}$)

$var(X)=E(X^{2})-E(X)^2$, for which I am getting
$p\sigma_{1}^{2}+(1-p)\sigma_{2}^{2}+p(1-p)(\mu_{1}-\mu_{2})^{2}$.

This concurs with past answers, but it's strange. The problem is what the variance of X would be if the means are very different like two distributions:

... .. . .. ... ... _________________________ . .. . ... . ... .. ... ..

Calculating the total variance should involve the distance from each point to the total mean where the total mean is pretty far from each distribution's mean. But if the above work is correct, all the information you need about how the total variance is changed when the means are changed is in the difference between the means. (Not the sum- made a mistake typing it up).
 
Last edited:

FAQ: Discrete-continuous random variable

What is a discrete-continuous random variable?

A discrete-continuous random variable is a type of random variable that can take on both discrete and continuous values. This means that it can take on specific, separate values (like rolling a 6 on a die), as well as values within a range (like measuring the height of a person).

What is the difference between a discrete-continuous random variable and a continuous random variable?

The main difference between these two types of random variables is that a continuous random variable can take on any value within a given range, while a discrete-continuous random variable can only take on specific values within that range. In other words, a continuous random variable has an infinite number of possible outcomes, while a discrete-continuous random variable has a finite number of outcomes.

What are some examples of discrete-continuous random variables?

Some common examples of discrete-continuous random variables include the height and weight of a person, the amount of time spent on a task, and the number of items sold in a store. These variables can take on both specific values (like an exact height of 5 feet) and values within a range (like a weight between 120 and 150 pounds).

How are probabilities calculated for a discrete-continuous random variable?

The probabilities for a discrete-continuous random variable can be calculated using a probability density function (PDF). This function assigns probabilities to different intervals within the range of the variable, and the total probability is equal to the area under the curve of the PDF.

What is the importance of understanding discrete-continuous random variables in scientific research?

Discrete-continuous random variables are an important concept in scientific research because many real-world phenomena cannot be easily classified as purely discrete or continuous. By understanding and utilizing these types of variables, researchers can accurately analyze and model complex data sets and make more informed conclusions about their research.

Similar threads

Replies
30
Views
3K
Replies
1
Views
1K
Replies
1
Views
557
Replies
39
Views
1K
Replies
2
Views
1K
Replies
7
Views
1K
Replies
7
Views
2K
Back
Top