View Source BrowserForge.BayesianNode (BrowserForge v0.1.0)

Implementation of a single node in a bayesian network allowing sampling from its conditional distribution.

Summary

Functions

Extracts unconditional probabilities of node values given the values of the parent nodes.

Gets the name of the node.

Gets the parent names of the node.

Gets the possible values of the node.

Randomly samples from the conditional distribution of this node given values of parents.

Randomly samples from the conditional distribution of this node given restrictions on the possible values and the values of the parents.

Randomly samples from the given values using the given probabilities.

Types

t()

@type t() :: %BrowserForge.BayesianNode{node_definition: map()}

Functions

get_probabilities_given_known_values(node, parent_values)

Extracts unconditional probabilities of node values given the values of the parent nodes.

name(node)

Gets the name of the node.

new(node_definition)

parent_names(node)

Gets the parent names of the node.

possible_values(node)

Gets the possible values of the node.

sample(node, parent_values)

Randomly samples from the conditional distribution of this node given values of parents.

sample_according_to_restrictions(node, parent_values, value_possibilities, banned_values)

Randomly samples from the conditional distribution of this node given restrictions on the possible values and the values of the parents.

sample_random_value_from_possibilities(possible_values, probabilities)

Randomly samples from the given values using the given probabilities.