bambi/priors.py
Killed 230 out of 289 mutantsSurvived
Survived mutation testing. These mutants show holes in your test suite.Mutant 352
--- bambi/priors.py
+++ bambi/priors.py
@@ -29,7 +29,7 @@
"""
def __init__(self, name, prior, link, parent):
- self.name = name
+ self.name = None
self.prior = prior
self.link = link
self.parent = parent
Mutant 357
--- bambi/priors.py
+++ bambi/priors.py
@@ -35,7 +35,7 @@
self.parent = parent
fams = {
"bernoulli": genmod_families.Binomial,
- "gamma": genmod_families.Gamma,
+ "XXgammaXX": genmod_families.Gamma,
"gaussian": genmod_families.Gaussian,
"wald": genmod_families.InverseGaussian,
"negativebinomial": genmod_families.NegativeBinomial,
Mutant 359
--- bambi/priors.py
+++ bambi/priors.py
@@ -37,7 +37,7 @@
"bernoulli": genmod_families.Binomial,
"gamma": genmod_families.Gamma,
"gaussian": genmod_families.Gaussian,
- "wald": genmod_families.InverseGaussian,
+ "XXwaldXX": genmod_families.InverseGaussian,
"negativebinomial": genmod_families.NegativeBinomial,
"poisson": genmod_families.Poisson,
"t": None, # not implemented in statsmodels
Mutant 360
--- bambi/priors.py
+++ bambi/priors.py
@@ -38,7 +38,7 @@
"gamma": genmod_families.Gamma,
"gaussian": genmod_families.Gaussian,
"wald": genmod_families.InverseGaussian,
- "negativebinomial": genmod_families.NegativeBinomial,
+ "XXnegativebinomialXX": genmod_families.NegativeBinomial,
"poisson": genmod_families.Poisson,
"t": None, # not implemented in statsmodels
}
Mutant 362
--- bambi/priors.py
+++ bambi/priors.py
@@ -40,7 +40,7 @@
"wald": genmod_families.InverseGaussian,
"negativebinomial": genmod_families.NegativeBinomial,
"poisson": genmod_families.Poisson,
- "t": None, # not implemented in statsmodels
+ "XXtXX": None, # not implemented in statsmodels
}
self.smfamily = fams[name] if name in fams.keys() else None
Mutant 368
--- bambi/priors.py
+++ bambi/priors.py
@@ -59,7 +59,7 @@
def __init__(self, name, scale=None, **kwargs):
self.name = name
self._auto_scale = True
- self.scale = scale
+ self.scale = None
self.args = {}
self.update(**kwargs)
Mutant 410
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"XXnarrowXX": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 411
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 1.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 412
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 0.2, "XXmediumXX": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 413
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 0.2, "medium": 1.4, "wide": 3 ** -0.5, "superwide": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 415
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 0.2, "medium": 0.4, "wide": 4 ** -0.5, "superwide": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 417
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** +0.5, "superwide": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 419
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "XXsuperwideXX": 0.8}
def __init__(self, model, taylor):
self.model = model
Mutant 420
--- bambi/priors.py
+++ bambi/priors.py
@@ -188,7 +188,7 @@
class PriorScaler:
# Default is 'wide'. The wide prior sigma is sqrt(1/3) = .577 on the partial
# corr scale, which is the sigma of a flat prior over [-1,1].
- names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 0.8}
+ names = {"narrow": 0.2, "medium": 0.4, "wide": 3 ** -0.5, "superwide": 1.8}
def __init__(self, model, taylor):
self.model = model
Mutant 426
--- bambi/priors.py
+++ bambi/priors.py
@@ -201,7 +201,7 @@
}
)
self.priors = {}
- missing = "drop" if self.model.dropna else "none"
+ missing = "XXdropXX" if self.model.dropna else "none"
self.mle = GLM(
endog=self.model.y.data,
exog=self.dm,
Mutant 427
--- bambi/priors.py
+++ bambi/priors.py
@@ -201,7 +201,7 @@
}
)
self.priors = {}
- missing = "drop" if self.model.dropna else "none"
+ missing = "drop" if self.model.dropna else "XXnoneXX"
self.mle = GLM(
endog=self.model.y.data,
exog=self.dm,
Mutant 428
--- bambi/priors.py
+++ bambi/priors.py
@@ -201,7 +201,7 @@
}
)
self.priors = {}
- missing = "drop" if self.model.dropna else "none"
+ missing = None
self.mle = GLM(
endog=self.model.y.data,
exog=self.dm,
Mutant 433
--- bambi/priors.py
+++ bambi/priors.py
@@ -210,7 +210,7 @@
).fit()
self.taylor = taylor
with open(join(dirname(__file__), "config", "derivs.txt"), "r") as file:
- self.deriv = [next(file).strip("\n") for x in range(taylor + 1)]
+ self.deriv = [next(file).strip("XX\nXX") for x in range(taylor + 1)]
def _get_slope_stats(self, exog, predictor, sigma_corr, full_mod=None, points=4):
"""
Mutant 435
--- bambi/priors.py
+++ bambi/priors.py
@@ -210,7 +210,7 @@
).fit()
self.taylor = taylor
with open(join(dirname(__file__), "config", "derivs.txt"), "r") as file:
- self.deriv = [next(file).strip("\n") for x in range(taylor + 1)]
+ self.deriv = [next(file).strip("\n") for x in range(taylor + 2)]
def _get_slope_stats(self, exog, predictor, sigma_corr, full_mod=None, points=4):
"""
Mutant 437
--- bambi/priors.py
+++ bambi/priors.py
@@ -212,7 +212,7 @@
with open(join(dirname(__file__), "config", "derivs.txt"), "r") as file:
self.deriv = [next(file).strip("\n") for x in range(taylor + 1)]
- def _get_slope_stats(self, exog, predictor, sigma_corr, full_mod=None, points=4):
+ def _get_slope_stats(self, exog, predictor, sigma_corr, full_mod=None, points=5):
"""
Parameters
----------
Mutant 445
--- bambi/priors.py
+++ bambi/priors.py
@@ -235,7 +235,7 @@
i = [x for x in range(exog.shape[1]) if x not in keeps][0]
# get log-likelihood values from beta=0 to beta=MLE
- values = np.linspace(0.0, full_mod.params[i], points)
+ values = np.linspace(1.0, full_mod.params[i], points)
# if there are multiple predictors, use statsmodels to optimize the LL
if keeps:
null = [
Mutant 451
--- bambi/priors.py
+++ bambi/priors.py
@@ -251,7 +251,7 @@
# if just a single predictor, use statsmodels to evaluate the LL
else:
null = [
- self.model.family.smfamily().loglike(np.squeeze(self.model.y.data), val * predictor)
+ self.model.family.smfamily().loglike(np.squeeze(self.model.y.data), val / predictor)
for val in values[:-1]
]
log_likelihood = np.append(null, full_mod.llf)
Mutant 459
--- bambi/priors.py
+++ bambi/priors.py
@@ -261,7 +261,7 @@
# a: quartic coefficient, b: quadratic coefficient
intercept, shift_parameter = log_likelihood[-1], -(full_mod.params[i].item())
- X = np.array([(values + shift_parameter) ** 4, (values + shift_parameter) ** 2]).T
+ X = np.array([(values - shift_parameter) ** 4, (values + shift_parameter) ** 2]).T
coef_a, coef_b = np.squeeze(
np.linalg.multi_dot(
[np.linalg.inv(np.dot(X.T, X)), X.T, (log_likelihood[:, None] - intercept)]
Mutant 472
--- bambi/priors.py
+++ bambi/priors.py
@@ -271,7 +271,7 @@
# m, v: mean and variance of beta distribution of correlations
# p, q: corresponding shape parameters of beta distribution
mean = 0.5
- variance = sigma_corr ** 2 / 4
+ variance = sigma_corr ** 2 / 5
p = mean * (mean * (1 - mean) / variance - 1)
q = (1 - mean) * (mean * (1 - mean) / variance - 1)
Mutant 479
--- bambi/priors.py
+++ bambi/priors.py
@@ -272,7 +272,7 @@
# p, q: corresponding shape parameters of beta distribution
mean = 0.5
variance = sigma_corr ** 2 / 4
- p = mean * (mean * (1 - mean) / variance - 1)
+ p = mean * (mean * (1 - mean) / variance + 1)
q = (1 - mean) * (mean * (1 - mean) / variance - 1)
# function to return central moments of rescaled beta distribution
Mutant 489
--- bambi/priors.py
+++ bambi/priors.py
@@ -273,7 +273,7 @@
mean = 0.5
variance = sigma_corr ** 2 / 4
p = mean * (mean * (1 - mean) / variance - 1)
- q = (1 - mean) * (mean * (1 - mean) / variance - 1)
+ q = (1 - mean) * (mean * (1 - mean) / variance + 1)
# function to return central moments of rescaled beta distribution
def moment(k):
Mutant 503
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 15), 2 ** np.linspace(-1, 5, 13) / 100))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 504
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 14), 3 ** np.linspace(-1, 5, 13) / 100))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 505
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 14), 2 * np.linspace(-1, 5, 13) / 100))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 507
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 14), 2 ** np.linspace(-2, 5, 13) / 100))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 508
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 6, 13) / 100))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 509
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 14) / 100))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 511
--- bambi/priors.py
+++ bambi/priors.py
@@ -285,7 +285,7 @@
# do not exist at 0. Evaluating at a point very close to 0 (e.g., .001)
# generally gives good results, but the higher order the expansion, the
# further from 0 we need to evaluate the derivatives, or they blow up.
- point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 100))
+ point = dict(zip(range(1, 14), 2 ** np.linspace(-1, 5, 13) / 101))
vals = dict(a=coef_a, b=coef_b, n=len(self.model.y.data), r=point[self.taylor])
_deriv = [eval(x, globals(), vals) for x in self.deriv] # pylint: disable=eval-used
Mutant 521
--- bambi/priors.py
+++ bambi/priors.py
@@ -298,7 +298,7 @@
/ np.math.factorial(j)
* _deriv[i]
* _deriv[j]
- * (moment(i + j) - moment(i) * moment(j))
+ * (moment(i + j) + moment(i) * moment(j))
)
terms = [term(i, j) for i in range(1, self.taylor + 1) for j in range(1, self.taylor + 1)]
Mutant 532
--- bambi/priors.py
+++ bambi/priors.py
@@ -304,7 +304,7 @@
terms = [term(i, j) for i in range(1, self.taylor + 1) for j in range(1, self.taylor + 1)]
return np.array(terms).sum() ** 0.5
- def _get_intercept_stats(self, add_slopes=True):
+ def _get_intercept_stats(self, add_slopes=False):
# start with mean and variance of Y on the link scale
mod = GLM(
endog=self.model.y.data,
Mutant 533
--- bambi/priors.py
+++ bambi/priors.py
@@ -308,7 +308,7 @@
# start with mean and variance of Y on the link scale
mod = GLM(
endog=self.model.y.data,
- exog=np.repeat(1, len(self.model.y.data)),
+ exog=np.repeat(2, len(self.model.y.data)),
family=self.model.family.smfamily(),
missing="drop" if self.model.dropna else "none",
).fit()
Mutant 534
--- bambi/priors.py
+++ bambi/priors.py
@@ -310,7 +310,7 @@
endog=self.model.y.data,
exog=np.repeat(1, len(self.model.y.data)),
family=self.model.family.smfamily(),
- missing="drop" if self.model.dropna else "none",
+ missing="XXdropXX" if self.model.dropna else "none",
).fit()
mu = mod.params
# multiply SE by sqrt(N) to turn it into (approx.) sigma(Y) on link scale
Mutant 535
--- bambi/priors.py
+++ bambi/priors.py
@@ -310,7 +310,7 @@
endog=self.model.y.data,
exog=np.repeat(1, len(self.model.y.data)),
family=self.model.family.smfamily(),
- missing="drop" if self.model.dropna else "none",
+ missing="drop" if self.model.dropna else "XXnoneXX",
).fit()
mu = mod.params
# multiply SE by sqrt(N) to turn it into (approx.) sigma(Y) on link scale
Mutant 539
--- bambi/priors.py
+++ bambi/priors.py
@@ -314,7 +314,7 @@
).fit()
mu = mod.params
# multiply SE by sqrt(N) to turn it into (approx.) sigma(Y) on link scale
- sigma = (mod.cov_params()[0] * len(mod.mu)) ** 0.5
+ sigma = (mod.cov_params()[0] * len(mod.mu)) * 0.5
# modify mu and sigma based on means and sigmas of slope priors.
if len(self.model.fixed_terms) > 1 and add_slopes:
Mutant 540
--- bambi/priors.py
+++ bambi/priors.py
@@ -314,7 +314,7 @@
).fit()
mu = mod.params
# multiply SE by sqrt(N) to turn it into (approx.) sigma(Y) on link scale
- sigma = (mod.cov_params()[0] * len(mod.mu)) ** 0.5
+ sigma = (mod.cov_params()[0] * len(mod.mu)) ** 1.5
# modify mu and sigma based on means and sigmas of slope priors.
if len(self.model.fixed_terms) > 1 and add_slopes:
Mutant 543
--- bambi/priors.py
+++ bambi/priors.py
@@ -317,7 +317,7 @@
sigma = (mod.cov_params()[0] * len(mod.mu)) ** 0.5
# modify mu and sigma based on means and sigmas of slope priors.
- if len(self.model.fixed_terms) > 1 and add_slopes:
+ if len(self.model.fixed_terms) > 2 and add_slopes:
means = np.array([x["mu"] for x in self.priors.values()])
sigmas = np.array([x["sigma"] for x in self.priors.values()])
# add to intercept prior
Mutant 550
--- bambi/priors.py
+++ bambi/priors.py
@@ -322,7 +322,7 @@
sigmas = np.array([x["sigma"] for x in self.priors.values()])
# add to intercept prior
index = list(self.priors.keys())
- mu -= np.dot(means, self.stats["mean_x"][index])
+ mu = np.dot(means, self.stats["mean_x"][index])
sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
return mu, sigma
Mutant 551
--- bambi/priors.py
+++ bambi/priors.py
@@ -322,7 +322,7 @@
sigmas = np.array([x["sigma"] for x in self.priors.values()])
# add to intercept prior
index = list(self.priors.keys())
- mu -= np.dot(means, self.stats["mean_x"][index])
+ mu += np.dot(means, self.stats["mean_x"][index])
sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
return mu, sigma
Mutant 553
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma * 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
return mu, sigma
Mutant 554
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 3 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
return mu, sigma
Mutant 556
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 2 + np.dot(sigmas * 2, self.stats["mean_x"][index] ** 2)) ** 0.5
return mu, sigma
Mutant 557
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 2 + np.dot(sigmas ** 3, self.stats["mean_x"][index] ** 2)) ** 0.5
return mu, sigma
Mutant 559
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] * 2)) ** 0.5
return mu, sigma
Mutant 560
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 3)) ** 0.5
return mu, sigma
Mutant 561
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) * 0.5
return mu, sigma
Mutant 562
--- bambi/priors.py
+++ bambi/priors.py
@@ -323,7 +323,7 @@
# add to intercept prior
index = list(self.priors.keys())
mu -= np.dot(means, self.stats["mean_x"][index])
- sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 0.5
+ sigma = (sigma ** 2 + np.dot(sigmas ** 2, self.stats["mean_x"][index] ** 2)) ** 1.5
return mu, sigma
Mutant 571
--- bambi/priors.py
+++ bambi/priors.py
@@ -337,7 +337,7 @@
sigma = []
sigma_corr = term.prior.scale
for pred in term.data.T:
- mu += [0]
+ mu += [1]
sigma += [self._get_slope_stats(exog=self.dm, predictor=pred, sigma_corr=sigma_corr)]
# save and set prior
Mutant 586
--- bambi/priors.py
+++ bambi/priors.py
@@ -371,7 +371,7 @@
# handle intercepts and cell means
if term.constant:
_, sigma = self._get_intercept_stats()
- sigma *= sigma_corr
+ sigma = sigma_corr
# handle slopes
else:
exists = [
Mutant 587
--- bambi/priors.py
+++ bambi/priors.py
@@ -371,7 +371,7 @@
# handle intercepts and cell means
if term.constant:
_, sigma = self._get_intercept_stats()
- sigma *= sigma_corr
+ sigma /= sigma_corr
# handle slopes
else:
exists = [
Mutant 604
--- bambi/priors.py
+++ bambi/priors.py
@@ -405,7 +405,7 @@
else:
group = term.name.split("|")[1]
exog = self.model.random_terms.values()
- exog = [v.data.sum(1) for v in exog if v.name.split("|")[-1] == group]
+ exog = [v.data.sum(1) for v in exog if v.name.split("|")[+1] == group]
index = ["_" + str(i) for i in range(len(exog))]
exog = pd.DataFrame(exog, index=index).T
# this will replace self.mle (which is missing predictors)
Mutant 608
--- bambi/priors.py
+++ bambi/priors.py
@@ -406,7 +406,7 @@
group = term.name.split("|")[1]
exog = self.model.random_terms.values()
exog = [v.data.sum(1) for v in exog if v.name.split("|")[-1] == group]
- index = ["_" + str(i) for i in range(len(exog))]
+ index = ["XX_XX" + str(i) for i in range(len(exog))]
exog = pd.DataFrame(exog, index=index).T
# this will replace self.mle (which is missing predictors)
missing = "drop" if self.model.dropna else "none"
Mutant 612
--- bambi/priors.py
+++ bambi/priors.py
@@ -409,7 +409,7 @@
index = ["_" + str(i) for i in range(len(exog))]
exog = pd.DataFrame(exog, index=index).T
# this will replace self.mle (which is missing predictors)
- missing = "drop" if self.model.dropna else "none"
+ missing = "XXdropXX" if self.model.dropna else "none"
full_mod = GLM(
endog=self.model.y.data,
exog=exog,
Mutant 613
--- bambi/priors.py
+++ bambi/priors.py
@@ -409,7 +409,7 @@
index = ["_" + str(i) for i in range(len(exog))]
exog = pd.DataFrame(exog, index=index).T
# this will replace self.mle (which is missing predictors)
- missing = "drop" if self.model.dropna else "none"
+ missing = "drop" if self.model.dropna else "XXnoneXX"
full_mod = GLM(
endog=self.model.y.data,
exog=exog,
Mutant 614
--- bambi/priors.py
+++ bambi/priors.py
@@ -409,7 +409,7 @@
index = ["_" + str(i) for i in range(len(exog))]
exog = pd.DataFrame(exog, index=index).T
# this will replace self.mle (which is missing predictors)
- missing = "drop" if self.model.dropna else "none"
+ missing = None
full_mod = GLM(
endog=self.model.y.data,
exog=exog,