diff --git a/experiments/playgroung.ipynb b/experiments/playgroung.ipynb deleted file mode 100644 index 12e1f15..0000000 --- a/experiments/playgroung.ipynb +++ /dev/null @@ -1,492 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from utils import *\n", - "import pandas as pd\n", - "\n", - "# autoreload \n", - "%load_ext autoreload\n", - "%autoreload 2" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "prices = pd.read_csv(\"../data/prices.csv\", index_col=0, parse_dates=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "0.1414213562373095" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np.sqrt(0.02)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "returns = synthetic_returns(prices)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "returns2 = prices.pct_change()" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[1. , 0.14747197],\n", - " [0.14747197, 1. ]])" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np.corrcoef(returns2.dropna().values.flatten(), returns.dropna().values.flatten())" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
T0T1T3T4T5T6T7T8T9T10...T89T90T92T93T94T95T96T98T99T100
2000-01-04NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2000-01-05-0.0014540.0003800.0059090.003457-0.005594-0.0056610.0068960.0007600.0019630.007932...0.007658-0.003752-0.001921-0.001777-0.0005610.002421-0.000910-0.0050580.0055280.001457
2000-01-06-0.005067-0.0016870.000715-0.000934-0.0003320.0014530.002840-0.000088-0.000333-0.001227...-0.004984-0.0021190.002004-0.0018330.0026700.001595-0.0053300.0020260.003262-0.006554
2000-01-070.005604-0.000995-0.000164-0.004608-0.008584-0.0003060.004896-0.0019710.0017720.000841...0.0057920.0011420.0047150.0001730.0033280.0015180.009072-0.0044460.001961-0.004652
2000-01-100.0010930.0010360.0018080.000430-0.001655-0.001340-0.0062310.007149-0.005827-0.003586...-0.0047410.0038900.0004240.0025440.002860-0.0028890.001497-0.003636-0.0009240.003583
..................................................................
2023-09-200.0006720.0033780.003179-0.0057610.0034750.001039-0.000845-0.002282-0.003364-0.002279...-0.0017700.0022490.002883-0.003437-0.0055060.0026030.001204-0.0031500.0036820.000884
2023-09-21-0.0040140.000238-0.0023010.000503-0.0025540.001577-0.0003180.0073580.000760-0.005215...-0.0021960.009500-0.003946-0.000513-0.002119-0.0013170.0012330.0011150.0012660.001024
2023-09-22-0.0019840.003389-0.0039660.0055490.002383-0.0053220.000990-0.0006380.0025610.003347...-0.0022770.003851-0.000812-0.000530-0.005350-0.006388-0.0043310.0002080.003962-0.001164
2023-09-250.001255-0.0004910.000934-0.0034860.0028230.0009360.0011780.0026760.000966-0.000768...-0.002975-0.0024040.005076-0.001225-0.002615-0.0015260.0060410.0014510.0012800.001500
2023-09-26-0.002724-0.0033380.0019980.0018340.0001550.000516-0.0032930.003096-0.004128-0.001218...0.004620-0.002510-0.0035030.008428-0.001012-0.000826-0.000012-0.0000550.0009070.003052
\n", - "

6191 rows × 75 columns

\n", - "
" - ], - "text/plain": [ - " T0 T1 T3 T4 T5 T6 \\\n", - "2000-01-04 NaN NaN NaN NaN NaN NaN \n", - "2000-01-05 -0.001454 0.000380 0.005909 0.003457 -0.005594 -0.005661 \n", - "2000-01-06 -0.005067 -0.001687 0.000715 -0.000934 -0.000332 0.001453 \n", - "2000-01-07 0.005604 -0.000995 -0.000164 -0.004608 -0.008584 -0.000306 \n", - "2000-01-10 0.001093 0.001036 0.001808 0.000430 -0.001655 -0.001340 \n", - "... ... ... ... ... ... ... \n", - "2023-09-20 0.000672 0.003378 0.003179 -0.005761 0.003475 0.001039 \n", - "2023-09-21 -0.004014 0.000238 -0.002301 0.000503 -0.002554 0.001577 \n", - "2023-09-22 -0.001984 0.003389 -0.003966 0.005549 0.002383 -0.005322 \n", - "2023-09-25 0.001255 -0.000491 0.000934 -0.003486 0.002823 0.000936 \n", - "2023-09-26 -0.002724 -0.003338 0.001998 0.001834 0.000155 0.000516 \n", - "\n", - " T7 T8 T9 T10 ... T89 T90 \\\n", - "2000-01-04 NaN NaN NaN NaN ... NaN NaN \n", - "2000-01-05 0.006896 0.000760 0.001963 0.007932 ... 0.007658 -0.003752 \n", - "2000-01-06 0.002840 -0.000088 -0.000333 -0.001227 ... -0.004984 -0.002119 \n", - "2000-01-07 0.004896 -0.001971 0.001772 0.000841 ... 0.005792 0.001142 \n", - "2000-01-10 -0.006231 0.007149 -0.005827 -0.003586 ... -0.004741 0.003890 \n", - "... ... ... ... ... ... ... ... \n", - "2023-09-20 -0.000845 -0.002282 -0.003364 -0.002279 ... -0.001770 0.002249 \n", - "2023-09-21 -0.000318 0.007358 0.000760 -0.005215 ... -0.002196 0.009500 \n", - "2023-09-22 0.000990 -0.000638 0.002561 0.003347 ... -0.002277 0.003851 \n", - "2023-09-25 0.001178 0.002676 0.000966 -0.000768 ... -0.002975 -0.002404 \n", - "2023-09-26 -0.003293 0.003096 -0.004128 -0.001218 ... 0.004620 -0.002510 \n", - "\n", - " T92 T93 T94 T95 T96 T98 \\\n", - "2000-01-04 NaN NaN NaN NaN NaN NaN \n", - "2000-01-05 -0.001921 -0.001777 -0.000561 0.002421 -0.000910 -0.005058 \n", - "2000-01-06 0.002004 -0.001833 0.002670 0.001595 -0.005330 0.002026 \n", - "2000-01-07 0.004715 0.000173 0.003328 0.001518 0.009072 -0.004446 \n", - "2000-01-10 0.000424 0.002544 0.002860 -0.002889 0.001497 -0.003636 \n", - "... ... ... ... ... ... ... \n", - "2023-09-20 0.002883 -0.003437 -0.005506 0.002603 0.001204 -0.003150 \n", - "2023-09-21 -0.003946 -0.000513 -0.002119 -0.001317 0.001233 0.001115 \n", - "2023-09-22 -0.000812 -0.000530 -0.005350 -0.006388 -0.004331 0.000208 \n", - "2023-09-25 0.005076 -0.001225 -0.002615 -0.001526 0.006041 0.001451 \n", - "2023-09-26 -0.003503 0.008428 -0.001012 -0.000826 -0.000012 -0.000055 \n", - "\n", - " T99 T100 \n", - "2000-01-04 NaN NaN \n", - "2000-01-05 0.005528 0.001457 \n", - "2000-01-06 0.003262 -0.006554 \n", - "2000-01-07 0.001961 -0.004652 \n", - "2000-01-10 -0.000924 0.003583 \n", - "... ... ... \n", - "2023-09-20 0.003682 0.000884 \n", - "2023-09-21 0.001266 0.001024 \n", - "2023-09-22 0.003962 -0.001164 \n", - "2023-09-25 0.001280 0.001500 \n", - "2023-09-26 0.000907 0.003052 \n", - "\n", - "[6191 rows x 75 columns]" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "returns" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.12" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -}