Please enable JavaScript.
Coggle requires JavaScript to display documents.
Quantopian (OLS (stats.norm.fit(X) = mu, std, Instability
Missing,…
Quantopian
Moments
-
-
Skewness and Kurtosis
- Jarque-Bera Normality Test
- Standardised Moments (0, std, 0, std^2)
-
OLS
stats.norm.fit(X) = mu, std
Instability
- Missing, Outlier
- Regime Changes
- Multicollinearity
Violations
- Normality
- Heteroskedasticity
- stats.diagnostic.het_breushpagap(res, x)
- get robust summary
- Newey-West test autocorrelation
Misspecification
- Nonstationary TS
CONSTANT MOMENTS over time
Unit Root test: whether follows x(t) = x(t-1) + error(t)
Dickey-Fuller test: from statsmodels.tsa.stattools improt adfuller NULL: input has unit root! -> If so: model instead 1st Differenced series y(t) = x(t) - x(t-1) if stationary, and use it to predict x(t+1) also could use reg if both dep/indep are unit-root and cointegrated
Residual
IID no autocorrelation
Too detailed Link Title
p-Hacking and Multiplicity Bias
Concepts
Spearman Rank Correlation
Non-linear and rank data comparison
import scipy.stats as stats
stats.randata(data, method='average')
- robust to outliers and scale
stats.spearmanr(X, Y)
Leverage
Keeping high Sharpe, by multiply debt or capital to up abs(return)
Estimating Covariance Matrices
- Ledoit-Wolf Estimator [skl.coveraince.ledoi_wolf(X)]
- OOS MAE analysis of Ledoit-Wolf estimates
Volume, Slippage, Liquidity
- High tails in Open and Close Volume
- Slippage = drag price up/down at large buy/sell orders
- Liquidity = order s=100kUSD in market M(1) can regularly be filled within t=1s at P(f)/P(m) < 1.0001 (0.01%error) then claim M(1) effectively liquid for one's purpose, benchmarking etc.
MODELS
Market Impact Model
- Attributes affecting TC
- Impact of turnover rate, TC, leverage on strategy performance
- Quant exp. on TC
TC
- Direct: commission and fee
- Indirect: market impact and spread costs
- Metric = [ Side (Benchmark - Exec Price) 10000] / Benchmark
Slippage Attributes
- Volatility (OHLC)
- Liquidity
- Relative Order Size
- Bid-ask spread
Garman-Klass Yang-Zhang Volatility used by OHLC
def gkyz_var(open, high, low. close, close_tm1):
return np.log(open/close_tm1)2 + 0.5*(np.log(high/low)2) - (2np.log(2)-1)(np.log(close/open)**2)
def historical_vol(close_ret, mean_ret):
return np.sqrt(np.sum((close_ret - mean_ret)**2)/390)
Attributes to higher market impact
- Higher relative order size
- Trading illiquid names
- Trading names with lower daily turnover (rel shares outstanding)
- Shoter trade duration
- Higher volatility names
- More urgency or high POV
- Short tem alpha
- Trading earlier in day
- Trading names with wider spreads
CAPM and APTRisk Premia
- Cannot remove systematic risk hence RISK PREMIA
- Arbitrage Case in firm-level RP which can be diversified
E[Return] = Return_free + Risk_Premium
- SP500 as Proxy, get BETA by regressing asset_i's return on market return as measure of systematic risk
Risk_Premium_asset(i) = BETA(Market_Risk_Premium)
Together: E[R(i)] = R(F) + BETA(E[R(M) - R(F))
-
-
-
-
-
Integration, Cointegration, Stationarity
-
-
-