Skip to content

Commit 5c8d12e

Browse files
JWarmenhoventwiecki
authored andcommitted
use scipy.stats.mode as a point_estimate in plot_posterior() (#1243)
1 parent a81390e commit 5c8d12e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc3/plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import numpy as np
2-
from scipy.stats import kde
2+
from scipy.stats import kde, mode
33
from .stats import *
44
from numpy.linalg import LinAlgError
55
import matplotlib.pyplot as plt
@@ -671,7 +671,7 @@ def display_point_estimate():
671671
point_value = trace_values.mean()
672672
point_text = '{}={}'.format(point_estimate, point_value.round(round_to))
673673
elif point_estimate == 'mode':
674-
point_value = stats.mode(trace_values.round(round_to))[0][0]
674+
point_value = mode(trace_values.round(round_to))[0][0]
675675
point_text = '{}={}'.format(point_estimate, point_value.round(round_to))
676676
elif point_estimate == 'median':
677677
point_value = np.median(trace_values)

0 commit comments

Comments
 (0)