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<-2 > 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="")) + } 11 4 129.662 24.8 17.963 4.055 20.44 3.957 18.456 7.273 781.73 12 4 124.121 24.895 17.362 2.295 20.303 2.089 17.092 8.006 746.04 13 4 128.926 25.732 18.809 4.711 21.737 4.576 18.718 8.979 786.65 14 4 124.08 25.543 20.725 6.264 21.188 6.335 20.567 5.795 811.52 15 4 123.744 26.561 18.305 3.131 21.038 2.912 17.833 9.2 778.12 16 4 119.079 23.403 17.492 3.129 19.22 3.051 17.471 6.202 744.21 17 4 119.906 26.575 20.18 4.393 23.361 4.307 19.843 8.53 823.17 18 4 119.922 22.95 17.427 4.841 19.878 4.952 17.286 7.191 749.65 19 4 120.529 25.76 19.824 5.769 20.736 5.783 19.898 6.369 802.36 20 4 129.085 22.676 17.347 2.446 19.676 2.3 17.287 6.695 750.94 > > >