Skip to content

Commit

Permalink
Removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
filipinascimento authored Aug 26, 2021
1 parent c81d15c commit 7720f43
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions Notebooks/CalculateMetrics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -599,75 +599,6 @@
" saveMetricData(\"LaggedCorrelation\",smoothWindowSize,lagDays,np.array(laggedPValuesXY),np.abs(laggedPValuesXY),gridRegions=gridRegions);\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Plotting correlation and best lag distributions for the general model\n",
"plt.close(\"all\")\n",
"fig, (ax1,ax2) = plt.subplots(1, 2,figsize=(10,4))\n",
"bins = np.linspace(0.0,0.3,100);\n",
"ax1.hist(np.abs(distribsGeneral),bins=bins,color=\"#999999\",alpha=0.5,density=True,label=\"Null model\");\n",
"ax1.set_xlim(0,0.4)\n",
"ax1.hist(np.abs(correlationValues),bins=bins,alpha=0.5,density=True,label=\"Data\");\n",
"ax1.set_xlabel(\"Lagged correlation\")\n",
"ax1.set_ylabel(\"Density\")\n",
"ax1.set_title(\"Lagged correlation distribution\")\n",
"ax1.legend()\n",
"\n",
"ax2.hist(lagsSurrogate,bins=np.arange(0,order+1),color=\"#999999\",alpha=0.5,density=True,label=\"Null model\");\n",
"ax2.hist(lags,bins=np.arange(0,order+1),alpha=0.5,density=True,label=\"Data\");\n",
"ax2.set_xlabel(\"Best lag\")\n",
"ax2.set_ylabel(\"Density\")\n",
"ax2.set_title(\"Best lag distribution\")\n",
"ax2.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Plotting Lagged correlation and best lags distributions\n",
"fig, (ax1,ax2) = plt.subplots(1, 2,figsize=(10,4))\n",
"bins = np.linspace(0.0,0.3,100);\n",
"ax1.hist(np.abs(distribs.flatten()),bins=bins,color=\"#999999\",alpha=0.1,density=True,label=\"Null model\");\n",
"\n",
"distribAverages = np.average(np.abs(distribs),axis=0);\n",
"distribStds = np.std(np.abs(distribs),axis=0);\n",
"top = np.argmax(distribAverages)\n",
"bottom = np.argmin(distribAverages);\n",
"ax1.axvline(np.abs(correlationValues)[top],color=\"#bb0000\")\n",
"ax1.hist(np.abs(distribs[:,top]),bins=bins,color=\"#bb0000\",alpha=0.3,density=True,label=\"Highest Avg. P\");\n",
"ax1.axvline(np.abs(correlationValues)[bottom],color =\"#00bb00\" )\n",
"ax1.hist(np.abs(distribs[:,bottom]),bins=bins,color=\"#00bb00\",alpha=0.3,density=True,label=\"Lowest Avg. P\");\n",
"ax1.set_xlim(0,0.4)\n",
"ax1.hist(np.abs(correlationValues),bins=bins,alpha=0.5,density=True,label=\"Data\");\n",
"ax1.set_xlabel(\"Lagged Correlation\")\n",
"ax1.set_ylabel(\"Density\")\n",
"ax1.set_title(\"Lagged correlation distribution\")\n",
"ax1.legend()\n",
"\n",
"ax2.hist(lagsSurrogate,bins=np.arange(0,order+1),color=\"#999999\",density=True);\n",
"ax2.hist(lags,bins=np.arange(0,order+1),alpha=0.5,density=True);\n",
"ax2.set_xlabel(\"Best lag\")\n",
"ax2.set_ylabel(\"Density\")\n",
"ax2.set_title(\"Best lag distribution\")\n",
"# plt.savefig(\"Figures/CorrelationWithLag.pdf\")\n",
"plt.show()\n",
"\n",
"# fig, (ax1) = plt.subplots(1, 1)\n",
"# ax1.scatter(lags,correlationValues,alpha=0.02);\n",
"# ax1.set_xlabel(\"Corr.\")\n",
"# ax1.set_ylabel(\"Lag\")\n",
"# plt.show()\n",
"# plt.savefig(\"Figures/CorrelationVsWithLag.pdf\")"
]
}
],
"metadata": {
Expand Down

0 comments on commit 7720f43

Please sign in to comment.