Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
msikorski93 authored Dec 9, 2021
1 parent da30771 commit 64ce788
Showing 1 changed file with 42 additions and 20 deletions.
62 changes: 42 additions & 20 deletions inflation_forecast_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0xc24daf0>"
"<matplotlib.axes._subplots.AxesSubplot at 0xb183238>"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -835,18 +835,18 @@
"text": [
"Performing stepwise search to minimize aic\n",
" ARIMA(2,2,2)(0,0,0)[0] : AIC=332.745, Time=0.29 sec\n",
" ARIMA(0,2,0)(0,0,0)[0] : AIC=420.078, Time=0.03 sec\n",
" ARIMA(0,2,0)(0,0,0)[0] : AIC=420.078, Time=0.02 sec\n",
" ARIMA(1,2,0)(0,0,0)[0] : AIC=399.241, Time=0.03 sec\n",
" ARIMA(0,2,1)(0,0,0)[0] : AIC=361.354, Time=0.05 sec\n",
" ARIMA(1,2,2)(0,0,0)[0] : AIC=330.280, Time=0.25 sec\n",
" ARIMA(0,2,1)(0,0,0)[0] : AIC=361.354, Time=0.07 sec\n",
" ARIMA(1,2,2)(0,0,0)[0] : AIC=330.280, Time=0.23 sec\n",
" ARIMA(0,2,2)(0,0,0)[0] : AIC=333.189, Time=0.13 sec\n",
" ARIMA(1,2,1)(0,0,0)[0] : AIC=328.746, Time=0.17 sec\n",
" ARIMA(2,2,1)(0,0,0)[0] : AIC=330.214, Time=0.27 sec\n",
" ARIMA(2,2,1)(0,0,0)[0] : AIC=330.214, Time=0.25 sec\n",
" ARIMA(2,2,0)(0,0,0)[0] : AIC=384.237, Time=0.05 sec\n",
" ARIMA(1,2,1)(0,0,0)[0] intercept : AIC=inf, Time=0.54 sec\n",
" ARIMA(1,2,1)(0,0,0)[0] intercept : AIC=inf, Time=0.53 sec\n",
"\n",
"Best model: ARIMA(1,2,1)(0,0,0)[0] \n",
"Total fit time: 1.821 seconds\n"
"Total fit time: 1.852 seconds\n"
]
},
{
Expand All @@ -861,10 +861,10 @@
" <th>Model:</th> <td>SARIMAX(1, 2, 1)</td> <th> Log Likelihood </th> <td>-161.373</td>\n",
"</tr>\n",
"<tr>\n",
" <th>Date:</th> <td>Tue, 07 Dec 2021</td> <th> AIC </th> <td>328.746</td>\n",
" <th>Date:</th> <td>Thu, 09 Dec 2021</td> <th> AIC </th> <td>328.746</td>\n",
"</tr>\n",
"<tr>\n",
" <th>Time:</th> <td>00:56:13</td> <th> BIC </th> <td>339.827</td>\n",
" <th>Time:</th> <td>13:24:02</td> <th> BIC </th> <td>339.827</td>\n",
"</tr>\n",
"<tr>\n",
" <th>Sample:</th> <td>0</td> <th> HQIC </th> <td>333.182</td>\n",
Expand Down Expand Up @@ -912,8 +912,8 @@
"==============================================================================\n",
"Dep. Variable: y No. Observations: 299\n",
"Model: SARIMAX(1, 2, 1) Log Likelihood -161.373\n",
"Date: Tue, 07 Dec 2021 AIC 328.746\n",
"Time: 00:56:13 BIC 339.827\n",
"Date: Thu, 09 Dec 2021 AIC 328.746\n",
"Time: 13:24:02 BIC 339.827\n",
"Sample: 0 HQIC 333.182\n",
" - 299 \n",
"Covariance Type: opg \n",
Expand Down Expand Up @@ -988,10 +988,10 @@
" <th>Model:</th> <td>ARIMA(2, 0, 1)</td> <th> Log Likelihood </th> <td>-163.645</td>\n",
"</tr>\n",
"<tr>\n",
" <th>Date:</th> <td>Tue, 07 Dec 2021</td> <th> AIC </th> <td>337.290</td>\n",
" <th>Date:</th> <td>Thu, 09 Dec 2021</td> <th> AIC </th> <td>337.290</td>\n",
"</tr>\n",
"<tr>\n",
" <th>Time:</th> <td>00:56:25</td> <th> BIC </th> <td>355.792</td>\n",
" <th>Time:</th> <td>13:24:05</td> <th> BIC </th> <td>355.792</td>\n",
"</tr>\n",
"<tr>\n",
" <th>Sample:</th> <td>01-31-1997</td> <th> HQIC </th> <td>344.695</td>\n",
Expand Down Expand Up @@ -1045,8 +1045,8 @@
"==============================================================================\n",
"Dep. Variable: Rate No. Observations: 299\n",
"Model: ARIMA(2, 0, 1) Log Likelihood -163.645\n",
"Date: Tue, 07 Dec 2021 AIC 337.290\n",
"Time: 00:56:25 BIC 355.792\n",
"Date: Thu, 09 Dec 2021 AIC 337.290\n",
"Time: 13:24:05 BIC 355.792\n",
"Sample: 01-31-1997 HQIC 344.695\n",
" - 11-30-2021 \n",
"Covariance Type: opg \n",
Expand Down Expand Up @@ -1253,14 +1253,36 @@
{
"data": {
"text/plain": [
"0.9844489551560021"
"9.723911074349086"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# mean absolute percentage error\n",
"mape = np.mean(np.abs(df['Rate'] - pred) / df['Rate']) * 100\n",
"mape"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.9844489551560021"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# correlation\n",
"corr = np.corrcoef(pred, df['Rate'])[0,1]\n",
Expand All @@ -1278,7 +1300,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1288,7 +1310,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 24,
"metadata": {
"scrolled": true
},
Expand All @@ -1304,7 +1326,7 @@
"Freq: M, Name: predicted_mean, dtype: float64"
]
},
"execution_count": 23,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1316,7 +1338,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 25,
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit 64ce788

Please sign in to comment.