numeraire_dataset.load_daniel_moskowitz_momentum#
- numeraire_dataset.load_daniel_moskowitz_momentum(path: str | Path, *, contract: DanielMoskowitzArchiveContract) DanielMoskowitzMomentumData[source]#
Load caller-supplied Daniel–Moskowitz daily/monthly momentum deciles.
This is a path-only, never-download adapter for
DM_data_2014_02.tar.gz. It reads the compressed file once, validates every member in memory, and never extracts, copies, caches, or persists archive bytes. The tar envelope must contain exactly the twelve root-level regular text files documented by the authors; unexpected paths, links, devices, duplicate names, and unsafe size/compression or text-record/field envelopes fail closed. Secure traversal of every source-path component requires POSIXdir_fdandO_NOFOLLOWsupport; platforms without those primitives fail closed before reading the archive.The authors document member names and portfolio semantics but not a machine-readable delimiter, header, or column layout. A frozen
DanielMoskowitzArchiveContractis therefore required: callers explicitly name date/decile columns, date formats, units, data-record bounds, and any expected SHA/date/row identity envelope. No paper-exact columns are guessed. Both returned frames have exactlydate, decile_1, ..., decile_10, wml; returns are decimal simple returns andwmlis the documented long-decile-10 minus short-decile-1 arithmetic. Monthly dates are normalized to month-end, monthly continuity is required, daily trading dates remain untouched, and the paired members must cover exactly the same months.frame_provenance()on either frame records the actual archive SHA-256, selected and paired member names/SHA-256 values, an all-member manifest digest, parser-contract hash, unit recipe, date/row envelope, andredistributable=falsewithout retaining the local path. Unless the caller supplies expected archive/member hashes, provenance labels identity as recorded but not fully caller-pinned; the loader never establishes a paper-exact claim by itself.The archive supplies momentum portfolios only. It does not supply the separate monthly market total return, daily market excess return, or risk-free series needed to build the paper’s panic-state and conditional-moment inputs. Those must come from separately versioned sources.