A matrix transpose swaps rows and columns. Follow labelled holdings, check product order and dimensions, and distinguish dot products, covariance and inverses.
Matrix transpose
The transpose of a matrix exchanges its row and column positions. If A has m rows and n columns, its transpose A⊤ has n rows and m columns, with
(A⊤)ij=Aji.
A row becomes a column in the same order. The entries keep their values and meaning: transposing a holdings table does not buy or sell anything. It changes how those holdings are organised for a calculation.
Two desks, three assets
Suppose two desks hold three assets. Rows identify desks, columns identify assets, and each entry is a number of shares:
A=(142536),A⊤=123456.
A is 2×3; A⊤ is 3×2. Desk 1's holdings (1,2,3) move from the first row to the first column. Asset C's holdings (3,6) move from the third column to the third row. The labels must travel with their rows and columns. Keeping the old labels on the transposed table would change what the data claim to represent.
Synthetic holdings in shares: the two-by-three table has Desk 1 holding 1, 2 and 3 shares of assets A, B and C, and Desk 2 holding 4, 5 and 6. Its three-by-two transpose puts assets in rows and desks in columns; Desk 1's row becomes its column without changing quantities.
Original synthetic holdings table. The highlighted row becomes the highlighted column; all six quantities and their desk–asset identities remain the same.
Now let the three assets' price changes be the column p=(2,−1,1)⊤, measured in USD per share. With positions held fixed and ignoring trading costs and other cash flows, the desks' price-change P&Ls are
Ap=(1(2)+2(−1)+3(1)4(2)+5(−1)+6(1))=(39) USD.
Transposing the result gives the row (3,9). The same row can be calculated as p⊤A⊤. Transposition changes the orientation of the calculation, while preserving which shares earn which price changes.
These are the same sums of scalar products. For the desk example, (Ap)⊤ is 1×2, and p⊤A⊤ has shape (1×3)(3×2).
Other useful rules are (A⊤)⊤=A, (A+B)⊤=A⊤+B⊤ for equal-shaped A,B, and (cA)⊤=cA⊤ for a scalar c.
A small symbol that changes the output
When portfolio weights w and asset returns r are both n×1 columns, the portfolio's weighted return is the dot product
w⊤r=i=1∑nwiri.
For beginning-of-period weights (0.5,0.3,0.2)⊤ and matching simple returns (0.02,−0.01,0.03)⊤, this is 0.013, or 1.3%. This describes a fixed initial allocation over that period, before costs and external cash flows; an arbitrary sequence of changing weights needs a dated return calculation.
The placement of the transpose also distinguishes two different products:
w⊤w is 1×1, the sum of squared weights. Here it is 0.38.
ww⊤ is n×n, an outer-product matrix with entry wiwj. Here it is 3×3.
Neither expression by itself is portfolio variance. That requires the assets' covariance matrix, giving the quadratic formw⊤Σw.
Transposes also build covariance estimates. Let R contain T>1 matching return observations in rows and n assets in columns. Define centred entries Xti=Rti−Rˉi, using each asset's sample mean. The conventional sample covariance matrix is
Σ=T−11X⊤X.
It is n×n: asset columns are paired with asset columns. Raw R⊤R is a Gram matrix of uncentred observations, not the sample covariance matrix. Both centring and the denominator matter. Meanwhile, XX⊤ is T×T and pairs observations, so it answers a different question even though it contains related algebraic information.
Transpose is not inverse
A transpose exists for every rectangular matrix. An ordinary matrix inverse requires a square, nonsingular matrix and undoes its linear map. Transposition does not generally undo anything: for D=diag(2,1), D⊤=D but DD⊤=diag(4,1), not the identity. Equality Q⊤=Q−1 is a special property of real orthogonal matrices.
A real symmetric matrix satisfies A⊤=A. For complex entries, the adjoint instead uses the conjugate transpose, A∗=A⊤. Plain transposition never conjugates entries. For example, the scalar i gives i⊤i=−1, whereas its conjugate product is ii=1; complex inner products need that conjugation.
For a fuller treatment of the entry rules and proofs, see the “The transpose” section of Matrix Algebra: Operations, Rules, and the Transpose. Its public page provides a preview; the full lesson requires membership.
Sources
Gilbert Strang, Introduction to Linear Algebra, 5th edition, Wellesley–Cambridge Press, 2016, §2.7, pp. 109–111 — transpose rules, inner and outer products, and the distinction from inversion. The financial examples and figure here are original.