Advertisement
Guest User

Poisson Branching Process (Critical)

a guest
Mar 6th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.50 KB | None | 0 0
  1. M = 10;
  2. T = zeros(M, 1);
  3. S = zeros(M, 1);
  4.  
  5. for i=1:M
  6.   current_generation = 1;
  7.   t = 0;
  8.   size = 1;
  9.   while current_generation > 0
  10.     %% current_generation = sum(2 * round(rand(current_generation, 1)));
  11.     current_generation = sum(poissrnd(1, [1, M]));
  12.     size = size + current_generation;
  13.     t = t + 1;
  14.   end
  15.   T(i) = t;
  16.   S(i) = size;
  17. end
  18.  
  19. fig = figure('visible', 'off');
  20. scatter(T, S);
  21. set(gca, 'XScale', 'log');
  22. set(gca, 'YScale', 'log');
  23. grid on;
  24. print(fig, "critical.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement