2. Regression
Analysis
Section I – 39%
Explain why an ARIMA model may
be thought of as an adaptive
process
Explain how you would apply
ARIMA trading strategies to a
given chart scenario
Show how you might use linear
regression to compare relative
strength of various markets
3. Autoregressive Integrated Moving Average(ARIMA)
• An Autoregressive Integrated Moving Average(ARIMA) model is created by a
process of repeated regression analysis over a moving time window,
resulting in a forecast value based on the new fit.
• ARIMA process automatically applies the most important features of
regression analysis in a preset order and continues to reanalyze results until
an optimum set of parameters or coefficients is found.
• This technique is often referred to as the Box-Jenkins forecast.
• The two important terms in ARIMA are auto regression and moving average.
• Auto regression refers to the use of the same data to self-predict, for
example, using only gold prices to arrive at a gold price forecast.
• Moving average refers to the normal concept of smoothing price
fluctuations, using a rolling average of the past n days.
4. Autoregressive Integrated Moving Average(ARIMA)
• The autocorrelation is used to determine to what extent past prices will
forecast future prices.
• The success of the ARIMA model is determined by two factors:
- High correlation in the auto regression
- Low variance in the final forecast errors.
• Preliminary steps for determining the order of the autoregression and
moving average to be used:
- The variance must be stabilized
- Prices are detrended
- Specify the order of the autoregressive and moving average components.
5. Autoregressive Integrated Moving Average(ARIMA)
• To determine when an ARIMA process is completed, three tests are
performed at the end of each estimation pass:
• 1.Compare the change in the coefficient value. If the last estimation has
caused little or no change in the value of the coefficient(s), the model has
successfully converged to a solution.
• 2.Compare the sum of the squares of the error. If the error value is small or
if it stays relatively unchanged, the process is completed.
• 3.Perform a set number of estimations
6. Box-Jenkins methodology
Phase 1: Identification
Step 1: Data Preparation
• Transform the data to stabilize the attributes. • Find the difference if it is not stationary;
successively difference • Series to attain stationary.
Step 2: Model Selection
• Examine data, plot ACF and PACF to identify potential models
Phase 2: Estimation and Testing
Step 1: Estimation
• Estimate parameters in potential models • Select best model using AICBIC criterion
Step 2: Diagnostics
• Check ACF/PACF of residuals • Test the residuals • Are the residuals are white noise
Phase 3: Forecast the application
• Forecasting the trend • This model is used to forecast the future
7. Forecast Results
• Once the coefficients have been determined,
they are used to calculate the forecast value.
These forecasts are most accurate for the next
day and should be used with less confidence
for subsequent days
• ARIMA forecast which becomes less accurate
with 95% further ahead.
• What if the forecast does not work?
- First, Be sure that any data transformations
were reversed. Pay particular attention to the
removal of trends using the correlogram.
- Second, check the data used in the process. If
the data sample is changing
9. ARIMA Trading Strategies
• Following the Trend : Use the 1-day-ahead forecast to determine the trend
position.
• Hold a long position if the forecast is for higher prices, and take a short
position if the process is expecting lower prices.
• Mean-Reverting Indicator : ARIMA confidence bands to determine
overbought/oversold levels.
• long position be entered when prices penetrate the lowest95% confidence
band, but they can be closed out when they return to the normal 50% level.
• A conservative trader will enter the market only in the direction of the
ARIMA trend forecast.
• If the trend is up, only the penetrations of a lower confidence band will be
used to enter new long positions.
10. ARIMA Trading Strategies
• Use of Highs and Lows :
• 1.Using confidence bands based on the closing prices, buy an intraday
penetration of the expected high or sell short a penetration of the expected
low, and liquidate the position on the close.
• Use a stop-loss. Take positions only in the direction of the ARIMA trend.
• Using the separate ARIMA models based on the daily high and low prices,
buy a penetration of the 50% level of the high and sell a penetration of the
50% level of the lows. Liquidate positions on the close. Use a stop-loss.
• Slope : The purpose of directional analysis, whether regression or moving
averages, is to uncover the true direction of prices by discarding the noise.
Therefore, the slope of the trend line, or the direction of the regression
forecast, is the logical answer.
• The slope itself should be viewed as the best approximation of direction.
11. ARIMA Trading Strategies
• Kalman offers an alternative approach to ARIMA, allowing an underlying
forecasting model to be combined with other timely information
• The message model may be any trading strategy, moving average, or
regression approach.
• The observation model may be the specialist's or floor broker's opening calls,
market liquidity, or earlier trading activity in the same stock or index market
on a foreign exchange—all of which have been determined to good
candidate inputs for forecasting.
12. Basic Trading Signals Using a Linear Regression Model
• Buy when tomorrow's
closing price (Ct+1) moves
above the forecasted value
of tomorrow's close (Ft+1).
• Sell short when tomorrow's
closing price (Ct+1) moves
below the forecasted value
of tomorrow's close (Ft+1).
13. Basic Trading Signals Using a Linear Regression Model
• Adding Confidence Bands
• The new trading rules using a 95%
confidence band would then become
• Buy when tomorrow's closing price
(Ct+1) moves above the forecasted
value of tomorrow's close (Ft+1) +
(2.0 × Rt).
• Sell short when tomorrow's closing
price (Ct+1) moves below the
forecasted value of tomorrow's close
(Ft+1) − (2.0 × Rt).
14. Using the Linear Regression Slope
• The slope of the linear regression line, the angle at which it is rising or falling, is an
effective way to simplify the usefulness of the regression process. The slope shows
how quickly prices are expected to change over a unit of time.
• Buy when the value of the slope is positive (rising).
• Sell when the value of the slope is negative (falling).
15. Adding Correlations
• Using the correlation coefficient, R2, will provide a measurement of the consistency of
the price movement
• Instead of R2, which is always positive, R will be used , the actual prices will be used
and correlated against a series of sequential numbers.
• This should give us a better value for whether the prices are trending.
• If R becomes negative then prices are trending down.
• The trading rules for the slope are normally the same as those for a moving average:
- a long position is entered when the trend line or slope turns up and
- a short sale begins when the trend line turns down;
16. Forecast Oscillator
• Tushar Chande used the regression forecast and its residuals to create
trend-following signals called the Forecast Oscillator
• 5-day regression, find the residuals and calculate the percentage variation
from the regression line.
• A buy signal occurs when the 3-day average of the residuals crosses above
the regression line;
• A short sale is when the 3-day average of the residuals crosses below the
regression line.
17. Measuring Market Strength
• “Which market is leading the other, Hewlett Packard or Dell?
• The slope of the linear regression, measured over the same calculation period, is the
perfect tool for comparing, or ranking, a set of markets.
• The prices of four pharmaceutical companies, Amgen (AMGN), Johnson & Johnson
(JNJ), Merck (MRK), and Pfizer (PFE). Which of them is the strongest during the last 60
days? No doubt it's PFE, the line at the bottom. But the weakest is not as clear.
18. Measuring Market Strength
• In order to rank these correctly, it is best to index the stock prices, starting at 100 on
the same date. For only stocks, indexing is not necessary, but if you are mixing stocks
and futures, or just using futures, indexing will be needed to put the trading units into
the same notation. Figure 28.6shows the indexed stocks beginning at the value of 100.
19. Measuring Market Strength
• PFE was the most volatile because the slope varied from much higher to much lower
than the others, while each stock had its turn at being the strongest and weakest. At
the right side of the chart, PFE finishes the strongest followed by AMGN, MRK, and
JNJ.
• Graph shows rolling linear regression slope with plots for AMGN, JNJ, MRK, and PFE on
year versus slope.