Hi, i'm using TMath::Landau to fit a histogram of data i've collected.

I've seen on documentation that the second argument of this function is the most probable value, while the third is the width of the distribution.

However, if i use TF1::GetMaximumX with the function i've used, i see that the value of x where there's maximum is not equal to the second parameter of the distribution.

Could someone tell me why this appens?

Thanks in advance

Andrea

## Landau distribution, most probable value.

**Moderator:** rootdev

Here's a working example

Code: Select all

`#include <iostream>`

#include <TApplication.h>

#include <TMath.h>

#include <TCanvas.h>

#include <TF1.h>

using namespace std;

TApplication gui("gui",0,NULL);

double f(double *x,double *par){

double t;

t=TMath::Landau(x[0],par[0],par[1],0); //p0 is MP,p1 is sigma

return t;

}

main(){

TF1 fun("fun",f,-100,100,2);

fun.SetParameter(0,20); //MP is 20

fun.SetParameter(1,5); //sigma is 5

TCanvas c;

fun.Draw();

double x;

x=fun.GetMaximumX(-100,100);

cout<<"x is "<<x<<endl;

gui.Run("TRUE");

c.Close();

}

when i run it, i see that x (line 22) is 18.8861 and not 20: so the most probable value in TMath::Landau is not the maximum of this function.

Andrea

the definition used in TMath::Landau for the mpv and sigma of the Landau is only approximate. It is like a normal-like parameterization of the distribution, which is somehow convenient when you are doing for example a fit.

In reality the maximum of the Landau (mpv) occurs not a zero but a value of x = -0.22278 and the sigma (variance) is not even defined.

We should update the documentation in TMath to avoid this confusion

For more detail you can consult the following paper:

K.S. Kölbig and B. Schorr, A program package for the Landau distribution, Computer Phys. Comm. 31 (1984) 97-111.

Thank you for your report

Lorenzo

### Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 2 guests