> De: "Pamphile ROY" <[email protected]>
> À: "users" <[email protected]>
> Envoyé: Samedi 25 Juin 2016 09:48:51
> Objet: [ot-users] Sobol' indices

> Hi,

> I am using OpenTURNS to get Sobol' indices.

> I have a function which doesn't return a scalar value but a vector (1D). With
> ot.SensitivityAnalysis(), I am able to get the indices by component.
> I just iterate over:

> output_len = 400
> first = [ ]
> sa = ot.SensitivityAnalysis(...)
> for i in range(output_len):
> first.append(sa.getFirstOrderIndices(i))

> If I replace the method by ot.FAST I don't get the right output. Indices are
> constants.

>     * I am thinking, maybe ot.FAST doesn't allow to do that?

>    * Another question, is it possible to set up a model with a function which 
> has a
>     2D (or even more) output field?

> I would like then to do something like that:

> output_len = 400
> first = np.empty([output_len, output_len])
> sa = ot.SensitivityAnalysis(...)
> for i, j in itertools.product(range(output_len), range(output_len)):
> first[i, j] = sa.getFirstOrderIndices(i, j)

> Thank you for your help :)

> Pamphile ROY
> UQ Trainee at CERFACS

> _______________________________________________
> OpenTURNS users mailing list
> [email protected]
> http://openturns.org/mailman/listinfo/users

Hi Pamphile, 

- On my side FAST does return correctly the indices of a multivariate function 
[3]: 

- I'm afraid that is not possible to compute Sobol' indices over a Field (see 
[2]), only a vector function, 
but you could stilll pack your output field into a vector. 

- Note that in OpenTURNS 1.8 (coming soon) the SensitivityAnalysis is removed 
in favor of more powerful apis to compute different Sobol' indices estimators 
[1]. 

[1]: 
http://openturns.github.io/user_manual/_generated/openturns.SobolIndicesAlgorithm.html
 
[2]: 
http://openturns.github.io/user_manual/_generated/openturns.DynamicalFunction.html
 
[3]: 
inputDimension = 3 
outputDimension = 2 

inputName = ["X1", "X2", "X3"] 
outputName = ["Y", "Z"] 

# Test with Ishigami function 
formulaIshigami = Description(outputDimension) 
formulaIshigami[ 
0] = 
"sin(_pi*X1)+7*sin(_pi*X2)*sin(_pi*X2)+0.1*((_pi*X3)*(_pi*X3)*(_pi*X3)*(_pi*X3))*sin(_pi*X1)"
 
formulaIshigami[1] = "sin(_pi*X1)+7*sin(_pi*X2)" 
modelIshigami = NumericalMathFunction( 
inputName, outputName, formulaIshigami) 

distributions = ComposedDistribution([Uniform(-1.0, 1.0)] * inputDimension) 

sensitivityAnalysis = FAST(modelIshigami, distributions, 400) 

for i in range(outputDimension): 
firstOrderIndices = sensitivityAnalysis.getFirstOrderIndices(i) 
totalOrderIndices = sensitivityAnalysis.getTotalOrderIndices(i) 

print(firstOrderIndices, totalOrderIndices) 

Regards, 

-- 
Julien Schueller 
Phimeca Engineering 
www.phimeca.com 
_______________________________________________
OpenTURNS users mailing list
[email protected]
http://openturns.org/mailman/listinfo/users

Reply via email to