Closed emmaleeberry closed 2 years ago
modelprior should not be a string, but a function - e.g. should be one of modelprior = uniform()
Add a warning message if a string is given for modelprior
; note a future enhancement is to convert the argument for priors
to be objects like in bas.glm
Added error message of modelprior is not of class 'prior' in bas.lm
and bas.glm
to catch this
Describe the bug function "bas.lm" can't work with error message "Error: $ operator is invalid for atomic vectors".
To Reproduce
`x<- mvtnorm::rmvnorm(100, mean=rep(0,9), sigma=diag(9)) b <- c(2,2,2,0.2,0.2,0.2,0,0,0) y <- x%*%b + rnorm(100, mean=0, sd=1) test <- cbind(x,y) test <- as.data.frame(test)
bas.out<-bas.lm(V10~V1+V2+V3+V4+V5+V6+V7+V8+V9, data=test, method="MCMC", MCMC.iterations=20000, prior="hyper-g", modelprior = "uniform", pivot = FALSE)`
Expected behavior Have the function "bas.lm" run with clear instruction on the input data format.
Screenshots
Desktop: