4.0

4.0 | 1 rating Rate this file 53 Downloads (last 30 days) File Size: 1.69 MB File ID: #22003
image thumbnail

Random Walks in MATLAB

by Mark Hoyle

 

05 Nov 2008 (Updated 07 Jan 2009)

Files which simulate random walks on a lattice and on a graph

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

These files show how MATLAB can be used to simulate random walks both on a lattice in N-dimensions and on a graph. The zip file contains the following:

RandDir: generates a random basis vector on a lattice
RandGraphMove: Given a connection matrix for a graph generates a random neighbouring node to the one currently occupied
RandomWalks: script file to demonstrate the use of these files using the SDE engine in the econometrics toolbox
RandomWalks_NoEconometrics: Version of the preivous file which does no rely on the econometrics toolbox
DemoData.mat: Mat file for graph example
Demo_Image.gif: Image file for graph example.

The files RandDir and RandGraphMove generate random motions for a random walk on a lattive and on a graph respectively. The Files RandomWalks and RandomWalks_NoEconometrics run through a series of examples firstly going through random walks in 1, 2 and 3 dimensions and then performing a random walk on the London Underground.

The file RandomWalks uses the SDE engine in the Econometrics toolbox to perfrom the random walks, whereas RandomWalks_NoEconometrics uses for loops instead. I've foudn the version using the econometrics toolbox to be faster.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
22 Apr 2010 SHARAN KANIKE  
27 Jul 2010 Kaybe Loughran

Hey this is really cool. One question, though. I'm trying to use the same principle on a different transportation system. What do the different parts of the DemoData represent?

Please login to add a comment or rating.
Updates
07 Jan 2009

Now includes the main script published to html.

07 Jan 2009

Corrected image file

Tag Activity for this File
Tag Applied By Date/Time
graph Cristina McIntire 05 Nov 2008 12:51:20
lattice Cristina McIntire 05 Nov 2008 12:51:25
econometricsgarchsderandommathematics Mark Hoyle 05 Nov 2008 12:51:40
graph Mark Hoyle 13 Jan 2009 11:12:16
lattice Mark Hoyle 13 Jan 2009 11:12:18
graph Bailiang 15 Jan 2009 10:57:08
potw Shari Freedman 20 Apr 2009 12:55:14
graph Elvin 04 Sep 2009 04:56:56
lattice Elvin 04 Sep 2009 04:57:00
potw Elvin 04 Sep 2009 04:57:02
econometricsgarchsderandommathematics Elvin 04 Sep 2009 04:57:05
pick of the week Jiro Doke 11 Feb 2011 20:12:42

Contact us at files@mathworks.com