The following example generates 100 random log-normally distributed values and then uses NormalFit routine to extract used Mu and Sigma parameters:
Uses StatRandom, Statistics, MtxExpr; procecure Example; var Data :Vector; mu,sigma: double; MuCI, SigmaCI : TTwoElmReal; begin Data.Size(100); RandomLogNormal(3,0.2,Data); LogNormalFit(Data,mu,sigma,MuCI,SigmaCI); // mu approx 3.0 // sigma approx 0.2 end;
#include "StatRandom.hpp" #include "MtxExpr.hpp" #include "Statistics.hpp" void __fastcall Example(); { sVector Data; Data.Size(100,false); RandomLogNormal(3,0.2,Data); double mu, sigma; TTwoElmReal MuCI; TTwoElmReal SigmaCI; LogNormalFit(Data,mu,sigma,MuCI,SigmaCI,0.05); // mu approx 3.0 // sigma approx 0.2 }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|