0

I have the following question regarding the mc2d package for Monte Carlo simulations.

Given a mc node, i.e. a mc object. How can we get the uncertainty for the values of the distribution?

For instance, as an input distribution I am using an uniform distribution, where the min is e.g. equal to 2, and the max equal to 8. Given this, we produce a mc object, apply it to mc.

The summary function produces values such as the median, mean, 97.5% etc. etc.

But as I said, how can be get an estimate of uncertainty for a given value?

Thanks in advance!

1 Answers1

1

Well, you'd have to collect second momentum Then

v = <x^2> - <x>^2
u = sqrt(v)/sqrt(N-1)

a = <x> +-u

To make things more clear, you sample events

x = 2 + (8-2)*U(0,1)

somewhere in the summary function you compute sum of events

m = m + x

so after running N events you report mean=m/N

You have to add code to collect second momentum, something like

m2 = m2 + x*x

So after run you could compute

v = m2/N - mean*mean
u = sqrt(v)/sqrt(N-1)

and report mean with uncertainty as mean +-u

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64