help with math in R
Need help to plot graphs:
Wt contains 1000 Iterators on how far one has walked the 100 steps. Mean and sd are the mean and standard deviation of those 1000. I am asked to create five graphs showing from the starting position to the end position after a hundred steps with time t on the x-axis and the status of the y-axis. t is 100.
Can someone explain and show how to plot graph like that?
Code for Wt:
Wt = NULL
for(i in 1:1000){
Xk = rnorm(100,mean=0.4,sd=0.7)
Wt[i]=su开发者_Go百科m(Xk)
}
mean(Wt)
sd(Wt)
matplot(replicate(5,cumsum(rnorm(100,mean=0.4,sd=0.7))),type="l")
精彩评论