Estimate probability distribution by Monte Carlo method

Issue #16 closed
Pierre Denis repo owner created an issue

Most results provided by Lea require the calculation of exact probability distributions from an expression mixing several given probability distributions. For example,

leaRes = f(lea1,g(Lea2,lea3))

This is performed through combinatorial approach (cartesian product lea1 x lea2 x lea3), which can become impracticable when the number/size of distributions increase. Another approach should be to estimate the resulting probability distribution through a Monte Carlo method : counting the frequencies of a random sample

f(lea1.random(),g(lea2.random(),lea3.random())

shall provide an estimation of the resulting distribution, which become more and more accurate, as the size of the sample grows. Although such approach can be programmed by the user, we want that this is automated from the given Lea instance definition, through a new randomMC method:

leaRes = f(lea1,g(Lea2,lea3))
sampleMC = leaRes.randomMC(1000)
estimatedLeaRes = Lea.fromSeq(sampleMC)

Note that the current random(n) method is NOT adequate because it first calculates the exact distribution, which we want to avoid.

Comments (10)

  1. Log in to comment