Problem 1: The Variance-Covariance Matrix

You observe the following 5 quarterly returns (in %) for two assets:

(a) Compute the means

## Mean Stock (R1_bar) = 4
## Mean Bond  (R2_bar) = 3

(b) Build the demeaned returns matrix

Entry (t,j) is the demeaned return: X_tilde_tj = R_tj - R_bar_j

##      Stock_demeaned Bond_demeaned
## [1,]              6            -1
## [2,]              0             0
## [3,]             -6             2
## [4,]              4            -2
## [5,]             -4             1

(c) Compute X_tilde_transpose times X_tilde

This is a 2x2 matrix computed from intermediate dot products.

## X_tilde^T * X_tilde =
##                Stock_demeaned Bond_demeaned
## Stock_demeaned            104           -30
## Bond_demeaned             -30            10
## Dot product (Stock, Stock) = 104
## Dot product (Stock, Bond)  = -30
## Dot product (Bond,  Bond)  = 10

(d) Compute the variance-covariance matrix

The population variance-covariance matrix is Sigma = (1/n) * X_tilde^T * X_tilde

## Sigma =
##                Stock_demeaned Bond_demeaned
## Stock_demeaned           20.8            -6
## Bond_demeaned            -6.0             2
## Variance of Stock (diagonal)  = 20.8
## Variance of Bond  (diagonal)  = 2
## Covariance Stock-Bond (off-diagonal) = -6
## Correlation between Stock and Bond = -0.9303

(e) Portfolio variance

The variance of a portfolio with weight vector w is: sigma^2_p = w^T * Sigma * w

## 60/40 portfolio variance = 4.928
## 50/50 portfolio variance = 2.7

(f) The power of compute once, apply many

No — you do not need to recompute Sigma each time. Sigma is computed once from the data. For every new weight vector w, you simply evaluate w^T * Sigma * w, which is a cheap dot-product operation. This is the key computational advantage: the matrix encodes all pairwise risk relationships, so any portfolio’s risk is a single matrix expression regardless of how many allocations you evaluate.


Problem 2: CreditMetrics - Expected Credit Losses

Three credit states: A (investment grade), B (speculative grade), D (default). Columns of P = current state, rows = next-period state.

(a) Verify the transition matrix — each column must sum to 1

##      A    B D
## A 0.92 0.05 0
## B 0.06 0.80 0
## D 0.02 0.15 1
## Column sums:
## A B D 
## 1 1 1

Each column must sum to 1 because it represents a complete probability distribution over next-period states — the bond must end up somewhere.

(b) Year-1 expected loss by hand

The expected loss E1[i,j] = sum over k of P(next=k | current=i) * L[k,j], which is the dot product of column i of P with column j of L.

Model 1 — Default-only losses:

Model 2 — Migration losses:

Model 2 gives higher expected losses because it adds mark-to-market losses from downgrades, not just defaults.

(c) Year-1 expected loss — full matrix

## E1 under Model 1 (default-only):
##   Senior Junior
## A  0.008  0.014
## B  0.060  0.105
## D  0.400  0.700
## E1 under Model 2 (migration losses):
##   Senior Junior
## A 0.0098 0.0188
## B 0.0840 0.1690
## D 0.4000 0.7000
## E1[B, Jr] under Model 2 = 0.169
## A B-rated bond has an 8.4% expected junior tranche loss after one period,
## driven both by default risk and spread-widening from potential downgrade.

(d) Year-5 expected loss

## P^5:
##        A      B D
## A 0.6796 0.1392 0
## B 0.1670 0.3456 0
## D 0.1533 0.5152 1
## E5 under Model 1:
##   Senior Junior
## A 0.0613 0.1073
## B 0.2061 0.3607
## D 0.4000 0.7000
## E5 under Model 2:
##   Senior Junior
## A 0.0663 0.1207
## B 0.2165 0.3883
## D 0.4000 0.7000
## Difference E5 Model2 - Model1:
##   Senior Junior
## A 0.0050 0.0134
## B 0.0104 0.0276
## D 0.0000 0.0000
## The models diverge MORE over 5 periods — migration losses compound.

(e) Quick Reflection

Model 1 is more realistic when there is no liquid secondary market — if bonds cannot be marked to market, downgrades produce no immediate loss, and only default matters.

(f) Real-World Data

Moody’s Annual Default Study and S&P Global Ratings publish annual transition matrices and cumulative default rates by initial rating. The matrix P used here is broadly consistent with investment-grade migration probabilities but is simplified — real matrices show more granular rating categories (Aaa through C) and time-varying probabilities. Comparing to cumulative default rates rather than one-year averages is useful for multi-period models but introduces survivor bias since the pool of issuers changes over time.


Problem 3: The Dot Product as Similarity

(a) Vector diagram in R2

(b) Portfolio return vs angle theta

Rp is maximized at theta=0 (w and r perfectly aligned — portfolio fully bets on the direction returns move). Rp is minimized at theta=180 (portfolio bets opposite to returns). Rp=0 at theta=90 — portfolio is orthogonal to returns, so gains and losses cancel exactly.

(d) Diversification in the geometric picture

Diversification means choosing w so that it is not perfectly aligned with any single risky direction — spreading weight across assets whose return vectors point in different directions. When two assets have return vectors that are nearly orthogonal (low correlation), a combined portfolio w sits between them, reducing the magnitude of ||r|| that projects onto w and smoothing out peaks and troughs.


Problem 4: Non-Linearity of Options

S0 = 10, European call with strike K.

(a) Two outcomes, symmetric

## E[S1] = 10
## E[max(S1-10, 0)] = 0.5

(b) Four outcomes, same mean

## E[S1] = 10
## E[max(S1-10, 0)] = 0.55
## The stock mean is the same as in (a) but the call payoff is higher.
## Options care about the full distribution, not just the mean.

(c) Three discrete periods

## E[max(S3-11, 0)] = 0.25
## E[max(S3-12, 0)] = 0.125

(d) Monte Carlo — normal increments

  1. Guess: Since delta_S ~ N(0,1) is symmetric around 0 and S0=10=K, roughly half the draws are in the money. The expected payoff should be positive and roughly equal to E[delta_S | delta_S > 0] * 0.5 ~ 0.40.
## Monte Carlo E[max(S1-10, 0)] = 0.3983
## E[S1-K | S1>K] * Pr(S1>K) = 0.3983
## Direct mean = 0.3983
## Both sides match — the identity holds in simulation.
## Limitation: this formula requires knowing the conditional distribution,
## which is as hard to compute as the option price itself.

Problem 5: Working Capital Schedule

Matching denominators:

Calculate days variables and generate projections:

## Accounts Receivable Days = 43.5
## Accounts Payable Days    = 48.7
## Unearned Revenue Days    = 18.2
## 
## 2025 Projections (days held constant):
## Projected Revenue          = 1210
## Projected COGS             = 726
## Projected Accounts Rec     = 144
## Projected Accounts Pay     = 96.8
## Projected Unearned Revenue = 60.5