← ClaudeAtlas

factor-modelslisted

Build long-short factor portfolios from a characteristic panel and test the alpha with standard errors that survive serial correlation. TRIGGER - factor model, Fama-French, Fama-MacBeth, cross-sectional regression, decile or quintile long-short sort, 2x3 sort, SMB and HML, value- weight vs equal-weight portfolio, characteristic panel, alpha t-stat, Newey-West, HAC standard errors, cov_type="HAC" maxlags, Ken French Data Library, F-F_Research_Data_Factors, book-to- market, 11-1 momentum; "my factor has a t-stat of 15", "should I lag the signal", "my HML does not match Ken French", "joining monthly factors to daily returns". SKIP for scoring one alpha signal with alphalens, IC decay or GARCH (factor-and-timeseries-research), for the covariance matrix a factor model implies (covariance-and-risk-models), for turning expected returns into weights (portfolio-optimizers), and for counting the specifications you tried (backtest-validation).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Factor models **A factor portfolio is a subscript problem before it is a statistics problem.** The formula for HML is public and takes one line; what decides whether your HML is a factor or a look-ahead is *when* the characteristic was measured relative to the return it earns. Get that wrong and the t-statistic is not weak evidence, it is manufactured evidence, and every standard error correction downstream is beside the point. > **characteristic known at t -> portfolio formed at t -> return measured over t -> t+1** Every number below is printed by `scripts/factor_regression.py` (numpy / pandas, seed 0, about 3 s, statsmodels optional). The panel is 500 stocks x 240 months in which **the truth is alpha = 0 and there is no value premium**: `r_it = beta_i * m_t + e_it`, book equity is a slow random walk, so book-to-market moves almost entirely with the stock's own price. Anything a sort finds in it is an artefact. ## 1. 🚨 Forming on the contemporaneous characteristic manufactures the alpha ✅ Measured, seed 0, top 30 % minus bottom 30 %, re-sorted monthly, Newey-West lags `floor(4(T/100)^(2/9))` = 4. `mean` and `CAPM a` are percent per month; `CAPM a` is the intercept of the long-short return on the value-weighted market: | formation | mean %/mo | NW t | CAPM alpha % | HAC t | beta | |---|---|---|---|---|---| | **lag 1, value-weight** (B/M at t-1) | -0.071 | -0.67 | **+0.002** | **0.02** | -0.13 | | lag 1, equal-weight | -0.038 | -0.47 | -0.003 | -0.03 | -0.07 | | lag 6