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<-3 > 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="")) + } 21 4 138.895 28.197 23.039 4.027 24.795 4.151 22.979 5.979 877.2 22 4 129.166 26.548 21.13 6.201 21.801 6.286 20.728 6.429 840.12 23 4 127.205 25.658 20.769 4.304 22.824 4.285 20.718 6.758 839.65 24 4 125.946 26.435 17.858 4.529 20.531 4.431 17.618 9.395 759.96 25 4 131.228 26.878 21.232 5.308 22.939 5.325 20.707 7.419 850.08 26 4 123.48 25.651 19.24 4.207 21.62 4.093 19.088 8.159 788.88 27 4 122.088 25.341 19.35 5.63 19.656 5.618 19.283 6.485 773.47 28 4 120.989 24.257 18.806 4.183 20.637 4.052 18.463 6.819 782.3 29 4 119.345 24.088 17.582 3.423 19.174 3.36 17.51 6.962 748.25 30 4 128.97 25.559 19.512 3.277 22.735 3.081 19.193 7.769 802.57 > > >