u_node: Create an uncertainty node.

Description Usage Arguments Value See Also Examples

Description

u_node returns an uncertainty node that takes the weighted average of it's children (e-value) as the value. An uncertainty node can have multiple children.

Usage

1
u_node(children, probs, name = "Uncertainty")

Arguments

children

List. A list of nodes that are the possibilities of this uncertainty.

probs

List. The probabilities associated to each of the children as a list of functions. Should have the same number of elements as children. If the number of elements is equal to children, they should sum to one. Otherwise, the u_node with silently do very bad things ...

name

Character. The name of this outcome

Value

A node (list) that has a value function and name.

See Also

Other node generating functions: d_node, o_node

Examples

1
2
3
4
5
6
7
8
9
# Generate a list of some outcome nodes to be children
children <- list(
  o_node(v = -10, name = "Rain"),
  o_node(v = 10, name = "Sunny")
)
x <- runif(1)
u <- u_node(children = children, probs = list(~ x, ~ 1 - x),
            name = "Weather")
str(u)

jongbinjung/datree documentation built on May 19, 2019, 7:30 p.m.