Skip to content

Commit 5ec0661

Browse files
authored
Merge pull request Auquan#10 from Auquan/model-selecton
Model selecton
2 parents 11a3b09 + 27fb4b5 commit 5ec0661

4 files changed

Lines changed: 312 additions & 11 deletions

File tree

Time Series Analysis - 1.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"\n",
120120
"The random component is called the residual or error - the difference between our predicted value(s) and the observed value(s). Serial correlation is when the residuals (errors) of our TS models are correlated with each other. It tells us how sequential observations in a time series affect each other. If we can find structure in these observations then it will likely help us improve our forecasts and simulation accuracy. This will lead to greater profitability in our trading strategies or better risk management approaches.\n",
121121
"\n",
122-
"Formally, for a covariance-stationary time series (as #3 above, where covariance between sequential observations is not a function of time), autocorrelation $\\rho_k$ for lag $k$ (the number of time steps separating two sequantial observations), $$\\rho_k = E[(x_t\\mu)(x_t+k−\\mu)]/\\sigma^2$$\n",
122+
"Formally, for a covariance-stationary time series (as #3 above, where covariance between sequential observations is not a function of time), autocorrelation $\\rho_k$ for lag $k$ (the number of time steps separating two sequantial observations), $$\\rho_k = E[(x_t - \\mu)(x_t + k - \\mu)]/\\sigma^2$$\n",
123123
"\n",
124124
"### Why Do We Care about Serial Correlation? \n",
125125
"\n",
@@ -250,8 +250,8 @@
250250
"\n",
251251
"A random walk is a time series model where the value of the time series variable increases or decreases (step up or down) with equal probability at each time step, that is the expected value of current observation is equal to the previous observation. It is formally defined below:\n",
252252
"\n",
253-
"$$x_t=x_{t1}+w_t$$ , where $w_t$ is a discrete white noise series.\n",
254-
"$$E[x_t]=x_{t1}$$\n",
253+
"$$x_t=x_{t-1}+w_t$$ , where $w_t$ is a discrete white noise series.\n",
254+
"$$E[x_t]=x_{t-1}$$\n",
255255
"\n",
256256
"The significance of a random walk is that it is non-stationary because while the mean of a random walk is still zero, the covariance is actually time-dependent. In particular, the covariance is equal to the variance multiplied by the time. Hence, as time increases, so does the variance.\n",
257257
"\n",

Time Series Analysis - 2.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"### Autoregressive Models of order p $AR(p)$\n",
118118
"\n",
119119
"The autoregressive model is simply an extension of the random walk. It is essentially a regression model which depends linearly on the previous terms:\n",
120-
"$$x_t = \\alpha_1x_{t1}+…+\\alpha_px_{tp}+w_t = \\sum_{i=1}^{p} t_i\\alpha_ix_{ti}+w_t$$\n",
120+
"$$x_t = \\alpha_1x_{t-1}+…+\\alpha_px_{t-p}+w_t = \\sum_{i=1}^{p} t_i\\alpha_ix_{t-i}+w_t$$\n",
121121
"\n",
122122
"This is an AR model of order \"p\",where $p$ represents the number of previous (or lagged) terms used within the model, $\\alpha_i$ is the coefficient, and $w_t$ is a white noise term. Note that an AR(1) model with $\\alpha_1$ set equal to 1 is a random walk!\n",
123123
"\n",
@@ -455,7 +455,7 @@
455455
"\n",
456456
"A key difference is that the MA model will only ever see the last q shocks for any particular MA(q) model, whereas the AR(p) model will take all prior shocks into account, albeit in a decreasingly weak manner.\n",
457457
"\n",
458-
"$$x_t=w_t+\\beta_1w_{t1}+…+\\beta_qw_{tq}$$ \n",
458+
"$$x_t=w_t+\\beta_1w_{t-1}+…+\\beta_qw_{t-q}$$ \n",
459459
"\n",
460460
"Where $w_t$ is white noise with $E(w_t)=0$ and variance $\\sigma^2$\n",
461461
"\n",

Time Series Analysis - 3.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"\n",
122122
"Hence, an ARMA model attempts to capture both of these aspects when modelling financial time series. Note that an ARMA model does not take into account volatility clustering, a key empirical phenomena of many financial time series. \n",
123123
"\n",
124-
"$$x_t=\\alpha_1x_{t1}+…+\\alpha_px_{tp}+w_t+\\beta_1w_{t1}+…+\\beta_qw_{tq}$$ \n",
124+
"$$x_t=\\alpha_1x_{t-1}+…+\\alpha_px_{t-p}+w_t+\\beta_1w_{t-1}+…+\\beta_qw_{t-q}$$ \n",
125125
"\n",
126126
"Where $w_t$ is white noise with $E(w_t)=0$ and variance $\\sigma^2$\n",
127127
"\n",

Time Series Analysis - 4.ipynb

Lines changed: 306 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)