This is my first time doing a Bayesian analysis, so I'm not sure whether what I did makes perfect sense. I'm trying to tell if two samples come from the same distribution, more specifically, if they have the same mean.
I have very few samples, and no subjective beliefs about them. I am modelling the observed distribution as a Gaussian. Using pyMC:
import pymc as pm sample1 = [8.254828927, 8.485694524,10.58058423,5.221356325] sample2 = [7.921107724, 9.744301571, 5.750874082,8.421883012,11.09813068] sample_mean = sum(sample1+sample2) #Empirical prior for the mean normal_mean_prior = pm.Normal("mean_prior", mu = sample_mean, tau = 1) #Uninformative prior for the precision normal_precision_prior = pm.Uniform("precision_prior", lower = 0, upper = 100) #Normal observation normal_observation_sample1 = pm.Normal("normal1", mu = normal_mean_prior, tau = normal_precision_prior, observed = True, value = sample1) normal_observation_sample2 = pm.Normal("normal2", mu = normal_mean_prior, tau = normal_precision_prior, observed = True, value = sample2)
With this model, I would sample it using MCMC and check if the posterior distribution of the means are different or the same.
Is my analysis correct? Have I made any significant blunder? Thank you.