Dew Stats Master .NET
BinomFit Routines
Summary
Calculate parameters for binomial distributed values.

Unit
Statistics

Declaration
Procedure BinomFit(X: TVec; out N: Integer; out p: TSample);


Declaration
Procedure BinomFit(X: TVec; n: TSample; p: TVec);


Declaration
Procedure BinomFit(X: TVec; n: TSample; p, Low, High: TVec; alpha: TSample = 0.05);
 Parameter  Description 
Stores data which is assumed to be binomial distributed. 
Defines binomial distribution n parameter. 
Returns binomial distribution p parameter, estimated at each X value. 
Low,High p (1-Alpha)*100 percent confidence intervals. Each pair of Low and High values defines lower and upper CI for corresponding p value. 
Alpha Confidence interval percentage. 

Categories
Distribution parameters estimation
 See Also 
RandomBinom 
MVBinom 

Example 1

The following example generates 100 random Weibull distributed values and then uses WeibullFit routine to extract used a and b parameters:

The following example generates 100 binomial distributed values and then uses BinomFit routine to extract p parameter:<p> var vec1: Vector; resP: TSample; LowInt,HighInt: Vector; begin vec1.Size(1000); RandomBinom(35,0.25,vec1); // Now extract p-s and its 100*(1-Alpha) // confidence intervals. BinomFit(vec1,35,p,LowInt,HighInt); // vector p holds the p for each element in vec1, // vectors LowInt and HighInt hold the lower and upper conf. int. limit // for each element in p end;
#include "StatRandom.hpp" #include "MtxVecCpp.h" #include "Statistics.hpp" void __fastcall Example(); { Vector vec1,LowInt,HighInt; vec1->Size(1000,false); RandomBinom(35,0.25,vec1); // Now extract p-s and its 100*(1-Alpha) // confidence intervals. double p; BinomFit(vec1,35,p,LowInt,HighInt,0.05); // vector p holds the p for each element in vec1, // vectors LowInt and HighInt hold the lower and upper conf. int. limit // for each element in p }
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples; { private void Example() { Vector vec1 = new Vector(1000,false); Vector LowInt = new Vector(0); Vector HighInt = new Vector(0); StatRandom.RandomBinom(35,0.25,vec1); // Now extract p-s and its 100*(1-Alpha) // confidence intervals. double p; Statistics.BinomFit(vec1,35,out p,LowInt,HighInt,0.05); // vector p holds the p for each element in vec1, // vectors LowInt and HighInt hold the lower and upper conf. int. limit // for each element in p } }


Copyright 2008 Dew Research
http://www.dewresearch.com