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

Calculate parameters for geometrically distributed values.

Pascal
procedure GeometricFit(const X: TVec; out P: double; var PCI: TTwoElmReal; Alpha: double = 0.05); overload;
Parameters 
Description 
Stores data which is assumed to be geometricaly distributed. 
Returns geometric distribution parameter estimator. 
PCI 
P (1-Alpha)*100 percent confidence interval. 
Alpha 
Confidence interval percentage. 

RandomGeometric, GeometricStat

The following example generates 1000 random Geometric distributed values and then uses GeometricFit routine to extract used P parameter

Uses MtxExpr, Math387, Statistics;
procedure Example;
var vec1: Vector;
  resp: double;
  CIp: TTwoElmReal;
begin
  // first, generate 1000 randomly geometr. distributed
  // numbers with parameter p=0.713
  vec1.Size(1000);
  RandomGeometric(0.713,vec1);
  // Now, extract the p and its 100*(1-0.05) = 95%
  // confidence interval
  GeometricFit(vec1,resp,CIp);
end;
#include "StatRandom.hpp"
#include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example()
{
  sVector vec1;
  // first, generate 1000 randomly geometr. distributed
  // numbers with parameter p=0.713
  vec1.Size(1000);
  RandomGeometric(0.713,vec1);
  // Now, extract the p and its 100*(1-0.05) = 95%
  // confidence interval
  double resp;
  TTwoElmReal CIp;
  GeometricFit(vec1,resp,CIp, 0.05);
}
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!