ums_flat_prior#
- agabpylib.posteriors.meanvarnormal.ums_flat_prior(n, xbar, V, mu, sigma)#
Calculate the joint posterior distribution for the unknown mean \(\mu\) and unknown standard deviation \(\sigma\) for a flat prior in both parameters.
The posterior is calculated over the input grid in \((\mu, \sigma)\) and for the data characterized by the number of samples i:math:n, the mean \(\bar{x}\), and the data variance \(V\).
- Parameters:
n (int) – The number of data points \(x_i\)
xbar (float) – The mean of the data points \(x_i\)
V (float) – The data variance \(\sum(x_i-\bar{x})^2/n\)
mu (float array) – 2D-array of \(\mu\) values (obtained through numpy.meshgrid for example)
sigma (float array) – 2D-array of \(\sigma\) values
- Returns:
lnP – The value of ln(posterior) at each grid point.
- Return type:
float array