openturns / openturns

Uncertainty treatment library
http://openturns.github.io/openturns/latest/index.html
Other
238 stars 93 forks source link

ExpectationSimulationAlgorithm cannot manage an arbitrary experiment #2378

Open mbaudin47 opened 1 year ago

mbaudin47 commented 1 year ago

The ProbabilitySimulationAlgorithm class can be built upon an Experiment() (and, of course, an event):

experiment = ot.MonteCarloExperiment()
algo = ot.ProbabilitySimulationAlgorithm(event, experiment)

The only constructor of ExpectationSimulationAlgorithm is using a RandomVector:

algo = ot.ExpectationSimulationAlgorithm(random_vector)

and there is no way to use another type of design of experiments. It is Monte-Carlo period.

This is sad because we may use e.g. a LHS design or a randomized QMC. The two cases must, however, be handled differently. The LHS leads to an estimate of the mean which is asymptotically Gaussian. Increasing the sample size will reduce the length of the confidence interval. Therefore, the current algorithm works fine, without any change.

(Edit. 16/10/2023). A potential constructor would be:

algo = ot.ExpectationSimulationAlgorithm(function, experiment)

In this case, the weighted input sample is generated from the experiment and the output sample is evaluated from the function and the weighted formula:

$$ \bar{y} = \sum_{i=1}^n w_i g(x_i) $$

This issue is a follow-up of a message posted in OpenTURNS Discourse.

jschueller commented 1 year ago

currently we do not make the assumption that the RV is composite (Y=f(X)): it can be any RV that does not explicit its antecedent X and f, just lets a sample of Y