Home > sp > system2.m

system2

PURPOSE ^

system2.m sets up the transition matrix for a simple system with no absorbing state, calculates powers of the transition matrix, and shows simulations of the chain

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 system2.m sets up the transition matrix for a simple system with no absorbing state, calculates powers of the transition matrix, and shows simulations of the chain

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % system2.m sets up the transition matrix for a simple system with no absorbing state, calculates powers of the transition matrix, and shows simulations of the chain
0002 
0003 P=zeros(7,7);
0004 P(1,2)=1;
0005 for i=2:6,
0006   P(i,i-1) = 0.5;
0007   P(i,i+1) = 0.5;
0008 end;
0009 P(7,3)=1;
0010 
0011 showmatrix(P);
0012 showmatrix(P^2);
0013 showmatrix(P^10);
0014 showmatrix(P^100);
0015 showmatrix(P^250);
0016 
0017 mu=[0 1 0 0 0 0 0];  % initial distribution
0018 
0019 simulate_chain;

Generated on Mon 17-Mar-2008 10:33:42 by m2html © 2003