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<-7 > 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="")) + } 61 4 120.918 24.626 19.673 5.875 20.319 5.979 19.689 6.412 790.67 62 4 123.632 28.224 22.558 4.389 24.305 4.474 22.546 7.933 867.96 63 4 130.444 28.437 22.996 6.06 23.356 6.118 22.69 6.278 858.48 64 4 124.576 27.091 22.161 5.312 23.853 5.474 22.074 6.017 872.82 65 4 126.405 24.902 17.633 4.876 19.491 4.771 17.767 7.446 745.98 66 4 114.525 21.846 15.846 4.325 17.295 4.389 15.855 7.284 702.8 67 4 123.833 22.813 16.995 3.885 18.208 3.797 17.04 6.411 718.87 68 4 124.148 25.213 18.472 4.705 21.092 4.661 18.032 9.057 769.3 69 4 121.604 23.655 18.157 4.993 20.066 4.98 17.997 7.195 754.59 70 4 123.733 24.114 18.817 4.79 19.788 4.912 18.55 7.19 774.7 > > >