distributed values.
Example 1
The following example generates 500 random Poisson distributed values and then uses PoissonFit routine to extract used Lambda parameter: var vec1: Vector;
resLambda: TSample;
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 "MtxVecCpp.h"
#include "Statistics.hpp"
void __fastcall Example();
{
Vector 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;
double CILambda[2];
PoissonFit(vec1,resLambda,CILambda,0.05);
}
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples;
{
private void Example()
{
Vector vec1 = new Vector(500,false);
// first, generate 500 randomly Poiss. distributed
// numbers with parameter lambda=1.17
StatRandom.RandomPoisson(1.17,vec1);
// Now, extract the lambda and its 95%
// confidence interval
double resLambda;
double[2] CILambda;
Statistics.PoissonFit(vec1,out resLambda,out CILambda,0.05);
}
}