Law of Large numbers of exponential random variables

The moment generating function of an exponential random variable X is given by mgf(t) = m/(m - t)

That is, mgf(t) = E(exp(t*X)) = m/(m - t)

Let X_1, X_2, .... X_n are iid random variables having exponential distribution with parameter m.

Let m = 2;

and t = 0.5;

n = 10000

I wish to get an estimate of mgf(0.5) using sum_{i = 1 to 10000} exp(0.5 * X_i) as given my code below:

size = 10000;

m = 2;

xVal = exprnd(m,[1,size]);

t = 0.5;

tVal = t * xVal;

eVal = exp(tVal);

avgVal = sum(eVal)/size

actVal = m/(m - t)

the actual value is 4/3 = 1.333 given by actVal

When I run my code the estimate avgVal churns out results such as
9.9936, 12.9107, 10.6934

when it should ideally give values close to 1.333 according to the law of large numbers.

I face similar problems for quite a few values of m and t.

Where am I going wrong??


  • Yes, but the value you must to generate the exponential should be 1/m instead of m. The population mean of an exponential distribution with parameter m is 1/m. In the matlab [b]exprnd(mu,...)[/b] function, mu is supposed to be the mean. When you factor this, you get it right.
    Hope it was clear.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion