Skip to content

Instantly share code, notes, and snippets.

@CnrLwlss
Created July 29, 2021 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CnrLwlss/8cf45c43630e5c381ee89baa368133a1 to your computer and use it in GitHub Desktop.
Save CnrLwlss/8cf45c43630e5c381ee89baa368133a1 to your computer and use it in GitHub Desktop.
Visual representation of difference between stochastic process and samples from random distribution
N=10000
noise = rnorm(N,mean=0,sd=0.5)
random_walk=cumsum(noise)
ylim = range(random_walk)
op = par(mfrow=c(1,2))
plot(noise,type="l",ylim=ylim,xlab="time",cex.lab=1.75,cex.axis=1.75)
plot(random_walk,type="l",ylim=ylim,xlab="time",cex.lab=1.75,cex.axis=1.75)
par(op)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment