### Function Reference: `cl_multinom`

statistics: CL = cl_multinom (X, N, b)
statistics: CL = cl_multinom (X, N, b, method)

Confidence level of multinomial portions.

`cl_multinom` returns confidence level of multinomial parameters estimated as p = X / sum(X) with predefined confidence interval b. Finite population is also considered.

This function calculates the level of confidence at which the samples represent the true distribution given that there is a predefined tolerance (confidence interval). This is the upside down case of the typical excercises at which we want to get the confidence interval given the confidence level (and the estimated parameters of the underlying distribution). But once we accept (lets say at elections) that we have a standard predefined maximal acceptable error rate (e.g. b=0.02 ) in the estimation and we just want to know that how sure we can be that the measured proportions are the same as in the entire population (ie. the expected value and mean of the samples are roughly the same) we need to use this function.

### Arguments

Variable |  | Type |  | Description
--- | --- | --- | --- | ---
X |  | int vector |  | sample frequencies bins.
N |  | int scalar |  | Population size that was sampled by X. If `N < sum (X)`, infinite number assumed.
b |  | real vector |  | confidence interval. If vector, it should be the size of X containing confence interval for each cells. If scalar, each cell will have the same value of b unless it is zero or -1. If value is 0, b = 0.02 is assumed which is standard choice at elections otherwise it is calculated in a way that one sample in a cell alteration defines the confidence interval.
method |  | string |  | An optional argument for defining the calculation method. Available choices are `"bromaghin"` (default), `"cochran"`, and `agresti_cull`.

Note! The `agresti_cull` method is not exactly the solution at reference given below but an adjustment of the solutions above.

### Returns

Confidence level.

### Example

CL = cl_multinom ([27; 43; 19; 11], 10000, 0.05) returns 0.69 confidence level.

### References

1. "bromaghin" calculation type (default) is based on the article:

   Jeffrey F. Bromaghin, "Sample Size Determination for Interval Estimation of Multinomial Probabilities", The American Statistician vol 47, 1993, pp 203-206.

2. "cochran" calculation type is based on article:

   Robert T. Tortora, "A Note on Sample Size Estimation for Multinomial Populations", The American Statistician, , Vol 32. 1978, pp 100-102.

3. "agresti_cull" calculation type is based on article:

   A. Agresti and B.A. Coull, "Approximate is better than ’exact’ for interval estimation of binomial portions", The American Statistician, Vol. 52, 1998, pp 119-126

Source Code: cl_multinom

### Example: 1

     CL = cl_multinom ([27; 43; 19; 11], 10000, 0.05)

    CL = 0.6923