How to Make a Bayesian Inference with a Bivariate Prior and a Univariate Likelihood

6 views (last 30 days)
I'm trying to model a recursive Bayesian estimation, where my prior is a bivaraite Gaussian distribution and my likelihood a univariate Gaussian. I had some questions about the best way to create and combine my probability distributions.
I'm coding my bivariate prior as follows:
x1=[0:.1:6];
x2=[0:.1:6];
[X,Y] = meshgrid(x1,x2);
prior = mvnpdf([X(:) Y(:)],[3,3],[1 0;0 1]);
prior = reshape(prior,length(x1),length(x2));
And my univariate likelihood as:
x=[0:.1:6];
likelihood = normpdf(x,1,1);
I'm not quite sure how to multiply these for a correct Bayesian update. Should I multiply my likelihood pdf vector with a particular dimension of the prior pdf matrix? My prior represents the association of two stimuli with a reinforcement, and my likelihood can represent the probability of occurrence of the reinforcement in the presence of both stimuli, neither stimuli, or either stimuli.
Would it easier if I model my probability distributions by creating objects with "makedist" and "gmdistribution"?
Thank you!!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!