2

A random variable X, representing the time until some event occurs, has the following pdf. $$(14/99)e^{-0.5x}+(85/99)e^{-0.25x}$$. Using integration, I get the expectation as 14.303 via $\int_0^\infty xf(x)dx$, and a variance of 463.453 via $\int_0^\infty (x-\overline{x})^2f(x)dx$.

  1. I don't understand why the variance is so high. I also computed the median, which was much higher than the mean.

When I try and compute the variance using $Var(X)=E(X^2)-(E(X))^2$ I get a negative value. 2) Why is there a mismatch between using these 2 methods?

Stephen
  • 21
  • 2

2 Answers2

1

As noted your density is not exactly a pdf. Anyway it is clearly a mixture of 2 different negative exp pdf

$$f_X(x)=a f_1(x)+(1-a)f_2(x)$$

and obviously

$$f_1(x)=0.5e^{-0.5 x}$$

and

$$f_2(x)=0.25 e^{-0.25x}$$


In this case,

$$\mathbb{V}[X]=\mathbb{E}[X^2]-\mathbb{E}^2[X]$$

$$\mathbb{E}[X^2]=\frac{14}{99}\int_0^{+\infty}\frac{1}{2}x^2e^{-x/2}dx+\frac{85}{99}\int_0^{+\infty}\frac{1}{4}x^2e^{-x/4}dx=$$

$$=\frac{14}{99}\cdot 4\int_0^{+\infty}\Bigg(\frac{x}{2}\Bigg)^2e^{-x/2}d\Bigg(\frac{x}{2}\Bigg)+\frac{85}{99}\cdot 16\int_0^{+\infty}\Bigg(\frac{x}{4}\Bigg)^2e^{-x/4}d\Bigg(\frac{x}{4}\Bigg)=$$

$$=\frac{14}{99}\cdot 4\cdot \Gamma(3)+\frac{85}{99}\cdot 16\cdot \Gamma(3)=\frac{14}{99}\cdot 4\cdot 2+\frac{85}{99}\cdot 16\cdot 2$$

... in the same way you can easy calculate $E(X)$ and finally the variance


Edit

The variance will result:

$$V[X]=\Bigg(\frac{14}{99}\cdot 8+\frac{85}{99}\cdot 32\Bigg)-\Bigg(\frac{14}{99}\cdot 2+\frac{85}{99}\cdot 4\Bigg)^2\approx 14.79$$

tommik
  • 32,733
  • 4
  • 15
  • 34
  • Thanks. Only, I'm not clear on why one wouldn't factor 14/99 into (28/99)(1/2), and similarly, 85/99 into (340/99)(1/4), to create the form af1(x)+(1−a)f2(x), this results in the negative variance that I obtained, therefore it is wrong, but the function provided didn't have the 1/2 and 1/4 lambda terms explicitly stated. – Stephen Feb 05 '21 at 18:45
  • 1
    @Stephen : I edited my answer with the variance calculation. Observe that without any calculation, given that the mixture density is very close to the second density $f_2$ its variance will result just a little bit lower than Variance of $X_2$...16. Actually it results 14.8 – tommik Feb 05 '21 at 18:54
  • 1
    @Stephen : you cannot do the factorization you did because 28/99+340/99 is not 1. There is a clear typo in the text. A mixture of 2 densities is a linear combination of the two densities – tommik Feb 05 '21 at 18:56
0

The problem is that the pdf is not properly normalized, i.e.

\begin{align} \int_0^\infty f(x) dx &= \frac{14}{85}\int_0^\infty e^{-x/2} \ dx + \frac{85}{99}\int_0^\infty e^{-x/4} \ dx \\ &= 2\frac{14}{85} + 4\frac{85}{99} \\ & \neq 1 \end{align}

I would make sure you have the correct pdf. Perhaps there should be a coefficient of 1/2 on the first term, and 1/4 on the second term?

Bean
  • 144