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

The following example generates 500 random Poisson distributed values and then uses PoissonFit routine to extract used Lambda parameter

var vec1: Vector;
  resLambda: double;
  CILambda: TTwoElmReal;
begin
  // first, generate 500 randomly Poiss. distributed
  // numbers with parameter lambda=1.17
  vec1.Size(500);
  RandomPoisson(1.17,vec1);
  // Now, extract the lambda and its 95%
  // confidence interval
  PoissonFit(vec1,resLambda,CILambda);
end;
#include "StatRandom.hpp"
#include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example()
{
  sVector vec1;
  // first, generate 500 randomly Poiss. distributed
  // numbers with parameter lambda=1.17
  vec1.Size(500,false);
  RandomPoisson(1.17,vec1);
  // Now, extract the lambda and its 95%
  // confidence interval
  double resLambda;
  TTwoElmReal CILambda;
  PoissonFit(vec1,resLambda,CILambda,0.05);
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.