Understanding the properties of financial time series is very important in finance. In this chapter, we will discuss many issues, such as downloading historical prices, estimating returns, total risk, market risk, correlation among stocks, correlation among different countries' markets from various types of portfolios, and a portfolio variance-covariance matrix; constructing an efficient portfolio and an efficient frontier; estimating Roll (1984) spread; and also estimating the Amihud (2002) illiquidity measure, and Pastor and Stambaugh's (2003) liquidity measure for portfolios. The two related Python modules used are Pandas
and statsmodels
.
In this chapter, we will cover the following topics:
Installation of
Pandas
andstatsmodels
Using
Pandas
andstatsmodels
Open data sources, and retrieving data from Excel, text, CSV, and MATLAB files, and from a web page
Date variable, DataFrame, and merging different datasets by date
Term structure of interest...