Hello,
in small examples I'm trying to understand how to use Bayesian inference to take measurement uncertainty into account. I made this toy example for normally distributed measurements, where x and y both include a noise term:
http://rpubs.com/biocs/uncertainty
For each (x,y) point with associated sigma_x and sigma_y, I derive virtual points (xx, yy) on the regression line -- see code in the linked example -- which maximise the likelihood. This is possible because the PDF for the multivariate normal distribution can be analysed analytically. So when the sampling algorithm changes the slope or intercept, each measurement's uncertainty is taken into account using the maximum likelihood that can be associated with the measurement.
To account for outliers, I'd like to use a Student's t distribution as suggested in "Doing Bayesian Data Analysis". However, it looks like the PDF cannot be treated that easily. I was therefore wondering if there's another approach to this problem with STAN.
For example, could I call an external function to compute the virtual points with maximum likelihood numerically?
thanks, Michael