# forum.hugin.com

## User Forums => HUGIN GUI Discussion => Topic started by: lauchlin on July 16, 2012, 04:03:06

Title: Bounded interval nodes with Normal distribution
Post by: lauchlin on July 16, 2012, 04:03:06
I'm in the process of converting a Netica model in to a OOBN and have been re-writing the Netica formulas to Hugin expressions. The problem I am running in to is that Netica and Hugin handle Normal distributions differently.  With Netica if you have a continuous nature node that has been discretized in to two intervals (e.g. 0-2 and 2-15) you can use Netica's NormalDist function to define a distribution across the bounded range.  Hugin on the other hand expects interval nodes to have a range of +/- infinity. To get around this I have created two extra ranges -inf-0 and 15-+inf and then created a child node that squashes the distribution using Distribution(0,1) and Distribution(1,0) back in to the two ranges effectively dumping everything less than 0 in to the 0-2 range and everything more than 15 in to the 2-15 range.  This ends up with the correct mean but the variance is out which is no good.  In the end it is a hack that only partially works and what I would really like to know is, what is the best way to use Normal distributions with interval nodes in the case that you have a node that represents a real world system that is bounded?
Title: Re: Bounded interval nodes with Normal distribution
Post by: Frank Jensen on July 16, 2012, 14:25:04
You can use the "truncate" operator to handle this case.  See Example 5.1 in the Hugin API Reference Manual.
Title: Re: Bounded interval nodes with Normal distribution
Post by: lauchlin on July 17, 2012, 02:45:52
Thanks.  That is exactly the function I should have been looking for.