"geom.graph.test" <- function(N=1000,prop=.1,quant.cut,quant.iso,verbose=TRUE) { Eall.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) EA.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) EB.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) pA.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) pB.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) pAB.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) rconn.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) mcoefALL.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) mcoefA.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) mcoefB.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) mspALL.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) mspA.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) mspB.mat <- matrix(nrow=length(quant.cut),ncol=length(quant.iso)) n <- 0 for(i in 1:length(quant.cut)) { Dist <- as.matrix(dist(cbind(runif(N),runif(N),runif(N)))) q1 <- quantile(as.numeric(Dist),quant.cut[i]) Dist[Dist>=q1] <- 0 Dist[Dist0] <- 1 rsums <- rowSums(Dist) Dist.old <- Dist for(j in 1:length(quant.iso)) { q2 <- quantile(rsums,quant.iso[j]) zero <- which(rsums<=q2) Dist[zero,] <- 0 Dist[,zero] <- 0 gpars <- calc.graph.pars.old(as.matrix.csr(Dist),as.character(1:N),1:N,as.integer(prop*N)) Dist <- Dist.old Eall.mat[i,j] <- gpars$Eall EA.mat[i,j] <- gpars$EA EB.mat[i,j] <- gpars$EB pA.mat[i,j] <- gpars$pA pB.mat[i,j] <- gpars$pB pAB.mat[i,j] <- gpars$pAB rconn.mat[i,j] <- gpars$rconn mcoefALL.mat[i,j] <- gpars$mcoefALL mcoefA.mat[i,j] <- gpars$mcoefA mcoefB.mat[i,j] <- gpars$mcoefB mspALL.mat[i,j] <- gpars$mspALL mspA.mat[i,j] <- gpars$mspA mspB.mat[i,j] <- gpars$mspB n <- n+1 if(verbose && !(n %% 10)) cat(paste(n," of ",length(quant.cut)*length(quant.iso),"\n",sep="")) } } result <- list(Eall.mat=Eall.mat,EA.mat=EA.mat,EB.mat=EB.mat,pA.mat=pA.mat,pB.mat=pB.mat,pAB.mat=pAB.mat,rconn.mat=rconn.mat,mcoefALL.mat=mcoefALL.mat,mcoefA.mat=mcoefA.mat,mcoefB.mat=mcoefB.mat,mspALL.mat=mspALL.mat,mspA.mat=mspA.mat,mspB.mat=mspB.mat) return(result) }