
Prezados, Estou com o seguinte problema .... Rodei um script para 10 e 15 simulações, e o meu programa rodou. Quando acrescento o numero de simulações a partir deste número, o R fecha ... O que devo fazer? Grata

Do que se trata o script? Em 22 de junho de 2012 08:57, Ana Lúcia Souza Silva Mateus <anawilson.ufam@gmail.com> escreveu:
Prezados,
Estou com o seguinte problema .... Rodei um script para 10 e 15 simulações, e o meu programa rodou. Quando acrescento o numero de simulações a partir deste número, o R fecha ... O que devo fazer?
Grata
_______________________________________________ R-br mailing list R-br@listas.c3sl.ufpr.br https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.
-- Grato Augusto C. A. Ribas Site Pessoal: http://augustoribas.heliohost.org Lattes: http://lattes.cnpq.br/7355685961127056

On 06/22/2012 09:57 AM, Ana Lúcia Souza Silva Mateus wrote:
Prezados,
Estou com o seguinte problema .... Rodei um script para 10 e 15 simulações, e o meu programa rodou. Quando acrescento o numero de simulações a partir deste número, o R fecha ... O que devo fazer?
Grata
Ana manda o script e parte da base de dados. Fica mais fácil ajudar ... []s Tura

por gentileza leia o posting guide da lista na página veja que é impossível alguem opinar com a descrição que voce fornece. On Fri, 22 Jun 2012, Ana Lúcia Souza Silva Mateus wrote:
Prezados,
Estou com o seguinte problema .... Rodei um script para 10 e 15 simulações, e o meu programa rodou. Quando acrescento o numero de simulações a partir deste número, o R fecha ... O que devo fazer?
Grata

Segue o script e os dados em anexo. event=Caso22 x <- c(0,6,6,0) y <- c(0,0,8,8) poly=cbind(x,y) s=seq(1,5,1) tm=seq(1,5,1) anaksenv<-function(event, poly, s, tm, nsim = 10){ # # This function implements monte-carlo simulations # to create and plot simulation envelopes to test # against the hypothesis of complete temporal randomness (CTR) # of an observed spatial-temporal point pattern. # It uses the spatial k-function and the cramer-vonMises measure of distance. # # OBS: You need splancs loaded # # Where: # - event: A 3xn matrix that contains the coordinates and times of the events # - poly: A polygon enclosing the points # - s: A vector of spatial distances for the analysis. # - tm: A vector of times for the analysis # - nsim: Number of monte-carlo simulations # # library(splancs) # # Starting values # x<-event[,1] y<-event[,2] t<-event[,3] maxx<-max(x) maxy<-max(y) minx<-min(x) miny<-min(y) lent<-length(x) pontos<-cbind(x,y) tl<-cbind(min(t),max(t)) # # Get the K-function for space and time of the observed point pattern # ksto <- stkhat(pts=pontos, times=t, poly=poly, tlimits=tl, s=s, tm=tm) ko <- ksto$ks # # Doing Monte-Carlo simulation under the CSR # hold<-matrix(0,nsim,length(s)) for(i in (1:nsim)) { tt<-floor(runif(lent,min(t),max(t))) xx<-floor(runif(lent,minx,maxx)) yy<-floor(runif(lent,miny,maxy)) pont<-cbind(xx,yy) tll<-cbind(min(tt),max(tt)) kstmc<-stkhat(pts=pont, times=tt, poly=poly, tlimits=tll, s=s, tm=tm) kko<-kstmc$ks hold[i,]<-kko } # up<- apply(hold,2,max) dow<- apply(hold,2,min) # # Creating plot # par(pty = "s") plot(s, up, type = "n", xlab = "Distância", ylab = "Função K espacial") lines(s, ko, col="blue") lines(s, up, lty=2, col="red") lines(s, dow,lty=2,col="red") } Desde já muito obrigada!!
participantes (4)
-
Ana Lúcia Souza Silva Mateus
-
Augusto Ribas
-
Bernardo Rangel Tura
-
Paulo Justiniano