Representation of nodes
An important part of a network
is the list of
nodes. The nodes summarize the local properties of a node, given the
parents of the node.
node (idx,parents,type="discrete",name=paste(idx), levels=2,levelnames=paste(1:levels),position=c(0,0)) ## S3 method for class 'node' print(x,filename=NA,condposterior=TRUE,condprior=TRUE,...) ## S3 method for class 'node' plot(x,cexscale=10,notext=FALSE,...) nodes(nw) nodes(nw) <- value
x |
an object of class |
parents |
a numeric vector with indices of the parents of the node. |
idx |
an integer, which gives the index of the node (the column number of the corresponding data frame). |
type |
a string, which gives the type of the node. Either
|
name |
a string, which gives the name used when plotting and printing. Defaults to the column name in the data frame. |
levels |
an integer. If |
levelnames |
if |
position |
a numeric vector with coordinates where the node should
appear in the
plot. Usually set by |
nw |
an object of class |
value |
a list of elements of class |
filename |
a string or |
condprior |
a logical. If |
condposterior |
a logical. If |
cexscale |
a numeric. Scale parameter to set the size of the nodes. |
notext |
a logical. If |
... |
additional plot arguments. |
The operations on a node are typically done when operating on a
network
, so these functions are not to be called
directly.
When a network is created with network
, the nodes in the
nodelist are created using the node
procedure.
Local
probability distributions are added as the property prob
to
each node using prob.node
. If the node is continuous, this is a
numeric vector with
the conditional variance and the conditional regression coefficients
arising from a regression on the continuous parents, using data. If
the node has discrete parents, prob
is a matrix with a row
for each configuration of the discrete parents. If the node is
discrete, prob
is a multiway array which gives the conditional
probability distribution for each configuration of the discrete
parents. The generated prob
can be replaced to match the prior
information available.
nodes
gives the list of nodes of a network. localprob
gives the probability distribution for each node in the network.
The node
creator function returns an object of class
node
, which is a list with the following
elements (properties),
idx |
an integer. A unique index for this node. It MUST correspond to the column index of the variable in the data frame. |
name |
a string. The printed name of the node. |
type |
a string. Either |
levels |
an integer. If the node is of type |
levelnames |
if |
parents |
a vector of indices of the parents to this node. It is
best to manage this vector using the |
prob |
a numeric vector, matrix or multiway array, giving the
initial probability distribution. If the node is discrete,
|
condprior |
a list, generated by |
condposterior |
a list, which gives the parameter posteriors obtained from
|
loglik |
a numeric giving the log likelihood contribution for this node,
calculated in |
simprob |
a numeric vector, matrix or multiway array similar to |
Susanne Gammelgaard Bottcher,
Claus Dethlefsen rpackage.deal@gmail.com.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.