Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to sample from left-truncated exponential?

Subject: How to sample from left-truncated exponential?

From: Ka Lee

Date: 24 Jan, 2009 19:38:01

Message: 1 of 4

Hi,

Does anyone know how to sample from a left-truncated exponential distribution? That is, an exponential distribution defines on the range between [tao, infinity].

Can I use the inverse CDF method?

Thanks.

Subject: How to sample from left-truncated exponential?

From: Roger Stafford

Date: 24 Jan, 2009 20:00:05

Message: 2 of 4

"Ka Lee" <kaloklee@gmail.com> wrote in message <glfqmp$26a$1@fred.mathworks.com>...
> Hi,
>
> Does anyone know how to sample from a left-truncated exponential distribution? That is, an exponential distribution defines on the range between [tao, infinity].
>
> Can I use the inverse CDF method?
>
> Thanks.

  The exponential distribution is already left-truncated at zero. All you need to do is do a shift from zero to tao on the ordinary exponential distribution. I don't see what the difficulty is.

Roger Stafford

Subject: How to sample from left-truncated exponential?

From: Ka Lee

Date: 25 Jan, 2009 00:24:01

Message: 3 of 4

> The exponential distribution is already left-truncated at zero. All you need to do is do a shift from zero to tao on the ordinary exponential distribution. I don't see what the difficulty is.
>
> Roger Stafford

Hi, do you mean this is all I need to do?

x = exprnd(lambda);
y = x+tao;

Is y the desired left-truncated exponential distribution? Thanks!

Subject: How to sample from left-truncated exponential?

From: Roger Stafford

Date: 25 Jan, 2009 02:04:02

Message: 4 of 4

"Ka Lee" <kaloklee@gmail.com> wrote in message <glgbf1$lim$1@fred.mathworks.com>...
> Hi, do you mean this is all I need to do?
>
> x = exprnd(lambda);
> y = x+tao;
>
> Is y the desired left-truncated exponential distribution? Thanks!

  Yes. If you have doubts on that score, Ka Lee, consider this. An exponential distribution that stops on the left at x = tao must have conditional density of the form

 f(x) = exp(-lambda*x)/K

with K the probability that x >= tao:

 K = int(exp(-lambda*x),tao,inf) = 1/lambda*exp(-lambda*tao).

Hence

 f(x) = exp(-lambda*x)*lambda/exp(-lambda*tao)
      = lambda*exp(-lambda*(x-tao))

This means that your distribution has the same density as the usual one for an x which is less by tao - that is, adding tao to the x of the usual distribution will give you the density of your distribution. Therefore

 tao+exprnd(lambda)

should give you the distribution you want.

  By the way, when you write 'tao' do you mean the Greek letter 'tau'?

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us