R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(coda) Loading required package: lattice > > S<-11000 ; burn<-1000 ; odens<-1 > > R0<-4 > KS<-6 > seeds<- 1:10 + (KS-1)*10 > MS<-NULL > > for(seed in seeds) + { + set.seed(seed) + source("datagen.r") # generate data + for(R in 4:4) # for each presumed rank + { + source("ibayes.r") + mse<-c(mean(Y^2), # size of matrix + mean((Y-M0)^2), # MSE of Y + mean((Y-M.ps/nss)^2) , # RSS of mean + mean((M0-M.ps/nss)^2), # MSE of of mean + mean((Y-M.mode)^2) , # RSS of mode + mean((M0-M.mode)^2), # MSE of mode + mean((Y-M.ols)^2), # RSS of ols + mean((M0-M.ols)^2)) # MSE of ols + cat(seed,R,round(100*mse,3)," ",round(DIC,2),"\n") + MS<-rbind(MS,c(seed,R,mse,DIC,eSS)) + } + dput(MS,paste("ibayes.SS",KS,".R0",R0,".results",sep="")) + } 51 4 117.375 25.659 20.415 5.508 21.232 5.513 19.928 5.975 819.18 52 4 131.277 26.719 21.231 4.662 22.938 4.874 21.425 8.242 847.58 53 4 116.214 22.154 16.079 2.326 18.71 2.257 15.586 7.235 699.72 54 4 124.548 21.263 15.282 3.511 17.548 3.441 14.914 7.268 679.6 55 4 129.702 28.455 22.698 5.953 23.047 5.969 22.403 6.654 853.82 56 4 122.954 23.737 19.46 3.698 20.614 3.75 19.196 5.479 791.9 57 4 121.749 23.431 16.708 2.95 19.163 2.807 16.245 7.427 723.71 58 4 130.181 25.862 18.754 4.097 21.244 4.146 18.395 9.619 775.01 59 4 126.539 24.208 18.849 3.141 20.804 3.143 18.379 6.974 782.52 60 4 119.885 24.188 19.758 5.131 20.164 5.168 19.555 5.285 786.75 > > >