Calculate parameters for Poisson distributed values.
procedure PoissonFit(const X: TVec; out lambda: double; var lambdaConfInt: TTwoElmReal; Alpha: double = 0.05); overload;
Parameters |
Description |
X |
Stores data which is assumed to be Poisson distributed. |
lambda |
Returns Poisson distribution parameter estimator. |
lambdaConfInt |
Lambda (1-Alpha)*100 percent confidence interval. |
Alpha |
Confidence interval percentage. |
RandomPoisson, PoissonStat
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.
|
What do you think about this topic? Send feedback!
|