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

Is delta output symmetric? #618

Open
jaimsierra opened this issue May 3, 2024 · 4 comments
Open

Is delta output symmetric? #618

jaimsierra opened this issue May 3, 2024 · 4 comments

Comments

@jaimsierra
Copy link

Hi,

I'm using the Delta Moment-Independent Analysis with given data, checking a pair of variables at a time (a dependent one vs an independent one). Given this, and according to Plischke et al. (2013)**, who shows that delta is symmetric ( δ(Y,X) = δ(X,Y) ), I understood I should get same results for two combinations of, lets call them, var_a and var_b. I don't know if I am interpreting it well or not understanding anything, but trying to apply it I get significantly different results: δ(var_a,var_b)=0.313, δ(var_b,var_a)=0.703.

I am using the following function:
out=SALib.analyze.delta.analyze(problem,x,y,method='delta',conf_level=0.95,seed=92)

where x and y are both numpy.ndarray.

Do you have any idea why? Thanks for your help!

** Plischke, E., E. Borgonovo, and C. L. Smith (2013). “Global sensitivity measures from given data.” European Journal of Operational Research, 226(3):536-550, doi:10.1016/j.ejor.2012.11.047.

@ConnectedSystems
Copy link
Member

Hello, thanks for the question @jaimsierra

Could you share what we call an MWE (Minimum Working Example)?

Some example code and data that we can use to reproduce the issue you're seeing?

It is hard to comment without being able to see exactly what you are doing.

That said:

I dont have access to the paper right now, but I wonder if X and Y are meant to be model inputs and outputs?

e.g., δ(Y, [var_a, var_b]) = δ([var_a, var_b], Y)

@jaimsierra
Copy link
Author

jaimsierra commented May 3, 2024

Sure, thanks @ConnectedSystems:


##########################
#First check

y=df['var_a'].values
x=df['var_b'].values.reshape(-1, 1)

problem = {
    'num_vars': 1,
    'names': 'var_b',
               }

out1=SALib.analyze.delta.analyze(problem,x,y,method='delta',conf_level=0.95,seed=92)

print(out1)

##########################
#Second check

y=df['var_b'].values
x=df['var_a'].values.reshape(-1, 1)

problem = {
    'num_vars': 1,
    'names': 'var_a',
               }

out2=SALib.analyze.delta.analyze(problem,x,y,method='delta',conf_level=0.95,seed=92)

print(out2)```

@ConnectedSystems
Copy link
Member

In this example are x and y variables to use as input to a model?
Or is only x an input, and y the model output?

Also, wrap your example with triple backticks (```) to format your code, like so:

```
some code
```

Otherwise it will not be formatted correctly

@jaimsierra
Copy link
Author

Thanks @ConnectedSystems, changed!

In the example, x and y are variables to use as input to a model in a latter stage and, according to the property I was referring to, mutually exchangeable as inputs. I'm trying to use the property to find out the level of dependence between variables (as δ(X,Y)=0 means X and Y are independent).

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

2 participants