[ot-users] Sample transformation

roy roy at cerfacs.fr
Thu Oct 5 11:13:57 CEST 2017


I am facing consistency concerns in the API regarding distributions and sampling.

The initial goal was to get the sampling for Polynomial Chaos as I must not use the model variable.
So for least square strategy I do something like this:

proj_strategy = ot.LeastSquaresStrategy(montecarlo_design)
sample = np.array(proj_strategy.getExperiment().generate())

sample is correct as the bounds of each feature lie in the corresponding ranges.

But now if I want to use IntegrationStrategy:

ot.IntegrationStrategy(ot.GaussProductExperiment(dists, list))
sample = np.array(proj_strategy.getExperiment().generate())

sample’s outputs lie between [-1, 1] which does not corresponds to the distribution I have initially.

So I used the conversion class but it does not work well with GaussProductExperiment as it requires [0, 1] instead of [-1, 1].

Thus I use this hack:

# Convert from [-1, 1] -> input distributions
marg_inv_transf = ot.MarginalTransformationEvaluation(distributions, 1)
sample = (proj_strategy.getExperiment().generate() + 1) / 2.

Is it normal that the distribution classes are not returning in the same intervals?

Thanks for your support!

Pamphile ROY
Chercheur doctorant en Quantification d’Incertitudes
CERFACS - Toulouse (31) - France
+33 (0) 5 61 19 31 57
+33 (0) 7 86 43 24 22

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openturns.org/pipermail/users/attachments/20171005/386ed9f7/attachment.html>

More information about the users mailing list