Class CalendarAnomalies
java.lang.Object
com.quantfinlib.alpha.CalendarAnomalies
Calendar anomaly profiles — day-of-week and turn-of-month seasonality
with the t-statistics that keep them honest. The honest part is the
POINT: most published calendar anomalies (the weekend effect, the
January effect) decayed or died after publication, and the difference
between a tradable seasonal and a data-mined ghost is a t-stat that
survives out of sample. This class hands you the profile AND the
significance; treat |t| < 2 as decoration, and re-test out of
sample before believing anything (see
AlphaValidation).
Turn-of-month windows use CALENDAR days of month (last
daysBeforeMonthEnd calendar days + first
daysAfterMonthStart), not trading days — stated, not hidden;
with daily equity data the difference is a day around holidays.
Timestamps are interpreted in UTC. Static, deterministic, research
lane.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPer-day-of-week profile, indexed Monday = 0 … Sunday = 6.static final recordThe turn-of-month split, with a Welch t-stat on the difference. -
Method Summary
Modifier and TypeMethodDescriptiondayOfWeek(double[] returns, long[] epochMillis) turnOfMonth(double[] returns, long[] epochMillis, int daysBeforeMonthEnd, int daysAfterMonthStart)
-
Method Details
-
dayOfWeek
- Parameters:
returns- per-period returns aligned withepochMillis
-
turnOfMonth
public static CalendarAnomalies.TurnOfMonth turnOfMonth(double[] returns, long[] epochMillis, int daysBeforeMonthEnd, int daysAfterMonthStart) - Parameters:
daysBeforeMonthEnd- calendar days at month end in the window, ≥ 0daysAfterMonthStart- calendar days at month start in the window, ≥ 0 (at least one of the two > 0)
-