pymc3/step_methods/step_sizes.py
Killed 37 out of 64 mutantsSurvived
Survived mutation testing. These mutants show holes in your test suite.Mutant 82
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -23,7 +23,7 @@
self._log_step = np.log(initial_step)
self._log_bar = self._log_step
self._target = target
- self._hbar = 0.
+ self._hbar = 1.0
self._k = k
self._t0 = t0
self._count = 1
Mutant 86
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -26,7 +26,7 @@
self._hbar = 0.
self._k = k
self._t0 = t0
- self._count = 1
+ self._count = 2
self._mu = np.log(10 * initial_step)
self._gamma = gamma
self._tuned_stats = []
Mutant 88
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -27,7 +27,7 @@
self._k = k
self._t0 = t0
self._count = 1
- self._mu = np.log(10 * initial_step)
+ self._mu = np.log(11 * initial_step)
self._gamma = gamma
self._tuned_stats = []
Mutant 89
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -27,7 +27,7 @@
self._k = k
self._t0 = t0
self._count = 1
- self._mu = np.log(10 * initial_step)
+ self._mu = np.log(10 / initial_step)
self._gamma = gamma
self._tuned_stats = []
Mutant 93
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -38,7 +38,7 @@
return np.exp(self._log_bar)
def update(self, accept_stat, tune):
- if not tune:
+ if tune:
self._tuned_stats.append(accept_stat)
return
Mutant 95
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -43,7 +43,7 @@
return
count, k, t0 = self._count, self._k, self._t0
- w = 1. / (count + t0)
+ w = 2.0 / (count + t0)
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
Mutant 107
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -46,7 +46,7 @@
w = 1. / (count + t0)
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
- self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
+ self._log_step = self._mu - self._hbar / np.sqrt(count) / self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 108
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -46,7 +46,7 @@
w = 1. / (count + t0)
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
- self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
+ self._log_step = self._mu - self._hbar * np.sqrt(count) * self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 114
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -48,7 +48,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
- self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
+ self._log_bar = mk * self._log_step - (1 - mk) * self._log_bar
self._count += 1
def stats(self):
Mutant 119
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -49,7 +49,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
- self._count += 1
+ self._count = 1
def stats(self):
return {
Mutant 121
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -49,7 +49,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
- self._count += 1
+ self._count += 2
def stats(self):
return {
Mutant 127
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -63,7 +63,7 @@
target_accept = self._target
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
- n_bound = min(100, len(accept))
+ n_bound = min(101, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
Mutant 129
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept / n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 130
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept * n_bound, (2 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 131
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept * n_bound, (1 + mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 132
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) / n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 134
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good - 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 135
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good + 2, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 136
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good + 1, n_bad - 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 137
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good + 1, n_bad + 2).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 140
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -66,7 +66,7 @@
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
- if target_accept < lower or target_accept > upper:
+ if target_accept <= lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
'number of tuning steps.'
Mutant 141
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -66,7 +66,7 @@
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
- if target_accept < lower or target_accept > upper:
+ if target_accept < lower or target_accept >= upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
'number of tuning steps.'
Mutant 142
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -66,7 +66,7 @@
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
- if target_accept < lower or target_accept > upper:
+ if target_accept < lower and target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
'number of tuning steps.'
Suspicious
Mutants that made the test suite take longer, but otherwise seemed okMutant 110
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -47,7 +47,7 @@
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
- mk = count ** -k
+ mk = count * -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 111
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -47,7 +47,7 @@
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
- mk = count ** -k
+ mk = count ** +k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 115
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -48,7 +48,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
- self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
+ self._log_bar = mk * self._log_step + (2 - mk) * self._log_bar
self._count += 1
def stats(self):
Mutant 116
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -48,7 +48,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
- self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
+ self._log_bar = mk * self._log_step + (1 + mk) * self._log_bar
self._count += 1
def stats(self):