cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Define truncated normal distribution in MC15

zroman-2
1-Visitor

Define truncated normal distribution in MC15

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

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:zroman-2)

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

View solution in original post

4 REPLIES 4
StuartBruff
23-Emerald III
(To:zroman-2)

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

LucMeekes
23-Emerald III
(To:zroman-2)

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

lturek
12-Amethyst
(To:zroman-2)

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

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.

Announcements

Top Tags