Class FamaMacBeth

java.lang.Object
com.quantfinlib.alpha.FamaMacBeth

public final class FamaMacBeth extends Object
Fama-MacBeth (1973, J. Political Economy 81(3)) cross-sectional regression: what a factor exposure is worth per period in return space. Two passes:
  1. each period, regress the cross-section of forward returns on that period's exposures (with intercept), giving one premium estimate λ_t per factor;
  2. the premium is the time-series mean of the λ_t, with a time-series standard error. Each period contributes one observation per factor, which absorbs the cross-sectional correlation that wrecks a pooled regression's errors.

Standard errors are Newey-West (1987) on the λ_t series. With horizon-bar forward returns sampled every bar the λ_t overlap and are mechanically MA(horizon−1); the lag used is max(horizon − 1, Andrews 1991 AR(1) plug-in) per series. The iid t-stats are kept as naiveTStats for comparison. No Shanken (1992) errors-in-variables correction is applied: exposures here are observed characteristics (scores), not estimated betas, so the correction does not apply; pass estimated betas and it would.

Each cross-section is solved by Householder QR (Ols), not the normal equations. With standardize = true each exposure column is winsorised at mean ± 3 standard deviations and then z-scored per period, so one outlier cannot own the cross-section and premia are per unit of cross-sectional standard deviation.

NaN entries (asset not in that period's cross-section) are skipped per period; periods with fewer assets than factors + 2, or with a collinear design, are skipped and not counted. Infinite values throw.

  • Method Details

    • fit

      public static FamaMacBeth.Result fit(double[][][] exposures, double[][] forwardReturns)
      One-bar forward returns, raw exposures.
    • fit

      public static FamaMacBeth.Result fit(double[][][] exposures, double[][] forwardReturns, int horizon, boolean standardize)
      Fits the Fama-MacBeth (1973) two-pass cross-sectional regression.
      Parameters:
      exposures - exposures[t][asset][factor], the loadings known at t
      forwardReturns - forwardReturns[t][asset], realised after t
      horizon - bars spanned by each forward return; consecutive periods overlap by horizon − 1 bars when periods are one bar apart
      standardize - winsorise and z-score exposures per period