tag:blogger.com,1999:blog-4890093519663715581.post3750336916072377324..comments2023-10-22T08:30:53.073-07:00Comments on Species In Space: Note: Parallelization not working with Maxent modelsDan Warrenhttp://www.blogger.com/profile/07528161395964087899noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4890093519663715581.post-65008616128266839812016-12-09T07:29:47.421-08:002016-12-09T07:29:47.421-08:00I did the identity.test with multiple cores using ...I did the identity.test with multiple cores using maxent type. We create a list with the occurrences for each core, so the replicates will be doing divided. Apparently it works, because the empirical value was the same for all replicates, I just need to calculate the p value again join all these matrices of replicates. <br />Here is the script that I used, if it help you:<br />list_sp1<-vector("list",11)<br />for(i in 1:11){<br />list_sp1[[i]]<-data.sp1<br />}<br />library(parallel)<br />cl1<- makeCluster(11)<br />clusterExport(cl1,c("list_sp1","data.sp2","variables"))<br />clusterEvalQ(cl1,library(ENMTools))<br />###ID test<br />res<-parLapply(cl1,list_sp1,function(i) identity.test(species.1 = i,species.2 = data.sp2, <br />env = variables, type = "mx", nreps = 9))<br />stopCluster(cl1)<br />###For calculate p value D:<br />obsD<-res[[1]]$reps.overlap[1,1]<br />reps_list_D<-vector("list",length(res))<br />for(i in 1:length(res)){<br />reps_list_D[[i]]<-res[[i]]$reps.overlap[-1,c(1)]<br />}<br />reps_D<-sort(unlist(reps_list_D))<br />replicate_D<-matrix(reps_D,nrow=length(reps_D),ncol=1,dimnames=list(c(1:length(reps_D)),c("D")),byrow = FALSE)<br />-1*(sum(replicate_D>=obsD)/(length(replicate_D)+1)-1)<br />###the same for for I indexAriellihttps://www.blogger.com/profile/12575392222360767060noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-47875593389339125152016-12-09T07:15:47.400-08:002016-12-09T07:15:47.400-08:00This comment has been removed by the author.Ariellihttps://www.blogger.com/profile/12575392222360767060noreply@blogger.com