{
  "nbformat": 4,
  "nbformat_minor": 5,
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "pygments_lexer": "ipython3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# 15 Crack gap\n",
        "\n",
        "Does the correlation between the crack's distance from its pre-2020 median and the next five-print RWTC return keep its sign after 2019?\n",
        "\n",
        "Holdout starts 2020-01-01. Verdict: failed.\n",
        "\n",
        "CRACK_321 minus its train median. Train median 16.739 dollars per barrel. CRACK_321 is ((2 * RBOB_F1 + HO_F1) / 3) * 42 minus RCLC1. A date is absent when any input is absent. The futures workbooks end before the spot series."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {},
      "source": [
        "import json\n",
        "from pathlib import Path\n",
        "studies = json.loads(Path('data/studies.json').read_text())\n",
        "study = next(item for item in studies['studies'] if item['slug'] == 'crack-gap')\n",
        "print(study['verdict'])\n",
        "print(study['verdict_line'])\n",
        "print(study['table']['caption'])\n",
        "for row in study['table']['rows']:\n",
        "    print(' | '.join(row))\n"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "failed\n",
            "Train correlation of the crack gap with the next five-print RWTC return is 0.036. Holdout correlation is -0.030. The holdout flipped the train sign.\n",
            "Crack minus the frozen train median, versus the next five RWTC prints\n",
            "Train | 3371 | 0.036\n",
            "Holdout | 1066 | -0.030\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Method\n",
        "\n",
        "The bar is sign agreement of the correlation. A rich crack is not given a second rule after the result is in.\n",
        "\n",
        "## Result\n",
        "\n",
        "Train correlation of the crack gap with the next five-print RWTC return is 0.036. Holdout correlation is -0.030. The holdout flipped the train sign."
      ]
    }
  ]
}
