defaultAlphas {Peanut} | R Documentation |
Combination rules can be sorted into multiple-a rules (e.g.,
Compensatory
) and multiple-b rules (e.g.,
OffsetConjunctive
). The function
isOffsetRule
distinguishes between the two
types. These functions adjust the log alpha or beta matrix to the
correct length depending on the rule and parents of the node
argument.
defaultAlphas(node, rule) defaultBetas(node, rule)
node |
A |
rule |
A character scalar giving the name of a combination rule. |
A vector of zeros of a suitable length to be used as a default value
for PnodeLnAlphas(node)
or
PnodeBetas(node)
.
These are used in the PNetica implementation of the
Pnode
constructor.
Russell Almond
Pnode
, PnodeLnAlphas
,
PnodeBetas
, isOffsetRule
## Not run: library(PNetica) # Requires PNetica sess <- NeticaSession() startSession(sess) EM1 <- ReadNetworks(file.path(library(help="PNetica")$path, "testnets", "PPcompEM.dne"), session=sess) EM2 <- ReadNetworks(file.path(library(help="PNetica")$path, "testnets", "PPconjEM.dne"), session=sess) comp <- PnetFindNode(EM1,"CompensatoryObs") conj <- PnetFindNode(EM2,"ConjunctiveObs") stopifnot( defaultAlphas(comp,"Compensatory") == c(0,0), defaultBetas(comp,"Compensatory") == 0, defaultAlphas(conj,"OffsetConjuctive") == 0, defaultBetas(conj,"OffsetConjunctive") == c(0,0) ) DeleteNetwork(list(EM1,EM2)) stopSession(sess) ## End(Not run)