From LLV (2012), we have that cost of capital is calculated as
\[ \left({\frac{(N r_I \Pi_I)}{1+r_I \Pi_I \lambda} +w \Pi_U}\right)^{-1},
\]
where \( \lambda \) is calculated as the solution to equation (A5) of LLV (2012):
eq_A5 <- function(lambda, N, rI, w, sig_v, sig_e, sig_z) {
rI^3 * w * sig_z * (sig_v + sig_e)^3 * lambda^4 + rI^2 * sig_v * sig_z *
(sig_v + sig_e)^2 * (rI * (sig_v + sig_e) * (N - 2) + 3 * w * sig_e) *
lambda^3 + rI * sig_v^2 * (sig_v + sig_e) * ((3 * sig_z * sig_e^2 +
N^2 * rI^2 * (sig_v + sig_e)) * w + rI * sig_z * sig_e * (sig_v + sig_e) *
(2 * N - 5)) * lambda^2 + sig_v^3 * sig_e * ((N^2 * rI^2 * (sig_v +
sig_e) + sig_z * sig_e^2) * w + rI * (sig_v + sig_e) * (sig_z * sig_e *
(N - 4) + N^2 * rI^2 * (N - 2))) * lambda - sig_v^4 * sig_e^2 * (sig_z *
sig_e + N^2 * rI^2)
}
and \( \Pi_U = \Pi_v + \Pi_{\delta} \), where equation (A6) gives
\[
\Pi_{\delta} = \frac{N^2 r_I^2 \sigma_v^4}{(r_I^2 \sigma^2_z (\sigma^2_v + \sigma_{\epsilon})^2 \lambda^2 +
2 r_I \sigma^2_v \sigma^2_{\epsilon} \sigma^2_z (\sigma^2_v + \sigma^2_{\epsilon}) \lambda + \sigma_v^4
\sigma^2_{\epsilon} (N^2 r_I^2 + \sigma^2_{\epsilon} \sigma^2_z))}.
\]
Note that I have simplified the expression for the cost of capital by cancelling out the \( N r_I + \omega \) term that cancels out from both components of Equation 18 (see here for evidence that this doesn't affect the calculations).
Equation (18) of LLV (2012) implies the cost of capital can be written as
\[ \left( \frac{\mathrm{Cov}}{N r_I + \omega} +
\frac{\mathrm{Cov}}{N r_I + \omega} \times
\frac{\frac{N r_I^2 \Pi_I^2}{1+r_I \Pi_I \lambda} \lambda \mathrm{Cov}}{N r_I + \omega-\frac{N r_I^2 \Pi_I^2}{1+r_I \Pi_I \lambda} \lambda \mathrm{Cov}} \right) \mathbb{E}[\tilde{Z}]
\]
where \( \mathrm{Cov} = \Pi_{\mathrm{avg}}^{-1} \). The second term inside the large brackets
\[ \frac{\mathrm{Cov}}{N r_I + \omega} \times
\frac{\frac{N r_I^2 \Pi_I^2}{1+r_I \Pi_I \lambda} \lambda \mathrm{Cov}}{N r_I + \omega-\frac{N r_I^2 \Pi_I^2}{1+r_I \Pi_I \lambda} \lambda \mathrm{Cov}}
\]
can be labeled the “residual cost of capital.''
In the following code, I use this to calculate residual cost of capital for a given level of the 6-tuple \( \Omega = \left(N, r_I, \omega, \sigma^2_v, \sigma^2_{\epsilon}, \sigma^2_z \right) \).
residCoC <- function(w, sig_e, sig_z, sig_v, rI, N) {
# First, find the root for Equation (A5) to solve for \lambda
sol <- uniroot(eq_A5, c(0, 1), N = N, rI = rI, w = w, sig_v = sig_v, sig_e = sig_e,
sig_z = sig_z)
lambda <- sol$root
# Calculate precisions. First, for informed investor ...
Pi_v <- 1/sig_v
Pi_e <- 1/sig_e
Pi_i <- Pi_v + Pi_e
# Then, using Equation (A.6), solve for precision of uninformed investor.
Pi_d <- (N^2 * rI^2 * sig_v^2)/(rI^2 * sig_z * (sig_v + sig_e)^2 * lambda^2 +
2 * rI * sig_v * sig_e * sig_z * (sig_v + sig_e) * lambda + sig_v^2 *
sig_e * (N^2 * rI^2 + sig_e * sig_z))
Pi_u <- Pi_v + Pi_d
# Eq. (18)
CoC <- (((1 + rI * Pi_i * lambda)^-1 * (N * rI * Pi_i) + w * Pi_u))^-1
# Calculations per note from Ro (2012-06-26)
Pi_avg <- (N * rI * Pi_i + w * Pi_u)/(N * rI + w)
cov <- 1/Pi_avg
numer <- (N * rI^2 * Pi_i^2)/(1 + rI * Pi_i * lambda) * lambda * cov
resid_coc <- cov/(N * rI + w) * numer/(N * rI + w - numer)
# Calculation from Chris's Matlab code: resid_coc <-
# (Pi_v/(N*rI+w))*((N*rI^2*Pi_i^2*lambda*Pi_v)/
# (N*rI+w+w*Pi_u*rI*Pi_i*lambda*Pi_v))
# Now if lambda we exogenously set to zero, we'd have (see section 3.2 of
# LLV, 2012)
Pi_d <- (1/Pi_e + (N * rI * Pi_e)^(-2) * sig_z)^(-1)
Pi_u <- Pi_v + Pi_d
CoC_0 <- (N * rI * Pi_i + w * Pi_u)^(-1)
# Return 'residual cost of capital'
return(CoC)
}
Note that Chris's Matlab calculates residual cost of capital as
\[ \frac{\Pi_v}{N r_I+\omega} \times
\frac{N r_I^2 \Pi_I^2 \lambda \Pi_v}{N r_I+\omega+\omega \Pi_U r_I \Pi_I \lambda \Pi_v}.
\]
The 2nd step is to do two plots. First, do a plot with \( \sigma_{\epsilon}^2 \) on the \( x \)-axis, \( \omega \) on the \( y \)-axis, and the cost of capital on the \( z \)-axis.
library(lattice)
sig_e <- seq(from = 0.2, to = 1.2, by = 0.05)
w <- seq(from = 0.2, to = 2, by = 0.05)
params <- merge(w, sig_e)
names(params) <- c("w", "sig_e")
output1 <- data.frame(params, resid_coc = mapply(residCoC, w = params$w,
sig_e = params$sig_e, N = 5, rI = 0.5, sig_z = 1, sig_v = 1))
wireframe(resid_coc ~ sig_e * w, data = output1, zlab = "Total\nCoC",
ylab = expression(omega), xlab = expression(sigma[epsilon]^2), scales = list(arrows = FALSE,
cex = 0.6, col = "black", font = 3, tck = 1))
Then do a plot with \( \sigma_v^2 \) on the \( x \)-axis, \( \omega \) on the \( y \)-axis, and the cost of capital on
the \( z \)-axis.
w <- sig_v <- seq(from = 0.2, to = 1.2, by = 0.05)
params <- merge(w, sig_v)
names(params) <- c("w", "sig_v")
output2 <- data.frame(params, resid_coc = mapply(residCoC, w = params$w,
sig_v = params$sig_v, N = 5, rI = 0.5, sig_z = 1, sig_e = 1))
wireframe(resid_coc ~ sig_v * w, data = output2, zlab = "Total\nCoC",
ylab = expression(omega), xlab = expression(sigma[v]^2))