distributed values.
Example 1
The following example generates 100 random Rayleigh distributed values and then uses RayleighFit routine to extract used b parameter: var vec1: Vector;
resB : TSample;
CIb: TTwoElmReal;
begin
// first, generate 1000 randomly Rayleigh distributed
// numbers with b=1.3
vec1.Size(1000);
RandomRayleigh(1.3,vec1);
// Now extract the r and it's 95% confidence intervals.
RayleighFit(vec1,resb,CIb);
end;
#include "StatRandom.hpp"
#include "MtxVecCpp.h"
#include "Statistics.hpp"
void __fastcall Example();
{
Vector vec1;
// first, generate 1000 randomly Rayleigh distributed
// numbers with b=1.3
vec1->Size(1000,false);
RandomRayleigh(1.3,vec1);
// Now extract the r and it's 95% confidence intervals.
double resb;
double CIb[2];
RayleighFit(vec1,resb,CIb,0.05);
}
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples;
{
private void Example()
{
Vector vec1 = new Vector(0);
// first, generate 1000 randomly Rayleigh distributed
// numbers with b=1.3
vec1.Size(1000,false);
StatRandom.RandomRayleigh(1.3,vec1);
// Now extract the r and it's 95% confidence intervals.
double resb;
double[2] CIb;
Statistics.RayleighFit(vec1,out resb,out CIb,0.05);
}
}
Declaration
Procedure RayleighFit(X: TVec; out b: TSample);