Simulates posterior observations for map
and map2stan
model fits.
sim.train.test( N=20 , k=3 , rho=c(0.15,-0.4) , b_sigma=100 ,
DIC=FALSE , WAIC=FALSE, devbar=FALSE , devbarout=FALSE )
Number of cases in simulated data
Number of parameters in model to fit to data
Vector of correlations between predictors and outcome, in simulated data
Standard deviation of beta-coefficient priors
If TRUE
, returns DIC
If TRUE
, returns WAIC
If TRUE
, returns the average deviance in-sample
If TRUE
, returns average deviance out-of-sample
This function simulates Gaussian data and then fits linear regression models to it, returning the deviance of the fit (training, in-sample) and the deviance on a new sample, computed using the MAP estimates from the training sample.