### Author Topic: Extracting the value of a state from a node  (Read 13443 times)

#### andersrm

• Newbie
• Posts: 19
##### Extracting the value of a state from a node
« on: February 06, 2012, 09:18:15 »
I would like to create a node that extracts only the value of a single state from the node that is upstream of it.  Any ideas on how to create a node like this?

#### Anders L Madsen

• HUGIN Expert
• Hero Member
• Posts: 2282
##### Re: Extracting the value of a state from a node
« Reply #1 on: February 06, 2012, 13:45:41 »
If you describe in more detail exactly what you aim to do, then we may be able to help you (e.g., what types of nodes are involved, is it in an expression, is it the probability, utility or value of a state you are looking for). The more details you can provide, the better.
HUGIN EXPERT A/S

#### andersrm

• Newbie
• Posts: 19
##### Re: Extracting the value of a state from a node
« Reply #2 on: February 06, 2012, 17:52:08 »
The upstream node is a chance node with 3 states, whose value is determined by an expression.  When compiled, the network computes a probability for each of the 3 states.  I would like to create a downstream node whose value is determined by an expression that includes that computed probability for *one* of the 3 states of the upstream nodes.

#### Anders L Madsen

• HUGIN Expert
• Hero Member
• Posts: 2282
##### Re: Extracting the value of a state from a node
« Reply #3 on: February 08, 2012, 17:04:04 »
An expression specifies a relation between configurations of parent variables and states of the child variable. Tables are generated as part of the compilation process.

It is not possible to refer to the probability of a state in an expression as the probability is computed after tables have been generated.

If you are using the probability in the calculation of a value, then you may be able to use function nodes as an alternative. A function node represents a value computed after propagation of evidence.
HUGIN EXPERT A/S

#### andersrm

• Newbie
• Posts: 19
##### Re: Extracting the value of a state from a node
« Reply #4 on: February 10, 2012, 01:16:17 »
Are "function nodes" available in API Version 7.0/GUI 7.0 (hgui_build 7004) ??

#### Anders L Madsen

• HUGIN Expert
• Hero Member
• Posts: 2282
##### Re: Extracting the value of a state from a node
« Reply #5 on: February 10, 2012, 16:41:57 »
Quote
Are "function nodes" available in API Version 7.0/GUI 7.0 (hgui_build 7004) ??

No, they were introduced in version 7.3:
http://www.hugin.com/news/268-mar-30-2010-release-hugin-73
HUGIN EXPERT A/S

#### andersrm

• Newbie
• Posts: 19
##### Re: Extracting the value of a state from a node
« Reply #6 on: October 09, 2012, 22:17:38 »
As of version 7.6 hgui64_76 (7605), I think that Hugin Funcition nodes do not accept Interval nodes as parents.  Is this true?  I so, will this be updated, and, if so, when?

Richard

#### Anders L Madsen

• HUGIN Expert
• Hero Member
• Posts: 2282
##### Re: Extracting the value of a state from a node
« Reply #7 on: October 09, 2012, 23:00:55 »
Richard,

A function node represents a numerical value computed from an expression. The expression may include the value of parents of the function node in the graph. A state of an interval node does not represent a unique value and interval nodes cannot be used as parents of a function node.

What are you trying to do - maybe there is another solution?
HUGIN EXPERT A/S

#### andersrm

• Newbie
• Posts: 19
##### Re: Extracting the value of a state from a node
« Reply #8 on: October 10, 2012, 00:01:31 »
I may be up against the limitations of the probabilistic graphical model vs. a more traditional systems dynamics model.

1. I would like to define a variable that computes the size of a population of oysters on a reef as part of dynamic probabilistic network.  At each time step, growth over the previous time interval is added to the previous size to equal the new size.

2. I would also like a variable that computes the probability that the size exceeds a fixed size threshold (i.e., become adults).

3. I would like to interpret this probability as a proportion of the population and use it as part of an expression in a third variable.  In this third variable, the number of animals on the reef is being tracked.  In this third variable, I would like to use an expression in which the the adults are harvested/removed from the population.

Does this make sense?

Richard

#### Anders L Madsen

• HUGIN Expert
• Hero Member
• Posts: 2282
##### Re: Extracting the value of a state from a node
« Reply #9 on: October 11, 2012, 22:23:32 »
Quote
Does this make sense

Yes, I believe that I to some degree understand what you are trying to do. However, it is not clear where the issue of function nodes as children of interval nodes occur.

In 3. you mentin that you what the probability of a state to be used in an expression for another node. An expression defines the relationship between configurations of parents and states of the child. It is not (yet) possible to refer to the probability of a parent in the expression of a child.

If you could post the model you are working on or parts of it, then the challange may become more clear.
HUGIN EXPERT A/S

#### andersrm

• Newbie
• Posts: 19
##### Re: Extracting the value of a state from a node
« Reply #10 on: October 12, 2012, 01:06:23 »
I've attached an excerpt from the model.  Referencing my previous post:

1. the size variable (e.g., see size2) tracks population size;

2. I have not yet defined the threshold variable that will track the adults; and

3. the number variable (e.g., see number3) tracks the total number of animals in the reef population.  The harvest variable tracks the decision whether to harvest.  Note that currently harvest mortality is defined as a fixed proportion (0.1) of the population that is removed when the decision is to dredge and natural mortality is "low" (i.e., 0-0.5).  This needs to be changed to reflect the actual proportion of adults in the population.  Hence, the approach I've outlined.  I think you may be correct in that if I can define a variable as in step 2 above, I don't need the function variable, and thus the issue of the restriction on its usage does not occur.  I'm thinking "out loud" here...make sense, or am I missing something...?

Richard

P.S.  I"m having trouble getting the file to upload.  It's only 35K, but I'm getting a message saying the uploader is full.

#### andersrm

• Newbie
• Posts: 19
##### Re: Extracting the value of a state from a node
« Reply #11 on: October 12, 2012, 01:13:38 »
Frustrating.  I still can't get the file to upload.  Anders L Madsen, if there's another way to get the file to you/to the Forum, please let me know.

Thanks!

#### Anders L Madsen

• HUGIN Expert
• Hero Member
• Posts: 2282
##### Re: Extracting the value of a state from a node
« Reply #12 on: October 12, 2012, 09:20:42 »
You can send it to my email address "anders at hugin dot com".
HUGIN EXPERT A/S