Author Topic: GMM / Interval nodes  (Read 21314 times)

Offline eb20

  • Newbie
  • *
  • Posts: 9
    • View Profile
GMM / Interval nodes
« on: April 25, 2011, 20:23:04 »
Hi,

I have a very simple net with 2 nodes, the parent, H, is discrete (2 values) and the child, E, is continuous with a continuous random distribution. I want to use two metods, Gaussian Mixtures and discretization.

1. How can I set the different values of weigths, mean and variance (GMM calculated in matlab) that represent P(E|H1) and P(E|H2)?

2. How can I discretize the continuous distribution using interval nodes?? it is possible the intervals have different sizes?

I would appreciate any help.

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2295
    • View Profile
Re: GMM / Interval nodes
« Reply #1 on: April 28, 2011, 09:12:41 »
Hi,

Quote
1. How can I set the different values of weigths, mean and variance (GMM calculated in matlab) that represent P(E|H1) and P(E|H2)?

The continuous nodes in HUGIN are assumed conditional linear Gaussian. There will be a mean and a variance to specify for E for each state/configuration of the discrete parents of E in the table for E.

If the distribution of E is a mixture for each state of H, then you need to introduce an additional variable speficying the components. If you send a more concrete example including the numbers/mixture, then we may be able to provide more detailed help.

Quote
2. How can I discretize the continuous distribution using interval nodes?? it is possible the intervals have different sizes?

You should specify the discrete chance node as subtype Interval and use the Table Generator to specify a mathematical expression for the child. You can then specify the number and sizes of the intervals. There is an option to display the corresponding CPT as a heat map. The tutorial for the Table Generator contains an example.
HUGIN EXPERT A/S

Offline eb20

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: GMM / Interval nodes
« Reply #2 on: April 30, 2011, 01:36:24 »
Thank you so much for your help

1. In the first case I have a mixture of 5 gaussians for the distribution of E for each state of H:

pdf(E|H1): is a mixture of gaussians with mu = [5.6323 15.666 9.8647 6.9134 7.3691], sigma = [2.7362 38.5418 5.2175 1.5728 8.1571] weigths = [0.19355 0.021886 0.24653 0.27187 0.26616]

pdf(E|H2): mu = [5.4107 3.1843 1.2081 2.4174 4.0452] sigma = [4.0339 1.9116 1.3164 1.8746 2.3298] weights = [0.10401 0.26062 0.17914 0.24287 0.21336]

Could it be also possible to use the table generator with the expression pdf(E|Hi) = sum(Wi*Normal(MUi, SIGMAi)) (the expression from which it can be calculated the pdf from mu, sigma and weight)?

2. In this case I don't know the conditional probability distribution that node E follows. So I don't have a expression but only numbers, because I have calculated and discretized the pdf with Matlab. Which are the expressions in C++ for setting the interval boundaries and its values in C++?

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2295
    • View Profile
Re: GMM / Interval nodes
« Reply #3 on: April 30, 2011, 18:55:39 »
Quote
1. In the first case I have a mixture of 5 gaussians for the distribution of E for each state of H:

pdf(E|H1): is a mixture of gaussians with mu = [5.6323 15.666 9.8647 6.9134 7.3691], sigma = [2.7362 38.5418 5.2175 1.5728 8.1571] weigths = [0.19355 0.021886 0.24653 0.27187 0.26616]

pdf(E|H2): mu = [5.4107 3.1843 1.2081 2.4174 4.0452] sigma = [4.0339 1.9116 1.3164 1.8746 2.3298] weights = [0.10401 0.26062 0.17914 0.24287 0.21336]

Could it be also possible to use the table generator with the expression pdf(E|Hi) = sum(Wi*Normal(MUi, SIGMAi)) (the expression from which it can be calculated the pdf from mu, sigma and weight)?


I attach a network that illustrates possible way forward. It includes a selector node to support the specification of a mixture distribution. Notice that your weights do not sum to 1 (as I would expect). I have not complete the network, It only shows the principle.

You can use the Table Generator, but then you hve to discretize the child node.

Quote
2. In this case I don't know the conditional probability distribution that node E follows. So I don't have a expression but only numbers, because I have calculated and discretized the pdf with Matlab. Which are the expressions in C++ for setting the interval boundaries and its values in C++?

You should use the method setStateValue on IntervalDCNode
HUGIN EXPERT A/S

Offline eb20

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: GMM / Interval nodes
« Reply #4 on: May 03, 2011, 03:09:28 »
Hi,

Quote
Notice that your weights do not sum to 1 (as I would expect)
Yes, the weights has to sum 1, but I made a mistake when typing the values.

Quote
I attach a network that illustrates possible way forward
Would you mind attaching again the network example? because I can't see the file.

A couple more questions:
1. Is there any limitation on the number of states that can have an interval node in a no-lite version of Hugin?
2. How can I set the value 'infinity' with setStateValue? because I get an error when I try to set this value.

Thank you again :)

Offline Anders L Madsen

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 2295
    • View Profile
Re: GMM / Interval nodes
« Reply #5 on: May 03, 2011, 19:41:40 »
Quote
Would you mind attaching again the network example?

The network is attached.

Quote
A couple more questions:
1. Is there any limitation on the number of states that can have an interval node in a no-lite version of Hugin?

There is no limitation on the number of states (except for hardware and Operating System constraints).

Quote
2. How can I set the value 'infinity' with setStateValue? because I get an error when I try to set this value.
You use the method INFINITY on NetworkModel
« Last Edit: May 03, 2011, 19:53:18 by Anders L Madsen »
HUGIN EXPERT A/S

Offline eb20

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: GMM / Interval nodes
« Reply #6 on: May 05, 2011, 20:25:12 »
Thanks for your answers, it have been very helpful for me!