Thank you for putting the brms package together. I am using it for doing some analysis with measurement error in covariates. Do you have the exact parameterization of the measurement error model? From looking at the stan code, it looks like
x_{observed} \sim \text{Normal}(x_{true}, \sigma_{observed})
from this line in the stan code produced by brm()
target += normal_lpdf(Xn_1 | Xme_1, noise_1);
is that right?
Here’s a reproducible example
library(brms)
b0<-5; b1=2
x<- rnorm(30, mean = 20, sd=5)
xerr<-abs(rnorm(30, x*-.05, 2))
y<-rpois(30, b0+b1*x)
dat<-data.frame(y, x, xerr)
test<-brm(y~me(x, xerr) , dat, family = "poisson")
Thank you for all your help,
Corey Sparks
Please also provide the following information in addition to your question:
- Operating System: Windows 10
- brms Version:2.4.0