0
$\begingroup$

By applying the R-function replicate() generate $10$ samples from an exponential distribution with a rate parameter $0.2$ and sum them together. Do this sum 10000 times and make a histogram of the simulation. Can you say something about the distribution?

So I did this task and observed that the median is $\approx 50=10/0.2$ but I don't know what I could say about the distribution. I know that the sum of independent exponentially distributed random variables with same rate is gamma distributed. Is this the answer to the question?

$\endgroup$
  • $\begingroup$ This distribution is almost exactly normally distributed by the central limit theorem. $\endgroup$ – Peter Foreman May 8 at 20:13
  • 1
    $\begingroup$ The sum of a fixed number $n$ of exponential RVs with the same parameter $a$ follows a classical distribution : gamma distribution $\gamma(n,a)$ known to have the mean you have given. $\endgroup$ – Jean Marie May 8 at 20:28
  • $\begingroup$ The exponential dist'n is right skewed with a heavy right tail so $n = 10$ is not large enough for the CLT to give useful approximations. By contrast, $m = 10^6$ gives a large enough sample if $S$'s for sample mean $\bar S$ by LLN to approx $\mu_S =E(S)$ and by CLT fot 1.96*sd(s)/dqrt(m) to provide an accurate 95% margin of simulation error for $\mu_S.$ $\endgroup$ – BruceET May 9 at 15:41
0
$\begingroup$

Yes, the sum is $S = \mathsf{Gamma}(10, \lambda = 0.2).$ The R code below simulates this distribution with a million iterations, makes a histogram and plots the gamma density for comparison.

set.seed(2019)   # for reproducibility
n = 10; m = 10^6; lam = .2
s = replicate(m, sum(rexp(n, lam)))
mean(s)
[1] 50.00628    # by LLN aprx E(S) = 10/.2 = 50   
2*sd(s)/sqrt(m)
[1] 0.03165734  # by CLT aprx 95% margin of sim error

hist(s, prob=T, br=40, col="skyblue2")
curve(dgamma(x, n, lam), 0, max(s), add=T, col="brown", lwd=2)

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.