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<-5 > 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="")) + } 41 4 121.285 21.884 16.581 3.477 19.108 4.039 16.258 7.123 737.97 42 4 119.238 24.544 18.479 6.18 19.108 6.197 18.558 7.329 763.18 43 4 127.001 26.865 21.086 6.161 23.197 6.314 20.597 7.409 831.13 44 4 127.57 25.494 19.136 3.228 21.537 3.026 18.831 6.885 800.24 45 4 119.219 23.763 16.542 5.155 17.374 5.209 16.533 8.299 713.09 46 4 127.78 23.858 17.588 4.815 19.167 4.835 17.83 7.311 762.61 47 4 119.162 21.182 16.77 3.576 17.935 3.517 16.797 4.962 731.17 48 4 122.61 22.852 17.887 3.216 20.132 2.997 17.658 5.963 758.88 49 4 129.287 27.412 21.685 5.608 23.639 5.467 21.134 6.712 856.01 50 4 119.594 24.826 18.535 3.324 21.022 3.305 18.218 8.232 779.15 > > >