Bsoft 2.1.4
Bernard's software package
binomial.cpp File Reference

Functions to generate and fit binomials. More...

#include "simplex.h"
#include "math_util.h"
#include "utilities.h"

Functions

double Bnp_R (Bsimplex *simp)
 
double Bnpk (int n, double p, int k, double w)
 Calculates the probability of k occurrences in n cases. More...
 
double Bnp_R (Bsimplex &simp)
 
double binomial_fit (vector< double > &distrib, int n, int nfit, vector< double > &coeff)
 Fits a distribution to one or more binomial distributions. More...
 

Variables

int verbose
 

Detailed Description

Functions to generate and fit binomials.

Author
Daniel Nemecek and Bernard Heymann
Date
Created: 20091202
Modified: 20190201

Function Documentation

◆ binomial_fit()

double binomial_fit ( vector< double > &  distrib,
int  n,
int  nfit,
vector< double > &  coeff 
)

Fits a distribution to one or more binomial distributions.

Author
Daniel Nemecek and Bernard Heymann
Parameters
&distribdistribution.
nnumber of cases (number of values in distribution).
nfitnumber of binomial curves to fit.
&coefffitted coefficients (weights and probabilities).
Returns
double residual.
The binomial curve(s) is(are) fit using the downhill simplex method.

◆ Bnp_R() [1/2]

double Bnp_R ( Bsimplex simp)

◆ Bnp_R() [2/2]

double Bnp_R ( Bsimplex simp)

◆ Bnpk()

double Bnpk ( int  n,
double  p,
int  k,
double  w 
)

Calculates the probability of k occurrences in n cases.

Author
Daniel Nemecek and Bernard Heymann
Parameters
nnumber of cases.
pprobability of one occurrence [0-1].
koccurrences (<=n).
wweight [0-1].
Returns
double weighted probability.

Variable Documentation

◆ verbose

int verbose
extern