{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

newstat

# newstat - First we can rewrite v = vP by v(P-I = z where I...

This preview shows page 1. Sign up to view the full content.

C:\work\stat.m Page 1 July 11, 2003 3:36:32 PM function v = stat(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 finite-state Markov chain, the condition is that the chain be irred ucible. % % 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.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % First, we can rewrite v = vP by v(P-I) = z, where I is an identity matrix and z is a vector of zeros. % We then add a column of 1's to make a new equation % I = eye(n); %the identity matrix z = zeros(1,n); %a row of zeros w = ones(n,1); %a column of 1's A = [P-I w]; % % The desired system of equations is vA = [z 1], where A is n by (n+1) % We solve it by writing v = [z 1]/A % v = [z 1]/A; % % Using transposes, we could also write v' = A'\[z 1]' % We could also use the matrix inverse applied to square matrices. % That approach is in the other program stationary.m...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern