-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Python for Finance

Based on the methodology and empirical evidence in Campbell, Grossman, and Wang (1993), Pastor and Stambaugh (2003) designed the following model to measure individual stock's liquidity and the market liquidity:
Here, yt is the excess stock return, Rt-Rf , t, on day t, Rt is the return for the stock, Rf,t is the risk-free rate, x1,t is the market return, and x2,t is the signed dollar trading volume:
pt is the stock price, and volume, t is the trading volume. The regression is run based on daily data for each month. In other words, for each month, we get one β2 that is defined as the liquidity measure for individual stock. The following code estimates the liquidity for IBM. First, we download the IBM and S&P500 daily price data, estimate their daily returns, and merge them as follows:
import numpy as np from matplotlib.finance import quotes_historical_yahoo_ochl as getData import numpy as np import pandas as pd import...
Change the font size
Change margin width
Change background colour