Hi, I am trying to write a Bayesian analysis stan code that analyse data with 3 nominal predictor and 1 metric predicted. I a interested in the interaction between predictor. Therefore, the linear model for this code is y = sumof(beta1 * x1) + sumof(beta2 * x2) + sumof(beta3 * x3) + sumof(b1b2 * x1 * x2) + sumof(b1b3 * x1 * x3) +sumof(b2b3 * x2 * x3).

The following is the file needed to run the model (Another file is attached in the following post):

Data.csv (168.5 KB)

Stan-Ymet-Xnom2fac-MrobustHet.R (13.1 KB)

Stan-Ymet-Xnom2fac-MrobustHet-Example.R (6.3 KB)

The Stan model is in Stan-Ymet-Xnom2fac-MrobustHet.R, You can ran the model by sourcing Stan-Ymet-Xnom2fac-MrobustHet-Example.R. I ran the model and it compile successfully, but the error occur during runtime. The problem is that it is rejecting initial value. Hope that you can reproduce the problem.

I have try setting other initial value by passing new value into sampling () function. It does not workâ€¦

Any suggestion that I can try? Thanks.