Skip to content

Commit edd0d5b

Browse files
store the weight with the model
1 parent d8b1104 commit edd0d5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

smodels/statistics/simplifiedLikelihoods.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from smodels.statistics.basicStats import observed, apriori, aposteriori, NllEvalType
1818
from typing import Text, Optional, Union, Tuple
1919
from smodels.statistics.basicStats import findRoot
20+
from smodels.tools.caching import roundCache, lru_cache
2021

2122
import numpy as np
2223
import math
@@ -100,6 +101,7 @@ def __init__(
100101
self.name = name
101102
self.deltas_rel = deltas_rel
102103
self._computeABC()
104+
self.weight = np.linalg.inv(self.V )
103105

104106
def generateAsimovData ( self, theta_hat : list, mu : float = 0. ):
105107
""" generate a model with Asimov data out of the current model
@@ -743,7 +745,7 @@ def findThetaHat(self, mu : float ):
743745
# if not model.isLinear():
744746
# self.cov_tot = model.V + model.var_s(nsig)
745747
# self.cov_tot = model.totalCovariance (nsig)
746-
self.weight = np.linalg.inv(self.cov_tot)
748+
self.weight = model.weight # np.linalg.inv(self.cov_tot)
747749
# self.coeff = 1.
748750

749751
## to catch slogdet warnings on Mac, numpy 2.3.2

0 commit comments

Comments
 (0)