lucero mariani
2009-Jun-06 17:50 UTC
[R] large numbers of observations using ME() of spdep
Dear All, We aim to remove the spatial structure of our data using Moran Eigen Vectors and spdep package . Our data has 3694 samples and 13 variables. The computer stop working after almost 4 days of processing (we found it emitting a sharp sound and with all colors on the screen. No wories, it was restared without problem!). And we are left with nothing: no result file was produced since the calculations were interrumpted! Consequently, I am looking for a way to accelerate calculations with ME() of spdep and to save the results step by step (for each eigen value). I came accross several promissing ideas: 1)make a compiled program in C and call it in R with the command system(); 2)use muliR. However, I do not know how to use these tools. I do not understand exactely why the calculations are so slow and I do know know how to write a program in C... I am using Ubuntu 9.04 and R version 2.8.1 . The code in R is a fallows: taimin.xy = taimin[c("dy", "dx")]; coordinates(taimin.xy) <- ~dy+dx; #dy, dx, name of the respective coordinate columns coords<-coordinates(taimin.xy); library(spdep); TaiminGabrielGraph<-gabrielneigh(coords, nnmult = 12); tai.gab.nb<-graph2nb(TaiminGabrielGraph,sym=TRUE); nbtaim_distsg <- nbdists(tai.gab.nb, coords); nbtaim_simsg <- lapply(nbtaim_distsg, function(x) (1-((x/(4*50))^2)) ); MEtaig.listw <- nb2listw(tai.gab.nb, glist=nbtaim_simsg, style="B"); sevmtaig <- ME(Presabs ~Age+Curv+Zon2005+ZoneMeiji+Wi+Sol+Slope+Seadist+Elev+Basin,data=taimin, family=binomial,listw=MEtaig.listw) Any help is welcome! Thanks Lucero Mariani, Yokohama National University, Japan.
Emmanuel Charpentier
2009-Jun-06 22:03 UTC
[R] large numbers of observations using ME() of spdep
Le dimanche 07 juin 2009 ? 02:50 +0900, lucero mariani a ?crit :> Dear All, > We aim to remove the spatial structure of our data using Moran Eigen > Vectors and spdep package . Our data has 3694 samples and 13 > variables. > The computer stop working after almost 4 days of processing (we found > it emitting a sharp sound and with all colors on the screen. No > wories, it was restared without problem!).Cool ! Farm it out to a night club (and get a real computer with the proceedings). Sorry. Couldn't resist ! And twice sorry to be unable to help with your *real* problem... Emmanuel Charpentier> And we are left with > nothing: no result file was produced since the calculations were > interrumpted! > Consequently, I am looking for a way to accelerate calculations with > ME() of spdep and to save the results step by step (for each eigen > value). > I came accross several promissing ideas: 1)make a compiled program in > C and call it in R with the command system(); 2)use muliR. However, I > do not know how to use these tools. I do not understand exactely why > the calculations are so slow and I do know know how to write a program > in C... > I am using Ubuntu 9.04 and R version 2.8.1 . > > The code in R is a fallows: > taimin.xy = taimin[c("dy", "dx")]; > coordinates(taimin.xy) <- ~dy+dx; #dy, dx, name of the respective > coordinate columns > coords<-coordinates(taimin.xy); > library(spdep); > TaiminGabrielGraph<-gabrielneigh(coords, nnmult = 12); > tai.gab.nb<-graph2nb(TaiminGabrielGraph,sym=TRUE); > nbtaim_distsg <- nbdists(tai.gab.nb, coords); > nbtaim_simsg <- lapply(nbtaim_distsg, function(x) (1-((x/(4*50))^2)) ); > MEtaig.listw <- nb2listw(tai.gab.nb, glist=nbtaim_simsg, style="B"); > sevmtaig <- ME(Presabs > ~Age+Curv+Zon2005+ZoneMeiji+Wi+Sol+Slope+Seadist+Elev+Basin,data=taimin, > family=binomial,listw=MEtaig.listw) > > Any help is welcome! > > Thanks > > Lucero Mariani, Yokohama National University, Japan. >