This preview shows pages 1–2. Sign up to view the full content.
C:\work\stationary.m
Page 1
July 11, 2003
3:45:49 PM
function v = stationary(P)
%
% This is a MATLAB function that calculates the stationary probability vect
or v
% of a Markov chain transition matrix P, i.e., we solve v = v*P .
% We assume the existence of a unique stationary vector.
% For a finitestate Markov chain, the condition is that the chain be irred
ucible.
%
% To solve the system of n equations in n unknowns, we use the matrix inver
se function inv.
% For a square matrix A, inv(A)*A = I, where I is the identity matrix (1's
on the diagonal, 0's elsewhere).
%
% We input the matrix P when we call the function.
% First find the number n of rows in the transition matrix P.
s = size(P);
n = s(1);
% There is one redundant equation in the n equations v = vP.
% We fill gap by using the fact that v(1) + .
.. + v(n) = 1.
% We eliminate redundant equation by replacing last column of P with ones.
PP = P;
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 10/20/2010 for the course IEOR 4106 taught by Professor Whitt during the Spring '08 term at Columbia.
 Spring '08
 Whitt
 Operations Research

Click to edit the document details