Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : Sobol indices and groups #583

Open
ghost opened this issue Jul 28, 2023 · 1 comment
Open

Question : Sobol indices and groups #583

ghost opened this issue Jul 28, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 28, 2023

Hi !

I have come to you because I would like to implement a strategy for calculating Sobol indices for the following problem:

I have a model with 16 inputs and 1 output. The 16 inputs are split into two :

-> The first 11 inputs are managed independently.
-> The last 5 inputs form a group (called VG_2): a 5D random vector.

The 11 variables are independent of each other, and also of the VG_2 group. Whereas the 5 variables making up the group are not independent of each other. They represent a particular system which only makes sense if they are managed together.

It's easy for me to generate instances of these 16 variables.

I want to obtain a ranking of the 11 variables + VG_2 (1st order, 2nd order and total indices).

This model comes from a GP (Gaussian Process).

It seems that SALib can take groups into account with Sobol.

However, I can't see how to properly declare the problem for this context. Can you help me?

Normally, I haven't read about a similar problem on the github, but if I'm wrong, sorry for the redundancy!

Thank you very much!

@ConnectedSystems
Copy link
Member

ConnectedSystems commented Aug 11, 2023

Hello, sorry for the late response!

It sounds like you want 12 groups (the first 11 in separate groups, and the last 5 in the 12th group) :

sp = ProblemSpec({
  'names': [f"x{i}" for i in range(1,17)],  # Name of each parameter (remember, Python is end exclusive so we use 17, not 16)
  'groups': [f"x{i}" for i in range(1,12)] + ["VG_2", "VG_2", "VG_2", "VG_2", "VG_2"],
  'bounds': [[-np.pi, np.pi]]*16,  # bounds of each parameter
  'outputs': [f"Y{i}" for i in range(1,17)]  # name of outputs in expected order
})

sp.sample_sobol(2**6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant