Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions POLYTEST/POLYTEST.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Input YAML configurations for SMEFiT code

result_ID: POLYTEST
# absolute path where results are stored
result_path: ./

# path to common data
data_path: /home/tentori/SMEFIT/smefit_database/Polymode_tests/Polynomial_test

# path to theory tables, default same as data path
theory_path: /home/tentori/SMEFIT/smefit_database/Polymode_tests/Polynomial_test

# pQCD order (LO or NLO)
order: LO

use_theory_covmat: False

use_t0: True

poly_mode: True
external_coefficients:
b: a**4
# SMEFT Expansion Order
use_quad: False

# Set parameter bounds to previous SCAN result
bounds: Null

# NS settings
nlive: 500
lepsilon: 0.01
target_evidence_unc: 0.01
target_post_unc: 0.01
frac_remain: 0.01
store_raw: false

# Datasets to include
datasets:

- poly




# Coefficients to fit
coefficients:

## TOP COEFFICIENTS ##
a: { 'min': 0., 'max': 3.5 }
c: { 'min': 0., 'max': 3 }




rot_to_fit_basis: null

1 change: 1 addition & 0 deletions POLYTEST/posterior.json

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions Polymode_tests/Polynomial_test/POLYTEST/POLYTEST.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Input YAML configurations for SMEFiT code

result_ID: POLYTEST
# absolute path where results are stored
result_path: ./

# path to common data
data_path: /home/tentori/SMEFIT/smefit_release/Polymode_tests/Polynomial_test

# path to theory tables, default same as data path
theory_path: /home/tentori/SMEFIT/smefit_release/Polymode_tests/Polynomial_test

# pQCD order (LO or NLO)
order: LO

use_theory_covmat: False

use_t0: True

poly_mode: True
external_coefficients:
b: a**4
# SMEFT Expansion Order
use_quad: False

# Set parameter bounds to previous SCAN result
bounds: Null

# NS settings
nlive: 500
lepsilon: 0.1
target_evidence_unc: 0.1
target_post_unc: 0.1
frac_remain: 0.1
store_raw: false

# Datasets to include
datasets:

- poly




# Coefficients to fit
coefficients:

## TOP COEFFICIENTS ##
a: { 'min': 0., 'max': 3.5 }
c: { 'min': 0., 'max': 3 }




rot_to_fit_basis: null

1 change: 1 addition & 0 deletions Polymode_tests/Polynomial_test/POLYTEST/posterior.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/smefit/analyze/chi2_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Chi2tableCalculator:
"""

def __init__(self, data_info):

self.data_info = data_info
self.chi2_df_sm = pd.DataFrame()
self.chi2_df_sm_grouped = pd.DataFrame()
Expand Down Expand Up @@ -64,6 +65,7 @@ def compute(datasets, smeft_predictions):
# Compute per experiment
cnt = 0
for ndat_exp in datasets.NdataExp:

chi2.append(
np.dot(
diff[cnt : cnt + ndat_exp],
Expand Down Expand Up @@ -91,9 +93,6 @@ def compute(datasets, smeft_predictions):
)
cnt += ndat_exp

# compute chi2 for the whole dataset
total_chi2_rep = np.einsum("ij,ji->i", diff_rep, covmat_diff_rep)

return (
pd.DataFrame(
{
Expand All @@ -104,7 +103,7 @@ def compute(datasets, smeft_predictions):
},
index=datasets.ExpNames,
),
total_chi2_rep / datasets.Commondata.size,
np.sum(chi2_rep, axis=0) / datasets.Commondata.size,
)

@staticmethod
Expand Down Expand Up @@ -369,7 +368,7 @@ def plot_dist(self, chi2_hist, fig_name, figsize=(7, 5)):
plt.figure(figsize=figsize)
ax = plt.subplot(111)

for label, chi2_list in chi2_hist.items():
for (label, chi2_list) in chi2_hist.items():
ax.hist(
chi2_list,
bins="fd",
Expand Down
Loading
Loading