Dew Stats Master .NET
BetaFit Routines
Summary
Calculate parameters for beta distributed values.

Unit
Statistics

Declaration
Procedure BetaFit(X: TVec; out A, B: TSample; MaxIter: Integer = 500; Tolerance: TSample = 1e-8);


Declaration
Procedure BetaFit(X: TVec; out A, B: TSample; out PCIA, PCIB: TTwoElmReal; MaxIter: Integer = 500; Tolerance: TSample = 1e-8; alpha: TSample = 0.05);
 Parameter  Description 
Stores data which is assumed to be Beta distributed. 
A,B Return Beta distribution parameter estimators. 
MaxIter Maximum number of iterations needed for deriving a and b. 
Tolerance Defines the acceptable tolerance for calculating a and b. 
PCIA,PCIB a and b (1-Alpha)*100 percent confidence intervals. 
Alpha Confidence interval percentage. 

Description
Calculate parameters for beta distributed values.
Categories
Distribution parameters estimation
 See Also 
RandomBeta 
MVBeta 

Example 1

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

Uses MtxExpr, Math387, Statistics, StatRandom; procedure Example; var vec1: Vector; resA, resB : TSample; CIA,CIB: TTwoElmReal; begin // first, generate 1000 randomly beta distributed // numbers with parameters a=3 and b =2 vec1.Size(1000); RandomBeta(3,2,vec1); // Now extract the a,b and their 95% confidence intervals. //Use at max 300 iterations and tolerance 0.001 BetaFit(vec1,resA,resB,CIA,CIB,300,1e-3); end;
#include "MtxVecCpp.h" #include "Statistics.hpp" #include "StatRandom.hpp" void __fastcall Example() { Vector vec1; vec1->Size(1000,false); // first, generate 1000 randomly beta distributed // numbers with parameters a=3 and b =2 RandomBeta(3,2,vec1); double esta,estb; double cia[2]; double cib[2]; // Now extract the a,b and their 95% confidence intervals. //Use at max 300 iterations and tolerance 0.001 BetaFit(vec1,esta,estb,cia,cib,300,1.0E-3,0.05); }
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples; { private void Example() { Vector v = new Vector(1000,false); // first, generate 1000 randomly beta distributed // numbers with parameters a=3 and b =2 StatRandom.RandomBeta(3.0, 2.0, v); double esta,estb; double[2] cia,cib; // Now extract the a,b and their 95% confidence intervals. //Use at max 300 iterations and tolerance 0.001 Statistics.BetaFit(v,out esta, out estb, out cia, out cib, 300, 1.0e-3, 0.05);


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