1 / 12

Stochastic Simulations

This announcement provides information about the due date for Homework II, discusses Homework III on random numbers, and introduces the concept of small world networks through the example of Six Degrees of Kevin Bacon. It explains random number generators in MATLAB, provides examples of different random functions, and discusses the concept of seeding. The outline of the topic includes a description of complicated systems as graphs, the hypothesis of six degrees of separation, and the spectrum of graph properties from ordered to random. It also explains the process of creating small world graphs in MATLAB and computing their path length and clustering coefficients.

ccressey
Download Presentation

Stochastic Simulations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stochastic Simulations Six degrees of Kevin Bacon

  2. Outline Announcements: Homework II: due Today. by 5, by e-mail Discuss on Friday. Homework III: on web Random Numbers Example--Small Worlds

  3. Random Numbers Computers are deterministic Therefore, computers generate “pseudo-random” numbers Matlab’s random numbers are “good” “The uniform random number generator in MATLAB 5 uses a lagged Fibonacci generator, with a cache of 32 floating point numbers, combined with a shift register random integer generator.” http://www.mathworks.com/support/solutions/data/8542.shtml

  4. Random functions rand(m,n) produces m-by-n matrix of uniformly distributed random numbers [0,1] randn(m,n) produces random numbers normally distributed with mean=0 and std=1 randperm(n) is a random permutation of integers [1:n] I=randperm(n); B=A(I,:) would scramble the rows of A

  5. Seeds Random number generators are usually recurrence equations: r(n)=F(r(n-1)) Must provide an initial value r(0) Matlab’s random functions are seeded at startup, but THE SEED IS THE SAME EVERY TIME! Initialize seed with rand('state', sum(100*clock) ) How would you ensure rand is always random?

  6. It’s a Small, Small World Watts & Strogatz (1998) Nature, 393:440-442 Complicated systems can be viewed as graphs describe how components are connected

  7. Example: Six Degrees of Kevin Bacon Components (vertices) are actors Connections (edges) are movies Hypothesis: 6 or fewer links separate Kevin Bacon from all other actors.

  8. Example: Kevin Bacon & Harrison Ford Top Gun Witness A Few Good Men Star Wars

  9. Other Systems Power Grid Food Webs Nervous system of Caenorhabditis elegans Goal is to learn about these systems by studying their graphs Many of these systems are “Small Worlds”--only a few links separate any two points

  10. Watts & Strogatz Can organize graphs on a spectrum from ordered to random How do graph properties change across this spectrum? L=mean path length (# links between points) C=cluster coefficient (“lumpiness”) Used a Monte-Carlo approach--created lots of graphs along spectrum and computed L and C

  11. Watts & Strogatz Creating the graphs n=# of vertices, k=number of edges/vertex Start with a regular ring lattice and change edges at random with probability p For every p, compute stats for many graphs

  12. Small Worlds in Matlab G=createlattice(n,k,p) creates a lattice--represented as a sparse matrix [L,C]=latticestats(G) computes the path length and clustering stats [L,C]=SmallWorldsEx(n,k,P,N) Creates N graphs for every P(j) and saves the mean stats in L(j) and C(j) plotlattice(G) Plots a lattice

More Related