From ca8e7308768642e4d8a199bcdc88e208be552a3d Mon Sep 17 00:00:00 2001 From: Pierre Fernique Date: Thu, 1 Sep 2016 11:18:34 +0200 Subject: [PATCH] Update binomial probability computation --- doc/cfg.py | 4 +++- doc/examples/basic/src/cpp/binomial.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/cfg.py b/doc/cfg.py index 2c6964e0..470a95d3 100644 --- a/doc/cfg.py +++ b/doc/cfg.py @@ -1,4 +1,6 @@ -c.NbConvertApp.notebooks = ["examples/basic.ipynb"] +c.NbConvertApp.notebooks = ["examples/basic.ipynb", + "examples/subset.ipynb"] c.ExecutePreprocessor.timeout = 60 +# conda install python-autowig python-clanglite -c statiskit -c conda-forge && git clone https://github.com/StatisKit/AutoWIG.git && cd AutoWIG/doc && jupyter nbconvert --config cfg.py --to notebook --execute --inplace diff --git a/doc/examples/basic/src/cpp/binomial.cpp b/doc/examples/basic/src/cpp/binomial.cpp index 23174533..40540ce6 100644 --- a/doc/examples/basic/src/cpp/binomial.cpp +++ b/doc/examples/basic/src/cpp/binomial.cpp @@ -25,7 +25,7 @@ double BinomialDistribution::pmf(const unsigned int value) const if(value > n) { p = 0; } else - { p = factorial(n)/(factorial(n-value) * factorial(value)) * pow(1-p, n-value) * pow(p, value); } + { p = factorial(n)/(factorial(n-value) * factorial(value)) * pow(1-_pi, n-value) * pow(_pi, value); } return p; }