|
Chapter Contents |
Previous |
Next |
| The MODEL Procedure |
Take the usual linear regression problem

where Y denotes the n column vector of the dependent variable,
X denotes the (n × k) matrix of independent variables,
denotes the k column vector of coefficients to be estimated,
n denotes the number of observations (i=1,2,...,n), and
k denotes the number of independent variables.
You can take this basic equation and split it into two regimes, where the ith observation on y is generated by one regime or the other.

The problem is to estimate
,
,
,
and
without knowing a priori which of the
n values of the dependent variable, y, was generated
by which regime. If it is known a priori which observations
belong to which regime, a simple Chow test
can be used to test
and
.
Using Goldfeld and Quandt's D-method for switching regression, you can solve this problem. Assume that there exists observations on some exogenous variables z1i, z2i, ..., zpi, where z determines whether the ith observation is generated from one equation or the other.

where
are unknown coefficients to be estimated. Define d(zi) as a continuous approximation to a step function.
Replacing the unit step function with a continuous approximation
using the cumulative normal integral enables a more practical
method that produces consistent estimates.
![d(z_{i}) \;=\; \frac{1}{\sqrt{2 \pi} \sigma} \, \int_{- \infty}^{\sum \pi_{j} z_{ji}} \, exp [ - \frac{1}2 \, \frac{\xi^2}{\sigma^2} ] \, d \xi](images/modeq38.gif)
D is the n dimensional diagonal matrix consisting of d(zi).
![D \;=\; [ d(z_{1}) & 0 & 0 & 0 \0 & d(z_{2}) & 0 & 0 \0 & 0 & \ddots & 0 \0 & 0 & 0 & d(z_{n})]](images/modeq39.gif)
The parameters to estimate are now the k
's, the k
's,
,
, p
's, and the
introduced in the d(zi) equation. The
can be considered
as given a priori, or it can be estimated, in which the estimated
magnitude provides an estimate of the success in discriminating between
the two regimes (Goldfeld and Quandt 1976).

where W = (I - D) U1 + D U2, and W is a vector of unobservable and heteroscedastic error terms. The covariance matrix of W
is denoted by
, where
.
The maximum likelihood parameter estimates maximize
the following log-likelihood function.
![logL &=& - \frac{n}2 \log 2 \pi - \frac{1}2 \log | \Omega | - \& & \frac{1}2 ... ...} - D X \beta_{2} ] ' \Omega^{-1} [ Y - (I - D) X \beta_{1} - D X \beta_{2} ] ]](images/modeq44.gif)
As an example, you now can use this switching regression likelihood to develop a model of housing starts as a function of changes in mortgage interest rates. The data for this example is from the U.S. Census Bureau and covers the period from January 1973 to March 1999. The hypothesis is that there will be different coefficients on your model based on whether the interest rates are going up or down.
So the model for zi will be the following
The regression model will be the following

This model is written using the following SAS statements.
proc model data=switch;
parms sig1=10 sig2=10 int1 b11 b13 int2 b21 b23 p;
bounds 0.0001 < sig1 sig2;
a = p*dif(rate); /* Upper bound of integral */
d = probnorm(a); /* Normal CDF as an approx of switch */
/* Regime 1 */
y1 = int1 + zlag(starts)*b11 + decjanfeb *b13 ;
/* Regime 2 */
y2 = int2 + zlag(starts)*b21 + decjanfeb *b23 ;
/* Composite regression equation */
starts = (1 - d)*y1 + d*y2;
/* Resulting log-likelihood function */
logL = (1/2)*( (318*log(2*3.1415)) +
log( (sig1**2)*((1-d)**2)+(sig2**2)*(d**2) )
+ (resid.starts*( 1/( (sig1**2)*((1-d)**2)+
(sig2**2)*(d**2) ) )*resid.starts) ) ;
errormodel starts ~ general(logL);
fit starts / method=marquardt converge=1.0e-5;
/* Test for significant differences in the parms */
test int1 = int2 ,/ lm;
test b11 = b21 ,/ lm;
test b13 = b23 ,/ lm;
test sig1 = sig2 ,/ lm;
run;
Four TEST statements were added to test the hypothesis that the parameters were the same in both regimes. The parameter estimates and ANOVA table from this run are shown in Output 4.2.1.
Output 4.2.1: Parameter Estimates from the Switching Regression
| |||||||||||||||||||||||||||||||
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.