An inner product, or dot product, multiplies corresponding elements of two equal-length sequences and sums the results to produce one number. In Markov analysis, multiplying a state-probability vector by a transition-probability matrix produces the probability distribution for the next period. section 11.2.2
Use the operation to:
- Project a current distribution of state probabilities into the next period. section 11.5
- Repeat the vector–matrix multiplication to forecast several future periods, keeping the transition matrix constant. section 11.2.2
- Compute an equivalent two-period transition by multiplying the transition matrix by itself, then applying the result to the initial vector. section 11.2.2
Forecasting cellular-market shares
Starting with pi_0 = [0.40, 0.35, 0.20, 0.05], compute pi_1 = dot(pi_0, P) to obtain [0.394, 0.329, 0.217, 0.060]. Applying the same operation again gives period-2 shares [0.39012, 0.31454, 0.22803, 0.06731]. Computing P2 = dot(P, P) and then dot(pi_0, P2) produces the same period-2 result. section 11.2.2
>>> import numpy as np >>> pi_0 = np.array([0.40, 0.35, 0.20, 0.05]) >>> P = np.array([ >>> [0.85, 0.06, 0.07, 0.02], >>> [0.08, 0.80, 0.10, 0.02], >>> [0.10, 0.10, 0.75, 0.05], >>> [0.12, 0.10, 0.08, 0.70] >>> ])
Shows the NumPy setup for a state-probability vector and transition matrix. section 11.2.2











