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$
3
  • $\begingroup$ This distribution is almost exactly normally distributed by the central limit theorem. $\endgroup$ Commented May 8, 2019 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
    Commented May 8, 2019 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
    Commented May 9, 2019 at 15:41

1 Answer 1

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$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .