MScFE 600 Financial Data GWP1 - Ipynb
MScFE 600 Financial Data GWP1 - Ipynb
A.
▪ Source - Investing.com
▪ Content - Daily bond yields across different maturities
▪ Purpose - The dataset is well-suited for yield curve analysis because it offers
consistent and comprehensive data points for modeling.
• *Selected Maturities*
▪ These maturities cover the full spectrum of the yield curve, from short-term to long-
term securities. This allows for accurate modeling of interest rate dynamics across
different time horizons and provides sufficient data for fitting both the Nelson-
Siegel and Cubic-Spline models.
1 of 6
MScFE 600 Financial Data GWP1_Grp_7982_Que2_
B.
C.
2 of 6
MScFE 600 Financial Data GWP1_Grp_7982_Que2_
D.
3 of 6
MScFE 600 Financial Data GWP1_Grp_7982_Que2_
E.
Model Comparison:
Nelson-Siegel Model: RMSE = 0.1914, R^2 = 0.9544
Cubic Spline Model: RMSE = 0.0000, R^2 = 1.0000
4 of 6
MScFE 600 Financial Data GWP1_Grp_7982_Que2_
F.
Model Parameters:
Nelson-Siegel Parameters:
beta0 = 7.0918, beta1 = -2.7091, beta2 = -0.0005, tau = 4.6961
G.
Ethical Considerations
It is unethical to intentionally create misleading data. Smoothing data, while useful in
filtering noise in Econometrics, becomes unethical when it misrepresents reality, such as
understating volatility or inflating Sharpe ratios. For instance, holding back gains to offset
losses, as in smoothing profit-and-loss, creates the illusion of stability. Good ethics demands
transparency, making such practices unethical if used to mislead stakeholders about risk or
performance. (WQU, 2024)
5 of 6
MScFE 600 Financial Data GWP1_Grp_7982_Que2_
performance, it becomes unethical, violating transparency and good ethics. The use of
smoothing techniques, such as the Nelson-Siegel model, raises ethical concerns if it obscures
critical market information. Key considerations are:
• Transparency
Smoothing improves interpretability but may conceal market risks if used without disclosure.
• Over-smoothing
In [ ]:
6 of 6
MScFE 600 Financial Data GWP1_Grp7982_Ques3
*A.*
# Convert to DataFrame
uncorrelated_df = pd.DataFrame(uncorrelated_data, columns=[f"Var{i+1}" for i in range
print("Uncorrelated Gaussian Random Variables:")
print(uncorrelated_df.head())
*B.*
# Perform PCA
pca_uncorrelated = PCA()
pca_uncorrelated.fit(correlation_matrix_uncorrelated)
1 of 6
MScFE 600 Financial Data GWP1_Grp7982_Ques3
*C.*
*D.*
2 of 6
MScFE 600 Financial Data GWP1_Grp7982_Ques3
*E.*
*F.*
3 of 6
MScFE 600 Financial Data GWP1_Grp7982_Ques3
print(daily_changes.head())
# Perform PCA
pca_gov = PCA()
pca_gov.fit(correlation_matrix_gov)
*H.*
*I.*
4 of 6
MScFE 600 Financial Data GWP1_Grp7982_Ques3
*J.*
5 of 6
MScFE 600 Financial Data GWP1_Grp7982_Ques3
In [ ]:
6 of 6