on-internet
← Community

simulating a random walk in matlab

Stack Overflow ·

i have variable x that undergoes a random walk according to the following rules: x(t+1)=x(t)-1; probability p=0.3 x(t+1)=x(t)-2; probability q=0.2 x(t+1)=x(t)+1; probability p=0.5 a) i have to create this variable initialized at zero and write a for loop for 100 steps and that runs 10000 times storing each final value in xfinal b) i have to plot a probability distribution of xfinal (a histogram) choosing a bin size and normalization!!* i have to report the mean and variance of xfinal c) i have to recreate the distribution by application of the central limit theorem and plot the probability dis

Comments

Sign in or sign up to comment and upvote.

No comments yet.