Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
willu47 committed Mar 4, 2019
2 parents 53ce281 + 5076e4e commit dfb1f30
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/SALib/analyze/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,20 @@ def analyze(problem, X, Y, num_resamples=10,
if print_to_console:
print("Parameter %s %s %s %s" % keys)

for i in range(D):
S['delta'][i], S['delta_conf'][i] = bias_reduced_delta(
Y, Ygrid, X[:, i], m, num_resamples, conf_level)
S['S1'][i] = sobol_first(Y, X[:, i], m)
S['S1_conf'][i] = sobol_first_conf(
Y, X[:, i], m, num_resamples, conf_level)
if print_to_console:
print("%s %f %f %f %f" % (problem['names'][i], S['delta'][
i], S['delta_conf'][i], S['S1'][i], S['S1_conf'][i]))
try:
for i in range(D):
S['delta'][i], S['delta_conf'][i] = bias_reduced_delta(
Y, Ygrid, X[:, i], m, num_resamples, conf_level)
S['S1'][i] = sobol_first(Y, X[:, i], m)
S['S1_conf'][i] = sobol_first_conf(
Y, X[:, i], m, num_resamples, conf_level)
if print_to_console:
print("%s %f %f %f %f" % (problem['names'][i], S['delta'][
i], S['delta_conf'][i], S['S1'][i], S['S1_conf'][i]))
except np.linalg.LinAlgError as e:
msg = "Singular matrix detected\n\
Sample size of {} may be too small".format(Y.size)
raise np.linalg.LinAlgError(msg)

return S

Expand Down

0 comments on commit dfb1f30

Please sign in to comment.