rstanarm - error when running Bayesian model

253 Views Asked by At

EDIT - I have managed to resolve this. See my comment below

I am running a Bayesian regression in R using rstanarm using priors I have set, using the following code:

priors <- rstanarm::normal(location = c(-1, 0.5, 2), scale = c(1, 2, 0.5))

bmd <- stan_glm(s01_1 ~ pc + a03 + l01, data=bes19, prior = priors, iter=1000, seed=6942)

This outputs the following error, which I have no idea how to rectify:

  Exception: mismatch in dimension declared and found in context; processing stage=data initialization; variable name=prior_scale; position=0; dims declared=(19); dims found=(3)  (in '/data/hyperparameters.stan' at line 2; included from 'model_continuous' at line 56)

failed to create the sampler; sampling not done
Error in check_stanfit(stanfit) : 
  Invalid stanfit object produced please report bug

I would be grateful for any solutions, please. Thank you.

0

There are 0 best solutions below