User Name Remember Me? Password

 Math Software Math Software - Mathematica, Matlab, Calculators, Graphing Software

 March 12th, 2007, 03:04 PM #1 Newbie   Joined: Mar 2007 Posts: 2 Thanks: 0 Random Walks - Matlab Hi! (Not sure if this is the right forum but...) I need to create a program in Matlab that produces a random walk. Basically I'm investigating whether random walks can be used to model share prices; in my research I've found that there are two arguments for which distributions share prices follow (although I guess these may not always be true in practice). The possibilites are either a normal distribution or a t-distribution. So I need to produce 2 walks and in each I want the changes in the random walk (share price) to reflect the distribution of choice. Is this possible? I would be greatful for any help. Prior to this I've been using the following program to produce a random walk not based on these distributions; but I'm not sure how to move on... function y = randomwalk(x0,p,nsteps) y(1:nsteps) = 0; y(1) = x0; for istep = 2:nsteps y(istep) = y(istep-1) + step(p); end function y = step(p) y = 1; if ( rand() < 1-p ) y = -1; end %% Generate and plot a random walk x = randomwalk(0,0.5,10000); plot(x) Thanks!! Tags matlab, random, walks ,

,

### random walk in matlab

Click on a term to search for related topics.
 Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Similar Threads Thread Thread Starter Forum Replies Last Post Abhimint Math Software 0 January 26th, 2013 06:47 PM david188288 Advanced Statistics 0 January 7th, 2012 09:58 AM chalee New Users 7 January 3rd, 2010 11:05 PM Key-J Advanced Statistics 0 December 31st, 1969 04:00 PM Key-J Computer Science 0 December 31st, 1969 04:00 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top      