Rewrite as a probabilistic model with walk-forward evaluation.

Replace the 2024 model (model.py, ~2000 lines) with the btcmodel package, the
baseline for future work:

- Forecasts are quantiles of log price at each horizon, scored with CRPS in a
  walk-forward backtest (origins every 30 days from 2014, horizons 1 month to
  4 years). Skill is relative to a zero-drift random walk, with circular
  block-bootstrap intervals and a count of independent windows.
- Development data stops at 2024-11-26, the last day the 2024 model saw.
  Later outcomes are a holdout, scored only by `backtest --holdout`.
- Models: random_walk, drift_rw, and cycle (the 2024 model's cycle-position
  drift, now kernel-smoothed and recency-weighted). On development data
  nothing beats the random walk with confidence; cycle loses at every horizon.
- Prices: the Investing.com archive moves to data/ (cut at 2024-11-26; its
  last row was intraday) and is extended with Coinbase daily closes by
  `update`.

Also: Nix flake dev shell (Python 3.13, pandas 3), ruff in place of black,
pytest suite, and a rewritten README. NOTES.md is removed as inaccurate, and
poetry is dropped.
This commit is contained in:
sam
2026-09-24 02:19:02 -07:00
parent eefff47070
commit cfc27a38de
24 changed files with 1767 additions and 3124 deletions
+20 -14
View File
@@ -1,18 +1,24 @@
[tool.poetry]
name = "bitcoin-model"
version = "0.1.0"
description = ""
authors = ["Anthropic Claude <[email protected]>", "Sam Fredrickson <[email protected]>"]
[project]
name = "btcmodel"
version = "0.2.0"
description = "Probabilistic Bitcoin price model"
authors = [
{ name = "Anthropic Claude", email = "[email protected]" },
{ name = "Sam Fredrickson", email = "[email protected]" },
]
readme = "README.md"
requires-python = ">=3.13"
dependencies = ["numpy>=2", "pandas>=3", "scipy>=1.14", "matplotlib>=3.9"]
[tool.poetry.dependencies]
python = "^3.13"
pandas = "^2.2.3"
matplotlib = "^3.9.2"
seaborn = "^0.13.2"
scipy = "^1.14.1"
[dependency-groups]
dev = ["pytest", "ruff"]
[tool.ruff]
line-length = 100
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]