How does MG5_aMC calculate the MC errors of a histogram bin-by-bin

Asked by Keping Xie

Dear everyone,

Previously, Valentin Hirschi told me how to get the Monte-Carlo errors of a histogram bin-by-bin. I want to konw how the MG5_aMC code calculates these Errors?

When I look at the code HwU.f, there is a function called
      subroutine set_error_estimation(input)
There 3 options for variable input.
c Error estimation
c input 0: Simply sum all PS points; error is estimated by assuming
c Binomial statistics: use for unweighted events. (Assumes that
c all events have equal weight (up to a sign)).
c input 1: Simply sum all PS points; error is estimated by the
c variance between the separate iterations. This assumes that
c each iteration has the same number of PS points (This is the
c topdrawer default in MG5_aMC).
c input 2: Sum PS points for a given iteration and error estimate by
c square root of the sum of the squares. Perform a weighted average
c iteration-by-iteration
And when I search the code, I found only the the following parts invoke this function,
./MCatNLO/HWAnalyzer/hw6an_HwU_pp_h.f:56: call set_error_estimation(0)
./MCatNLO/PY8Analyzer/py8an_HwU_pp_h.f:62: call set_error_estimation(0)

However, when I use fixed-order calculation, and parton-shower program neither herwig nor pythia is invoked, in principle.
So, how does the MadGraph internal code to estimate the Monte-Carlo error bin-by-bin?

Further, for input=1(2), the errors are estimated through the iterations. What does this iterations mean? Does it mean the iteration of VEGAS when it optimizes the Monte-Calor integration? If yes, which option should I choose for fixed-order calculations.

Best regards,
Keping

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
Valentin Hirschi Edit question
Solved by:
Valentin Hirschi
Solved:
Last query:
Last reply:
Revision history for this message
Valentin Hirschi (valentin-hirschi) said :
#1

I am not sure why you stress the fact that for fixed order parton showers
are not employed.
The Monte-Carlo error on these histograms is in any case not related to the
interface to parton showers.

Coming back to your question, yes the iteration here refers to the VEGAS
integration (or actually MINT since this is the integrator we use, but for
all intended purposes you can think of it as VEGAS).

Now for shower analysis (the ones you showed when looking for the use of
the function 'set_error_estimation'), the events will be unweighted so that
one can basically simply assign a MC error of

(\sigma_\text{bin} / \sqrt{N} )

For fixed order predictions however, one needs to account for the fact that
events are weighted and as a result one must use mode 1 or 2 (the choice
between the two is somewhat arbitrary and basically depends on how much you
want to "trust" or "weight" the earlier integration iterations).

On Thu, Mar 9, 2017 at 12:04 AM, Olivier Mattelaer <
<email address hidden>> wrote:

> Question #541790 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/541790
>
> Assignee: None => Valentin Hirschi
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.
>

--
Valentin

Revision history for this message
Keping Xie (kepingx) said :
#2

Dear Valentin,

Thanks very much for your explanation.

Fixed-order calculations is what I want. Which part of the code invokes mode 1 or 2 to calculate the this MC error for bins? How can I switch between this two modes? I did find the point in the FixedOrderAnalysis code to envoke and control it.

Best,
Keping

Revision history for this message
Best Valentin Hirschi (valentin-hirschi) said :
#3

The default value for the 'error_estimation' mode in HwU.f is '3', which
corresponds to:

c input 2: Sum PS points for a given iteration and error estimate by
c square root of the sum of the squares. Perform a weighted average
c iteration-by-iteration
c input 3: Same as input 2, but weighted average is same as from MINT

This is the most natural mode to use for fixed order predictions given that
it is in line with the MINT integrator used.
This is why the example fixed order analysis don't call
'set_error_estimation' since they are happy with the default value employed.
I therefore suggest that you also stick with this choice.

If you however want to experiment and change it to mode 1 or 2 (0 wouldn't
make sense for fixed order predictions), you can do so by adding the call

call set_error_estimation(<your_chosen_mode>)

at the beginning of the subroutine

subroutine analysis_begin(nwgt,weights_info)

in your custom-made fixed order analysis fortran code.

On Thu, Mar 9, 2017 at 11:26 AM, Keping Xie <
<email address hidden>> wrote:

> Question #541790 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/541790
>
> Status: Answered => Open
>
> Keping Xie is still having a problem:
> Dear Valentin,
>
> Thanks very much for your explanation.
>
> Fixed-order calculations is what I want. Which part of the code invokes
> mode 1 or 2 to calculate the this MC error for bins? How can I switch
> between this two modes? I did find the point in the FixedOrderAnalysis
> code to envoke and control it.
>
> Best,
> Keping
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.
>

--
Valentin

Revision history for this message
Keping Xie (kepingx) said :
#4

Thanks Valentin Hirschi, that solved my question.