Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Network

Represents a Bayesian Network, or a Dynamic Bayesian Network. To perform inference with a network see the {@link com.bayesserver.inference} namespace.

A Bayesian network consists of nodes which contain one or more variables. Each node can be connected with a directed {@link com.bayesserver.Link link} (A link in a Dynamic Bayesian Network can have an associated order which links nodes in different time slices).

Each node in a Bayesian network must have a distribution specified over its own variables conditional on its parents variables. For example if a network contains nodes A and B each with a single variable of the same name, and A is a parent of B, then the distribution at A equals P(A), since A has no parents, and the distribution at B equals P(B|A).

Once the nodes, links, and distributions in a Bayesian network have been specified, one or more inference engines can be created based on the network, to perform probabilistic inference. See {@link com.bayesserver.inference.IInference}.

see

com.bayesserver.Node

see

com.bayesserver.Link

Hierarchy

  • Network

Index

Constructors

constructor

  • Initializes a new instance of the {@link com.bayesserver.Network} class.

    Returns Network

  • Initializes a new instance of the {@link com.bayesserver.Network} class with the specified [name].

    Parameters

    • name: string

      The optional name of the network. Can be null.

    Returns Network

Accessors

customProperties

  • Gets custom properties associated with this instance.

    Custom properties allow storage of custom information, which will be saved with the network.

    Returns CustomPropertyCollection

description

  • get description(): string
  • set description(value: string): void
  • An optional description for the Bayesian network.

    Returns string

  • An optional description for the Bayesian network.

    Parameters

    • value: string

    Returns void

isInternal

  • get isInternal(): boolean
  • set isInternal(value: boolean): void
  • For internal use only. May be removed in future versions.

    Returns boolean

  • For internal use only. May be removed in future versions.

    Parameters

    • value: boolean

    Returns void

links

  • The collection of links in the Bayesian network.

    Note that if a {@link com.bayesserver.Node} is removed from the network, all of its links are automatically removed.

    see

    com.bayesserver.Link

    Returns NetworkLinkCollection

name

  • get name(): string
  • set name(value: string): void
  • An optional name for the Bayesian network.

    Returns string

  • An optional name for the Bayesian network.

    Parameters

    • value: string

    Returns void

nodeGroups

  • Gets groups which nodes can belong to.

    Each node can belong to one or more groups.

    Returns NetworkNodeGroupCollection

nodes

  • The collection of nodes in the Bayesian network.

    see

    com.bayesserver.Node

    Returns NetworkNodeCollection

variables

  • The collection of variables in the Bayesian network.

    see

    com.bayesserver.Variable

    Returns NetworkVariableCollection

Static syncNodeVariableName

  • get syncNodeVariableName(): boolean
  • set syncNodeVariableName(value: boolean): void
  • When true synchronizes {@link com.bayesserver.Variable} names with their containing {@link com.bayesserver.Node}.

    The synchronization is one way from the Node to the Variable only.

    Synchronization only occurs when a node has a single variable, whose name matches its containing node.

    Returns boolean

  • When true synchronizes {@link com.bayesserver.Variable} names with their containing {@link com.bayesserver.Node}.

    The synchronization is one way from the Node to the Variable only.

    Synchronization only occurs when a node has a single variable, whose name matches its containing node.

    Parameters

    • value: boolean

    Returns void

Methods

_ssv_x_

  • _ssv_x_(p_autogen11: number, p_autogen12: Link, p_autogen13: Link, p_autogen14: CollectionAction, p_autogen15: boolean): void
  • Parameters

    Returns void

_str_x_

  • Parameters

    Returns void

_sts_x_

  • Parameters

    Returns void

_stt_x_

  • _stt_x_(p_autogen25: number, p_autogen26: Node, p_autogen27: Node, p_autogen28: CollectionAction, p_autogen29: boolean): void
  • Parameters

    Returns void

_stu_x_

  • Parameters

    Returns void

_stv_x_

_suq_x_

addMonitor

  • For internal use only.

    exception

    ReferenceError Raised if [monitor] is null.

    Parameters

    Returns void

copy

  • Makes a copy of the network.

    Returns Network

    The copy.

isDag

  • isDag(): boolean
  • Determines whether this instance is a Directed Acyclic Graph (DAG) which is a requirement for Bayesian networks.

    Returns boolean

    true if this instance is a DAG; otherwise, false.

isTree

  • isTree(): boolean
  • Determines whether this instance is a tree (singly connected).

    Returns boolean

    true if this instance is a tree; otherwise, false.

loadFromString

  • loadFromString(value: string): void
  • Loads a network from a string.

    Parameters

    • value: string

      The persisted string value of the network.

    Returns void

removeMonitor

  • For internal use.

    exception

    ReferenceError Raised if [monitor] is null.

    Parameters

    Returns void

saveToString

  • saveToString(): string
  • Saves the network to a string, with UTF-8 encoding. For large networks consider saving to file or a stream.

    Returns string

    The network persisted to a string.

validate

  • Validates that the Bayesian network is correctly specified.

    exception

    InvalidNetworkException Raised when the network is not correctly specified, containing the error message.

    Parameters

    Returns void