scipy.stats.bayes_mvs(data, alpha=0.9)

Bayesian confidence intervals for the mean, var, and std.

Parameters :

data : array_like

Input data, if multi-dimensional it is flattened to 1-D by bayes_mvs. Requires 2 or more data points.

alpha : float, optional

Probability that the returned confidence interval contains the true parameter.

Returns :

Returns a 3 output arguments for each of mean, variance, and standard deviation. :

Each of the outputs is a pair:

(center, (lower, upper))

with center the mean of the conditional pdf of the value given the data and (lower, upper) is a confidence interval centered on the median, containing the estimate to a probability alpha.

mctr, (ma, mb) : :

Estimates for mean

vctr, (va, vb) : :

Estimates for variance

sctr, (sa, sb) : :

Estimates for standard deviation


Converts data to 1-D and assumes all data has the same mean and variance. Uses Jeffrey’s prior for variance and std.

Equivalent to tuple((x.mean(), x.interval(alpha)) for x in mvsdist(dat))


T.E. Oliphant, “A Bayesian perspective on estimating mean, variance, and standard-deviation from data”,, 2006.

Previous topic


Next topic


This Page