An open API service indexing awesome lists of open source software.

https://github.com/jackgerrits/bayesnetsampler

Numerical solver for Bayesian networks.
https://github.com/jackgerrits/bayesnetsampler

Last synced: 2 months ago
JSON representation

Numerical solver for Bayesian networks.

Awesome Lists containing this project

README

        

## Build
Run `make` to compile all necessary files and produce a binary called `sampler`.

```
make
```

## Test
Uses the Google Test framework. https://github.com/google/googletest/

To run the included unit and integration tests contained in `test.cpp` :

```
make test
```

Note that several integration tests are non-deterministic given the nature of this assignment, however they have been given a large enough range and number of samples such that if it is working correctly it will pass.

## Run

```
./sampler [-r] networkDefinitionFile
```

- `-r` - use rejection sampling. Omitting `-r` uses the default likelihood sampling method.

- `networkDefinitonFile` - path to a file containing a network definition. An example definition can be seen in `burglarnetwork.txt`

The program then accepts a query from `stdin` and prints the probability distribution of the query variable to `stdout`. An example query is:

```
P(Burglar | Alarm=true, Earthquake=true)
```