1blinregexpected=function(X1,theta.sample) 2{ 3#blinregpred Produces a simulated sample from the posterior 4# distribution of an expected response for a linear regression model 5# X1 = design matrix of interest 6# theta.sample = output of blinreg function 7 8d=dim(X1) 9n1=d[1] 10m=length(theta.sample$sigma) 11m1=array(0,c(m,n1)) 12 13for (j in 1:n1) 14{ 15m1[,j]=t(X1[j,]%*%t(theta.sample$beta)) 16} 17return(m1) 18} 19 20 21 22 23 24 25