search for: rwalk

Displaying 1 result from an estimated 1 matches for "rwalk".

Did you mean: walk
2009 Dec 04
1
cycling k times a realization of a random walk.....problems..
...realization on the same plot. IN OTHER WORDS I'D LIKE TO IMPOSE A LOOPING CYCLE TO THE COMMAND NOT THE ARGUMENT OF THE COMMAND. for some of these questions i have already a partial answer: my main problem here is automatizing the process for 100 times. my random walk generating function is: rwalk <- function(n,p, x0=0) ? ? ? ???{ ? ? ? ? ? x <- rbinom(n,1,p) ? ? ? ? ? x[which(x==0)] <- -1 ? ? ? ? ? y<-c(x0,x) ? ? ? ? ? y <- cumsum(y) ? ? ? ? ???} THIS IS THE CODE THAT I'D LIKE TO REITERATE a<- rwalk(n,p,x0=0) #whish to generate 100 of those #and for each calculate t...