{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Applying CCM Using causal-ccm package\n", "In this section we show how we can use `causal-ccm` package to infer causality." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Install CCM and Load Packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# !pip install causal-ccm" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "from causal_ccm.causal_ccm import ccm\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "### Just to remove warnings to prettify the notebook. \n", "import warnings\n", "warnings.filterwarnings(\"ignore\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load Dataset" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Time | \n", "Rain | \n", "ONI | \n", "NIA | \n", "Dam | \n", "
---|---|---|---|---|---|
0 | \n", "0 | \n", "0.0 | \n", "-0.7 | \n", "38.225693 | \n", "100.70 | \n", "
1 | \n", "1 | \n", "0.0 | \n", "-0.7 | \n", "57.996530 | \n", "100.63 | \n", "
2 | \n", "2 | \n", "0.0 | \n", "-0.7 | \n", "49.119213 | \n", "100.56 | \n", "
3 | \n", "3 | \n", "0.0 | \n", "-0.7 | \n", "47.034720 | \n", "100.55 | \n", "
4 | \n", "4 | \n", "0.0 | \n", "-0.7 | \n", "42.223380 | \n", "100.48 | \n", "