# check.commonprob: Check Joint Binary Probabilities In bindata: Generation of Artificial Binary Data

## Description

The main diagonal elements `commonprob[i,i]` are interpreted as probabilities p(A_i) that a binary variable A_i equals 1. The off-diagonal elements `commonprob[i,j]` are the probabilities p(A_iA_j) that both A_i and A_j are 1.

This programs checks some necessary conditions on these probabilities which must be fulfilled in order that a joint distribution of the A_i with the given probabilities can exist.

The conditions checked are

0 <= p(A_i) <= 1

max(0, p(A_i)+p(A_j)-1) <= p(A_iA_j) <= min(p(A_i), p(A_j)), i != j

p(A_i)+p(A_j)+p(A_k)-p(A_iA_j)-p(A_iA_k)-p(A_jA_k) <= 1, i != j, i != k, j != k

## Usage

 `1` ```check.commonprob(commonprob) ```

## Arguments

 `commonprob` Matrix of pairwise probabilities.

## Value

`check.commonprob` returns `TRUE`, if all conditions are fulfilled. The attribute `"message"` of the return value contains some information on the errors that were found.

## Author(s)

Andreas Weingessel

## References

Friedrich Leisch, Andreas Weingessel and Kurt Hornik (1998). On the generation of correlated artificial binary data. Working Paper Series, SFB “Adaptive Information Systems and Modelling in Economics and Management Science”, Vienna University of Economics, http://www.wu-wien.ac.at/am

`simul.commonprob`, `commonprob2sigma`

## Examples

 ```1 2 3 4 5``` ```check.commonprob(cbind(c(0.5, 0.4), c(0.4, 0.8))) check.commonprob(cbind(c(0.5, 0.25), c(0.25, 0.8))) check.commonprob(cbind(c(0.5, 0, 0), c(0, 0.5, 0), c(0, 0, 0.5))) ```

### Example output

``` TRUE
attr(,"message")
character(0)
 FALSE
attr(,"message")
 "Error in Element ( 1 , 2 ): Admissible values are in [ 0.3 , 0.5 ]."
 FALSE
attr(,"message")
 "The sum of the common probabilities of 1 , 2 , 3 must be at least 0.5 ."
```

bindata documentation built on May 2, 2019, 6:02 a.m.