pymc3/step_methods/step_sizes.py

Killed 37 out of 64 mutants

Timeouts

Mutants that made the test suite take a lot longer so the tests were killed.

Mutant 268

--- 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 269

--- 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 273

--- 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 274

--- 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):

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 240

--- 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 244

--- 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 246

--- 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 247

--- 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 251

--- 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 253

--- 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 265

--- 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 266

--- 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 272

--- 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 277

--- 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 279

--- 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 285

--- 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 287

--- 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 288

--- 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 289

--- 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 290

--- 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 292

--- 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 293

--- 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 294

--- 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 295

--- 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 298

--- 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 299

--- 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 300

--- 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.'