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

Calculate parameters for uniformly distributed values.

Pascal
procedure UniformFit(const X: TVec; out low: double; out high: double; var PCILow: TTwoElmReal; var PCIHigh: TTwoElmReal; Alpha: double = 0.05); overload;
Parameters 
Description 
Stores data which is assumed to be uniformly distributed. 
low 
Return uniform distribution parameter estimator Low. 
high 
Return uniform distribution parameter estimator High. 
PCILow 
Low (1-Alpha)*100 percent confidence interval. 
PCIHigh 
High (1-Alpha)*100 percent confidence interval. 
Alpha 
Confidence interval percentage. 

RandomUniform, UniformStat

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);
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!