Bayesian Deming regression (with heteroscedastic error structure)
The package rstanbdp has been uploaded today to GitHub. The software is a proposal for a general Bayesian Deming regression method. The basic idea is to model the residuals not only in an homoscedastic manner. In fact a model for linear growing error is here proposed.
The package uses a T-distributed likelihood function with adjustable df. Thus it is also possible to make the regression robust by lowering the df from N-2 down to df=1 which corresponds to Cauchy distributed residuals.
Priors are honestly ignorant, not totally ignorant, respecting the guidelines of Stan/RStan. Adjusting the priors parameter is possible.
In the image above a synthetic heteroscedastic data set was investigated both with the homoscedastic and with the heteroscedastic model with linear growing sigma. For the heteroscedastic model the residuals were divided by the point wise estimated sigma.
Here below the resulting regression plot.
The plot with the complete 2D sampled distribution of slopes and intercepts is also available. HDI-CI are calculated and plotted together with the MD probability.
The method seems promising, especially for low precision data (2-3 digits precision) and for small data sets in general.
(The development of this very immature software is not supported by anyone. It is work done in free time…)