# crossed4nbn1nbn: creates a crossed-nbn from two /nbn/s In rbmn: Handling Linear Gaussian Bayesian Networks

## Description

A crossed /nbn/ is a /nbn/ obtained when replacing each node of the first /nbn/ by the second /nbn/ and vice-versa.
Let `nn1/nn2` and `na1/na2` be the node and arc numbers of the two `nbn`s, the node number of the crossed `nbn` is `nn1*nn2` and its arc number is `nn1*na2+nn2*na1`.
The regression coefficients attributed to the crossed `nbn` are the products of the weights (`we1/we2`) and the regression coefficients of the initial `nbn`.

## Usage

 ```1 2 3``` ```crossed4nbn1nbn(nbn1, nbn2, we1=rep(1, length(nbn1)), we2=rep(1, length(nbn2)), nona=as.vector(outer(names(nbn1), names(nbn2), paste, sep="_"))) ```

## Arguments

 `nbn1` The first generating /nbn/. `nbn2` The second generating /nbn/. `we1` The weight to apply to the nodes of the first generating /nbn/. `we2` The weight to apply to the nodes of the second generating /nbn/. `nona` The node names to give to the crossed /nbn/, the nodes of the `nbn1` varying first.

## Details

The `mu` coefficient is the sum of the two corresponding `mu`s of the generating `nbn`.
The `sigma` coefficient is the product of the two corresponding `sigma`s of the generating `nbn`.
The regression coefficient are directed inherited from the `nbn` which is duplicated with this arc.

## Value

The resulting crossed `nbn` object.

## Examples

 `1` ``` print8nbn(crossed4nbn1nbn(rbmn0nbn.01, rbmn0nbn.04)); ```

rbmn documentation built on Jan. 16, 2021, 5:31 p.m.