Hi, I’m trying to get the lasso prior to work on some simulated data and I’m getting the following error:
Error in ans[!test & ok] <- rep(no, length.out = length(ans))[!test & :
replacement has length zero
In addition: Warning message:
In rep(no, length.out = length(ans)) :
‘x’ is NULL so the result will be NULL
Any advice as to what is happening. When I run a simple stan_lm it works just fine.
library(rstanarm)
X = matrix(rnorm(500), nrow = 100)
Y = 3+X%*%c(1,2,3,0,0)+rnorm(100)
data = as.data.frame(cbind(Y,X))
model2 = stan_lm(V1~., data = data, prior = lasso(df = 1, location = 0.2, scale = NULL, autoscale = TRUE), adapt_delta= 0.99)