Created
February 13, 2021 15:54
-
-
Save CnrLwlss/993e0115f672f0a54ba7cf6be2cfe69c to your computer and use it in GitHub Desktop.
Plotting random walks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = 10000 | |
Ncurve = 1000 | |
png("Walk.png",width=3000,height=1000,pointsize=12,type="cairo-png") | |
plot(NULL,ylim=c(-200,200),axes=FALSE,xlim=c(N/2,N),xlab="",ylab="") | |
for(i in 1:Ncurve) points(cumsum(rnorm(N,0,0.5)),type="l",col=rgb(0,0,0,0.1),lwd=2) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment