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

The following example generates 100 random uniformly distributed values and then uses UniformFit routine to extract used Low and High parameters

Uses MtxExpr, Math387, Statistics;
procedure Example;
var vec1: Vector;
  resLow, resHigh : double;
  CILow,CIHigh: TTwoElmReal;
begin
    // first, generate 1000 randomly Uniformly distributed
    // numbers with parameters Low=1.5 and High =2.2
    vec1.Size(1000);
    RandomUniform(1.5,2.2,vec1);
    // Now extract the Low,High and their 95% confidence intervals.
    UniformFit(vec1,resLow,resHigh,CILow,CIHigh);
end;
#include "StatRandom.hpp"
#include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example();
{
    sVector vec1;
    // first, generate 1000 randomly Uniformly distributed
    // numbers with parameters Low=1.5 and High =2.2
    vec1.Size(1000,false);
    RandomUniform(1.5,2.2,vec1);
    // Now extract the Low,High and their 95% confidence intervals.
    double resLow,resHigh;
    TTwoElmReal CILow,CIHigh;
    UniformFit(vec1,resLow,resHigh,CILow,CIHigh,0.05);
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.