Skip to content

Commit bcb88bb

Browse files
author
Lela Boermeester
committed
format
1 parent 66ea0cd commit bcb88bb

1 file changed

Lines changed: 55 additions & 11 deletions

File tree

ch1.ipynb

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,36 +1243,72 @@
12431243
},
12441244
{
12451245
"cell_type": "markdown",
1246-
"id": "6cfe6035-99a3-4502-82e3-4fce712304eb",
1246+
"id": "0515579c-6b1b-4c77-863e-79ea0ee097f3",
12471247
"metadata": {},
12481248
"source": [
1249-
"Predictor corrector (SES)\n",
1249+
"**Predictor corrector (SES)**\n",
1250+
"\n",
1251+
"\\begin{align}\n",
1252+
"\\ell_t = \\ell_{t-1} + &\\alpha (y_t - \\ell_{t-1}) \\\\\n",
1253+
"&\\text{In words} \\\\\n",
1254+
"\\text{New Prediction = old prediction +} & \\text{weighted*(observation - old prediction)}\n",
1255+
"\\end{align}\n",
12501256
"\n",
1251-
"$\\ell_t = \\ell_{t-1} + \\alpha (y_t - \\ell_{t-1})$\n",
1257+
"**One Step ahead Prediction:**\n",
12521258
"\n",
1253-
"New Prediction = old prediction + weighted*(observation - old prediction)\n",
1259+
"\\begin{align}\n",
1260+
"\\ell_t &= \\ell_{t-1} + K \\, T_{t-1} \\\\\n",
1261+
"\\text{where }& K \\text{ is the number of timesteps into the future.} \\\\\n",
1262+
"\\text{If }& K=1,\\quad \\ell_t = \\ell_{t-1} + T_{t-1}\n",
1263+
"\\end{align}\n",
12541264
"\n",
1265+
"**Continuation of Predictor corrector**"
1266+
]
1267+
},
1268+
{
1269+
"cell_type": "markdown",
1270+
"id": "6cfe6035-99a3-4502-82e3-4fce712304eb",
1271+
"metadata": {},
1272+
"source": [
12551273
"\n",
1256-
"then you go into Before:\n",
1274+
"Before:\n",
12571275
"\n",
12581276
"$\\ell_t = \\alpha y_t + \\ell_{t-1} (1-\\alpha)$\n",
12591277
"\n",
12601278
"$\\ell_t=\\ell_{t-1}$\n",
12611279
"\n",
1262-
"\n",
12631280
"After:\n",
12641281
"\n",
12651282
"T: Trend -> Change in level \n",
12661283
"\n",
12671284
"$(\\ell-\\ell_{t-1})$ -> obersvation of the trend (slope)\n",
12681285
"\n",
1269-
"Beta: Another constant \n",
1286+
"Beta: Another constant, $ 0 \\le \\beta \\le 1$\n",
1287+
"\n",
1288+
"$\\ell_t = \\ell_{t-1} + K * T_{t-1}$\n",
1289+
"\n",
1290+
"$\\ell_t=(\\ell_{t-1} + T_{t-1})+\\alpha(y_t-[\\ell_{t-1}+T_{t-1}])$\n",
12701291
"\n",
1271-
"$\\ell_t = \\ell_{t-1} + K * T_{T-1}$\n",
1292+
"$T_t=T_{t-1}+\\beta((\\ell-\\ell_{t-1})-T_{t-1})$\n",
12721293
"\n",
1273-
"$\\ell_t=(\\ell_{t-1} + T_{T-1})+\\alpha(y_t-[\\ell_{t-1}+T_{T-1}])$\n",
12741294
"\n",
1275-
"$T_t=T_{t-1}+\\beta((\\ell-\\ell_{t-1})-T_{T-1})$\n",
1295+
"To continue the Predictor-Corrector idea\n",
1296+
"\n",
1297+
"Prediciton: $\\ell_t=(\\ell_{t-1} + T_{t-1})$\n",
1298+
"\n",
1299+
"The corrector now includes not only the level but the trend as well.\n",
1300+
"\n",
1301+
"$\\ell_t=(\\ell_{t-1} + T_{t-1})+\\color{red}\\alpha(y_t-[\\ell_{t-1}+T_{t-1}]) $\n",
1302+
"\n",
1303+
"To get the trend estimates:\n",
1304+
"\n",
1305+
"$T_t=T_{t-1}+\\beta((?)-T_{t-1})$\n",
1306+
"\n",
1307+
"We can make an asummption that since we have $\\ell_t$ as known componts we can use the differece between two times steps to be the \"slope\" or observation of the trend.\n",
1308+
"\n",
1309+
"$T_t=T_{t-1}+\\beta(\\color{red}(\\ell-\\ell_{t-1})\\color{black}-T_{t-1})$\n",
1310+
"\n",
1311+
"This equation updates the trend of the current time step based on the different between previous level estimates.\n",
12761312
"\n",
12771313
"Known componets:\n",
12781314
"\n",
@@ -1283,7 +1319,7 @@
12831319
"$\\ell=(\\ell_1, \\ell_2, \\ell_3...\\ell_t)$\n",
12841320
"\n",
12851321
"Estimated trends :\n",
1286-
"$T=(T_1,T_2,T_3...T_{T-1})$\n",
1322+
"$T=(T_1,T_2,T_3...T_{t-1})$\n",
12871323
"\n"
12881324
]
12891325
},
@@ -1294,6 +1330,14 @@
12941330
"metadata": {},
12951331
"outputs": [],
12961332
"source": []
1333+
},
1334+
{
1335+
"cell_type": "code",
1336+
"execution_count": null,
1337+
"id": "2980aa18-1760-4a00-8471-2503a7943dea",
1338+
"metadata": {},
1339+
"outputs": [],
1340+
"source": []
12971341
}
12981342
],
12991343
"metadata": {

0 commit comments

Comments
 (0)