liveBook · Manning

Matrix-matrix multiplication

As explained in Statistics Every Programmer Needs

Matrix multiplication is an algebraic operation that forms each result entry from the dot product of a row of one matrix and a column of another.

Matrix-matrix multiplication forms each result entry from the dot product of a row in one matrix and a column in another. In Markov analysis, multiplying a transition matrix by itself produces a two-period transition matrix. section 11.2.2

The operation supports two equivalent forecasting routes:

  • Compute the next state distribution repeatedly: multiply the current probability vector by P, then multiply the result by P again. section 11.2.2

Two-period cellular-market forecast

With NumPy, P2 = np.dot(P, P) gives the two-period transition matrix. Multiplying pi_0 by P2 yields [0.39012, 0.31454, 0.22803, 0.06731], matching the iterative forecast.

How Statistics Every Programmer Needs covers it

How deep it goes
Defines multiplication through dot products and demonstrates iterative and direct two-period computation, without developing broader algebraic theory.
Examples
Uses cellular-market shares, a four-state transition matrix, NumPy dot products, and matching period-2 forecasts.
What it assumes
Assumes probability vectors and transition matrices, while explaining dot products through the forecasting calculation.
What you can do after
Apply it via NumPy to calculate multi-period transition matrices and forecast state distributions.
How it connects
Connects matrix multiplication with Markov analysis, transition probabilities, state probabilities, and dot products.

Also explained in

Compare how 8 books explain matrix-matrix multiplication →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.