Showing posts with label Quantitative Methods. Show all posts
Showing posts with label Quantitative Methods. Show all posts

Thursday, 5 January 2012

Suggested Steps in Time-Series Forecasting (Part B) - CFA Level II

4. When serial correlation is detected in the model, AR model should be used. However, before using AR model, time series must be tested for Covariance Stationarity.
· If time series has a linear trend and covariance nonstationary; it can be transformed into covariance stationary by taking the first difference of the data.
· If time series has exponential trend and covariance nonstationary; it can be transformed into covariance stationary by taking natural log of the time series and then taking the first difference.
· If the time series exhibits structural change, two different time-series model (i.e. before & after the shift) must be estimated.
· When time series exhibits seasonality, seasonal lags must be included in the AR model.

5. When time series is converted into Covariance Stationarity, AR model can be used i.e.
· Estimate AR (1) model;
· Test serial correlation in the regression errors; if no serial correlation is found only then AR (1) model can be used. When serial correlation is detected in AR (1), then AR (2) should be used and tested for serial correlation. When no serial correlation is found, AR (2) can be used. If serial correlation is still present, order of AR is kept on increasing until all serial correlation is removed.

6. Plot the data and detect any seasonality. When seasonality is present, add seasonal lags in the model.

7. Test the presence of autoregressive conditional heteroskedasticity in the residuals of the model i.e. using ARCH (1) model.

8. In order to determine the better forecasting model, calculate out-of-sample RMSE of each model and select the model with the lowest out of-sample RMSE.

Wednesday, 4 January 2012

Suggested Steps in Time-Series Forecasting (Part A) - CFA Level II


Following is a guideline to determine an accurate model to predict a time series.

1. Select the model on the basis of objective i.e. if the objective is to predict the future behavior of a variable based on the past behavior of the same variable, use Time series model and if the objective is to predict the future behavior of a variable based on assumed casual relationship with other variables Cross sectional model should be used.

2. When time-series model is used, plot the series to detect Covariance Stationarity in the data. Trends in the time series data include:
· A linear trend
· An exponential trend
· Seasonality
· Structural change i.e. a significant shift in mean or variance of the time series during the sample period.

3. When there is no seasonality or structural change found in the data, linear trend or exponential trend is appropriate to use i.e.
i. Use linear trend model when the data plot on a straight line with an upward or downward slope.
ii. Use log-linear trend model when the plot of the data exhibits a curve.
iii. Estimate the regression model.
iv. Compute the residuals
v. Use Durbin-Watson statistic to test serial correlation in the residual.

Monday, 2 January 2012

Regression with more than One Time Series - CFA Level II Quantitative Methods


1. When neither of the time series (dependent & independent) has a unit root, linear regression can be used.
2. One of the two time series (i.e. either dependent or independent but not both) has a unit root, we should not use linear regression because error term in the regression would not be covariance stationary.
3. If both time series have a unit root, and the time series are not cointegrated, we cannot use linear regression.
4. If both time series have a unit root, and the time series is cointegrated, linear regression can be used. Because, when two time series are cointegrated, the error term of the regression is covariance stationary and the t-tests are reliable.

Cointegration: Two time series are cointegrated if
· A long term financial or economic relationship exists between them.
· They share a common trend i.e. two or more variables move together through time.

Detecting Cointegration: The Engle-Granger Dickey- Fuller test can be used to determine if time series are cointegrated.
Engle and Granger Test:
1. Estimate the regression
2. Unit root in the error term is tested using Dickeyfuller test but the critical values of the Engle- Granger are used.
3. If test fails to reject the null hypothesis that the error term has a unit root, then error term in theregression is not covariance stationary. This implies that two time series are not cointegrated and regression relation is spurious.
4. If test rejects the null hypothesis that the error term has a unit root, then error term in the regression is covariance stationary. This implies that two time series are cointegrated and regression results and parameters will be consistent.

NOTE:
· When the first difference is stationary, series has a single unit root. When further differences are required to make series stationary, series is referred to have multiple unit roots.
· For multiple regression model, rules and procedures for unit root and stationarity are the same as that of  single regression.

Thursday, 29 December 2011

Autoregressive Conditional Heteroskedasticity models (ARCH)


When regression model has (conditional) heteroskedasticity i.e. variance of the error in a particular time-series model in one period depends on the variance of the error in previous periods, standard errors of the regression coefficients in AR, MA or ARMA models will be incorrect, and hypothesis tests would be invalid.


ARCH model: 
ARCH model must be used to test the existence of conditional heteroskedasticity. An ARCH (1) time series is the one in which the variance of the error in one period depends on  size of the squared error in the previous period i.e. if a large error occurs in one period, the variance of the error in the next period will be even larger.

