%pylab inline
import pandas as pd
import numpy as np
import fmt
Populating the interactive namespace from numpy and matplotlib
$\renewcommand{bs}{\boldsymbol}$
We discussed three different ways of solving the least square problem of $\min_{\boldsymbol \beta}\Vert X \bs \beta - \boldsymbol y\Vert_2$ in the lecture: 1) the pseudo-inverse $X^+$ 2) QR decomposition 3) SVD.
Hint:
The following problems use the same CMT treasury data set from the class:
cmturl = "https://raw.githubusercontent.com/yadongli/nyumath2048/master/data/cmt.csv"
cmt_rates = pd.read_csv(cmturl, parse_dates=[0], index_col=[0])
cmt_rates.plot(legend=False);
tenors = cmt_rates.columns.map(float)
tenorTags = ['T=%g' % m for m in tenors]
Take the covariance matrix $V$ estimated from the CMT historical levels, compute the following:
From the interest rate historical data,
Hints: