makesimprob {deal} R Documentation

## Make a suggestion for simulation probabilities

### Description

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`.

### Usage

```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)
})
```

### Arguments

 `nw` an object of class `network`. `s2` function that returns the variance as a function of the node index and the configuration of the discrete variables. `m0` function that returns the intercept as a function of the node index and the configuration of the discrete variables. `m1` function that returns the regression coefficients as a function of the node index and the configuration of the discrete variables.

### Details

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`.

### Value

The network object `nw`, where each node has attached the property `simprob`.

### Author(s)

Susanne Gammelgaard Bottcher,
Claus Dethlefsen rpackage.deal@gmail.com.

`rnetwork`