To test whether time series is ARCH (1), the squared residuals from a previously estimated time-series model are regressed on the constant and first lag of the squared residuals



Decision Rule: If the estimate ofα1 is statistically significantly different from zero, the time series is ARCH (1). If a time-series model has ARCH (1) errors, then the variance of the errors in period t+1 can be predicted in period t.


Consequences of ARCH: 
• Standard errors for the regression parameters will not be correct.
• When ARCH exists, we can predict the variance of the error terms.



Generalized least squares or other methods that correct for heteroskedasticity must be used to estimate the correct standard error of the parameters in the time-series model.



Autoregressive model versus ARCH model:
• Using AR (1) model implies that model is correctly specified.
• Using ARCH (1) implies that model can not be correctly specified due to existence of conditional heteroskedasticity in the residuals; therefore, ARCH (1) model is used to forecast variance/volatility of residuals.






Tuesday, 27 December 2011

Seasonality in Time Series - Level II Quantitative Methods


When a time series variable exhibit a repeating patterns at regular intervals over time, it is known as seasonality e.g. sales in Dec > sales in Jan. A time series with seasonality also has a non-constant mean and thus is not covariance stationary.


Detecting seasonality:
In case of seasonality in the data, autocorrelation in the model differ by season. For example, in case of quarterly sales data of a company, if the fourth autocorrelations of the error term differ significantly from 0  → This is a sign of seasonality in the model.


Decision Rule:
When t-statistic of the fourth lag of autocorrelations of the error > critical t-value → reject null hypothesis that fourth autocorrelations is 0.  Thus, there is seasonality problem.


Correcting Seasonality: This problem can be solved by adding seasonal lags in an AR model i.e. after including a seasonal lag in case of quarterly sales data, the AR model becomes:

xt = b0 + b1x (t-1) + b2x(t-4) + et

NOTE: R(square) of the model without seasonal lag will be less than the R(square) of the model with seasonal lag. This implies that when time series exhibit seasonality, including a seasonal lag in the model improves the accuracy of the model.




Wednesday, 21 December 2011

Autoregressive (AR) Models Time Series (Part C) - Quantitative Methods Level II

Mean Reversion.

A time series shows mean reversion if it tends to move towards its mean i.e. decrease when its current value is above its mean and increase when its current value is below its mean.When a time series equals its mean-reverting value, then the model predicts that the value of the time series will be the same in the next period.


Multi-period Forecasts and the Chain Rule of Forecasting.

The chain rule of forecasting is a process in which a predicted value two periods ahead is estimated by first predicting the next period’s value and substituting it into the equation of a predicted value two periods ahead. It is important to note that the Multi-period forecast is more uncertain than single-period forecasts because the uncertainty increases when number of periods in the forecast increase.


Comparing Forecasting Model Performance.

The accuracy of the model depends on its forecast error variance. The smaller the forecast error variance, the more accurate the model will be.

In-sample forecast errors: These are the residuals from the fitted time series model i.e. residuals within a sample period.
Out-of-sample forecast errors: These are the residuals outside the sample period. It is more important to have smaller forecast error variance for out-of-sample forecasts because the predicted values are always out of sample. In order to evaluate out-of-sample forecasting accuracy of the model. Root Mean Squared Error (RMSE) is used. RMSE is the square root of average squared error.
Decision Rule: The smaller the RMSE, the more accurate the model will be.


The RMSE (Root Mean Squared Error) is used as a criterion for comparing forecasting performance of different forecasting models. To accurately evaluate uncertainty of forecast, both the uncertainty related to the error term and the uncertainty related to the estimated parameters in the time-series model must be considered.

NOTE: If the model has the lowest RMSE for in-sample data, it does not guarantee that the model will have the lowest RMSE for out-of-sample data as well.

Instability of Regression Coefficients.

When the estimated regression coefficients in one period are quite different from those estimated during another period, this problem is known as instability or nonstationarity. The estimates of regression coefficients of the timeseries model can be different across different sample periods i.e. the estimates of regression coefficients using shorter sample period will be different from using longer sample periods. Thus, sample period selection is one of the important decisions in time series regression analysis.


· Using longer time periods increases statistical reliability but estimates are not stable.
· Using shorter time periods increase stability of the estimates but statistical reliability is decreased.


NOTE: We cannot select the correct sample period for the regression analysis by simply analyzing the autocorrelations of the residuals from a time-series model. In order to select the correct sample, it is necessary that data should be Covariance Stationary.