Creates local probability distributions reflecting the
graph of the network. These are attached as a simprob
property
to each node in the network and can be edited and used for
rnetwork
.
makesimprob(nw,
s2=function(idx,cf) {
cf <- as.vector(cf)
xs <- (1:length(cf))
log(xs%*%cf+1)
},
m0=function(idx,cf) {
cf <- as.vector(cf)
xs <- (1:length(cf))^2
.69*(xs%*%cf)
},
m1=function(idx,cf) {
cf <- as.vector(cf)
xs <- (1:length(cf))*10
idx*(cf%*%xs)
})
The network object nw
, where each node has attached the
property simprob
.
an object of class network
.
function that returns the variance as a function of the node index and the configuration of the discrete variables.
function that returns the intercept as a function of the node index and the configuration of the discrete variables.
function that returns the regression coefficients as a function of the node index and the configuration of the discrete variables.
Susanne Gammelgaard Bottcher,
Claus Dethlefsen rpackage.deal@gmail.com.
For each node, the local simprob
is determined. If the node is
discrete, the probability distribution is uniform (and thus not
reflecting the dependence in the graph, as it should). If the node is
continuous, one mean and variance is attached per configuration of the
discrete parents. The mean depends on the continuos parents and is the
regression coefficients determined by the functions m0
(intercept) and m1
(regression coefficients). The variance is
determined by the function s2
.
rnetwork