SciPy

scipy.stats.bayes_mvs

scipy.stats.bayes_mvs(data, alpha=0.9)[source]

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:

mean_cntr, var_cntr, std_cntr : tuple

The three results are for the mean, variance and standard deviation, respectively. Each result is a tuple of the form:

(center, (lower, upper))

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

Notes

Each tuple of mean, variance, and standard deviation estimates represent the (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.

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

References

T.E. Oliphant, “A Bayesian perspective on estimating mean, variance, and standard-deviation from data”, http://hdl.handle.net/1877/438, 2006.