Skip to main content
1-Visitor
August 24, 2015
Solved

Define truncated normal distribution in MC15

  • August 24, 2015
  • 4 replies
  • 3981 views

Hi All,

I'd like to define and use a truncated normal distribution with both lower and upper limits.

I use the general Wikipedia discription for reference:

Truncated normal distribution - Wikipedia, the free encyclopedia

My xmcd file is attached.

I managed to define the PDF function with only lower limit, and check returns its ok (its integral on the lower bound - infinite range equals 1).

However, trying with two limits, the check integral has big values, way more than one.

Can anybody help me with this? I don't see where I made something wrong.

Thanks in advance.

Zsolt

Best answer by StuartBruff

Zsolt Roman wrote:

Hi All,

I'd like to define and u,se a truncated normal distribution with both lower and upper limits.

I use the general Wikipedia discription for reference:

Truncated normal distribution - Wikipedia, the free encyclopedia

My xmcd file is attached.

I managed to define the PDF function with only lower limit, and check returns its ok (its integral on the lower bound - infinite range equals 1).

However, trying with two limits, the check integral has big values, way more than one.

Can anybody help me with this? I don't see where I made something wrong.

I think you're double-booking b and a by putting B and A in the pnorm functions.

Stuart

4 replies

23-Emerald V
August 24, 2015

Zsolt Roman wrote:

Hi All,

I'd like to define and u,se a truncated normal distribution with both lower and upper limits.

I use the general Wikipedia discription for reference:

Truncated normal distribution - Wikipedia, the free encyclopedia

My xmcd file is attached.

I managed to define the PDF function with only lower limit, and check returns its ok (its integral on the lower bound - infinite range equals 1).

However, trying with two limits, the check integral has big values, way more than one.

Can anybody help me with this? I don't see where I made something wrong.

I think you're double-booking b and a by putting B and A in the pnorm functions.

Stuart

23-Emerald IV
August 24, 2015

You don't need to define your own phi. You can just use:

1-Visitor
August 24, 2015

Apart from Stuarts and Lucs comments - you missed a sigma when you defined your Phi-function.

And of course you don't need to do so as we have dnorm in Mathcad as you can see:

And as Stuart already remarked, you should not "double normalize" a and b.

LT

zroman-21-VisitorAuthor
1-Visitor
August 25, 2015

Thank you for all your answers, issue got solved very quickly.

As for the missing sigma - it was defined out of the formula, in the trf(x) function, as 1/sigma. But anyways, using dnorm is obviously preferred.