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

Calculate parameters for Laplace distributed values.

Pascal
procedure LaplaceFit(const X: TVec; out mu: double; out b: double); overload;
Parameters 
Description 
Stores data which is assumed to be Laplace distributed. 
mu 
Return Laplace distribution parameter estimator M. 
Return Laplace distribution parameter estimator b. 

The following example generates 100 random Laplace distributed values and then uses LaplaceFit routine to extract used Mu and b parameters:

Uses StatRandom, Statistics, MtxExpr;
procecure Example;
  var Data :Vector;
  mu,b: double;
begin
  Data.Size(100);
  RandomLaplace(3,0.2,Data);
  LaplaceFit(Data,mu,b);
  // mu approx 3.0
  // b approx 0.2
end;
#include "StatRandom.hpp"
#include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example();
{
  sVector Data;
  Data.Size(100,false);
  RandomLaplace(3,0.2,Data);
  double mu, b;
  LaplaceFit(Data,mu,b);
  // mu approx 3.0
  // b approx 0.2
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!