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<-9 > 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="")) + } 81 4 116.201 22.29 16.21 3.504 17.656 3.384 15.971 6.66 716.23 82 4 131.421 23.444 17.715 5.308 20.13 5.461 17.67 9.138 771.56 83 4 117.099 21.783 15.921 3.577 17.804 3.537 15.66 6.558 695.5 84 4 120.415 25.659 19.375 3.441 22.24 3.472 18.962 7.496 801.38 85 4 129.724 24.746 20.647 4.901 21.423 5.02 20.477 5.125 818.84 86 4 133.17 26.36 18.979 2.798 21.711 2.637 18.538 7.983 781.84 87 4 124.957 25.372 17.552 4.176 19.262 3.975 17.563 7.953 746.91 88 4 122.243 24.717 17.956 5.667 19.888 5.679 17.743 8.009 749.21 89 4 123.794 24.258 18.805 5.091 19.656 5.176 18.879 5.924 782.44 90 4 113.793 23.924 19.446 4.732 21.344 4.892 19.574 6.939 805.67 > > >