How to incorporate likelihood component in posterior estimation?

3 views (last 30 days)
Hi, I'm new to Matlab and as such I have a very basic question to ask about posterior estimation. In the Bayes Theorem, posterior distribution is proportional to the product of (a) Conditional probability of observing data conditional on parameters (i.e., likelihood function) and (b) Prior distribution of parameters. I understand the Prior part can be dealt with command line like " bayeslm(p,'ModelType','conjugate',..) ". However, I have difficulties how to incorporate likelihood function component. I tried something like " bayeslm(p,'ModelType','conjugate',..)*normpdf(y,mu,sigma) "; however, it didn't work. I appreciate any thoughts. Sorry to address a basic question like this.

Answers (1)

the cyclist
the cyclist on 18 Aug 2023
I am not experienced using these models, but based on the workflow described in this documentation, I think you just need to use the PriorMdl object (that is the output of bayeslm) as an input to the estimate function (along with the new data), to get the estimated posterior distribution. You don't need to "manually" calculate it via the likelihood function.

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!