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<-8 > 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="")) + } 71 4 135.74 28.452 20.524 6.754 21.82 6.8 20.579 9.671 819.5 72 4 119.299 25.14 17.658 3.666 20.795 3.453 17.045 9.158 754.65 73 4 133.218 25.659 18.11 5.243 20.941 5.207 18.015 8.855 782.31 74 4 130.583 25.318 18.901 3.755 20.188 3.685 18.857 6.995 781.53 75 4 121.804 28.071 20.465 4.148 23.386 4.208 20.62 9.211 838.57 76 4 122.227 23.358 16.637 3.578 18.526 3.565 16.677 7.856 727.78 77 4 124.048 21.832 17.146 4.52 17.991 4.515 17.026 5.304 731.41 78 4 125.408 25.074 19.617 4.703 22.374 4.786 19.611 7.944 805.43 79 4 122.586 23.736 18.014 1.875 20.616 1.813 17.158 7.517 749.63 80 4 115.149 23.845 16.999 3.456 19.061 3.335 16.478 7.881 737.7 > > >