Classical Principal Component Analysis
We go through the following steps to produce a vanilla principal component analysis.
- Load raw spot yield data from the Bank of England website into a python dataframe
- Truncate the data to create a rectangular matrix
- Clean the raw data by:
a. filling in blank values
b. adjusting problem values - Transform truncated dataset into a calibration dataset by performing the following transformations:
a. taking logarithmns
b. differencing
c. de-meaning - Calculate a co-variance matrix
- Eigenvector and eigenvalue decomposition
- Dimensionality Reduction
- Projecting Co-ordinates
Steps
- standardise the data (mean zero and standard deviation 1)
- compute covariance matrix
- compute eigenvectors and eigenvalues
- sort components by explained variance
- choose number of components
- project the data using lower dimensional representation
to do
- cross check standardisation point