You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.BinomFit Function
Stats Master VCL
ContentsIndex
PreviousUpNext
Statistics.BinomFit Function

Calculate parameters for binomial distributed values.

Pascal
procedure BinomFit(const X: TVec; N: double; const p: TVec; const Low: TVec; const High: TVec; Alpha: double = 0.05); overload;
Parameters 
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. 

RandomBinom, BinomStat

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

var vec1: Vector;
  LowInt,HighInt,p: 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 "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example();
{
  sVector vec1,LowInt,HighInt,p;
  vec1.Size(1000,false);
  RandomBinom(35,0.25,vec1);
  // Now extract p-s and its 100*(1-Alpha)
  // confidence intervals.
  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
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!