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<-4 > 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="")) + } 31 4 133.315 25.704 20.444 4.339 21.3 4.325 20.336 6.005 812.57 32 4 117.776 24.431 19.498 6.202 20.22 6.232 19.375 6.179 788.62 33 4 127.402 27.409 18.833 3.369 22.251 3.228 18.564 9.429 784.04 34 4 136.436 28.9 22.386 4.387 25.037 4.329 21.996 7.852 863.04 35 4 130.142 26.203 18.713 3.691 21.779 3.6 18.06 9.103 779.84 36 4 123.231 26.844 22.699 4.415 24.089 4.443 22.429 5.295 877.68 37 4 125.187 23.435 16.436 5.483 17.353 5.61 16.349 8.529 711.18 38 4 129.562 26.237 18.91 3.991 21.363 3.938 18.202 8.75 785.04 39 4 130.596 25.388 18.233 4.381 19.959 4.346 18.05 7.989 777.74 40 4 128.409 24.402 16.591 3.638 18.74 3.532 16.394 8.289 726.93 > > >