0
$\begingroup$

I am sitting in a class for Markov chains/processes, having no real background in probability but high school knowledge. Now I gotta go through it and I found it better understandable than I had expected. But now we got a MATLAB snippet from our teacher, and while applying that code:

 P =[...]
 v = null(transpose(P-eye(length(P))));
 pi = v.*(ones(length(P),1)*(1./sum(v)))

I found two questions:

  1. For what is the nullspace needed?
  2. What is the mathematical background for the second line (" pi = ...")

Having a transition matrix P and a stationary distribution vector $\vec\pi$ I can set up the system as $\pi P = \pi $ and rewrite is as $\pi(P-I)=0$ if I do want to solve it in MATLAB.

Thank you for any help!

1 Answers 1

0

For your first question. If I add a 1:

v = null(transpose(P-1*eye(length(P))));

you see that it is the nullspace $Ker(P-\lambda I)$ associated to eigenvalue $\lambda=1$, which is reduced to a single vector as you know for Markov matrices.

The second question: Here is the purpose of this operation: "null" outputs a normalized vector, with the meaning of quadratic norm ("2-norm") $\sum x_i^2$ equal to 1. But for a probability vector, it is the 1-norm $\sum |x_i|=\sum x_i$ that must be equal to 1.

  • 0
    Okay I see your points, I will try to apply this to the example I have and see if I can understand it better with that knowledge and by adding some more steps inbetween2017-01-28