Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Walter Enders
Universidad de
Alabama
Preparado
por
Pin Chung
La Compañía Americana de Reaseguros y la Universidad
Estatal de Iowa
Walter Enders
Universidad de
Alabama
Ling Shao
Universidad de
Alabama
Jingan Yuan
Universidad de
Alabama
PREFACIO
Este Manual del Instructor está diseñado para acompañar la segunda edición de la Serie de
Tiempo Econométrico Aplicado (AETS) de Walter Enders. Como en la primera edición, el texto
instruye por inducción. El método es tomar un ejemplo simple y construir hacia modelos y
procedimientos econométricos más generales. En el cuerpo de cada capítulo se incluye un gran
número de ejemplos. Muchas de las pruebas matemáticas se realizan en el texto y se proporcionan
ejemplos detallados de cada procedimiento de estimación. El enfoque es el de aprender haciendo.
Por ello, las preguntas matemáticas y las estimaciones sugeridas al final de cada capítulo son
importantes. Además, es útil que los estudiantes realicen el tipo de proyecto semestral descrito al
final de este manual.
Uno de los objetivos de este manual es proporcionar las respuestas a cada uno de los
problemas matemáticos. Muchas de estas preguntas se responden con gran detalle. Nuestro objetivo
no era proporcionar las técnicas de solución más matemáticamente elegantes. A veces una respuesta
larga e interminable proporciona más perspicacia que una prueba concisa.
Este segundo objetivo es proporcionar programas de muestra que puedan ser utilizados para
obtener los resultados reportados en las secciones de "Preguntas y Ejercicios" de la AETS. Se debe
animar a los estudiantes a que trabajen en tantos ejercicios como sea posible. Para poder trabajar
con los ejercicios, es necesario tener acceso a un paquete estadístico como EViews, Microfit, PC-
GIVE, o RATS, SAS, SHAZAM o STATA. Los paquetes matriciales como MATLAB y GAUSS
no son tan convenientes para los modelos univariantes. Algunos de estos paquetes, como EViews,
permiten realizar la mayoría de los ejercicios usando menús desplegables. Otros, como GAUSS,
necesitan ser programados para realizar tareas relativamente simples. No es posible incluir
programas para cada uno de estos paquetes dentro de este pequeño manual. Hubo varios factores
que me llevaron a proporcionar programas escritos para RATS y STATA. En primer lugar, el
Manual de Programación de RATS puede ser descargado (sin cargo) de www.estima.com/enders.
El Manual de Programación proporciona una completa discusión de muchas de las tareas de
programación utilizadas en la econometría de series temporales. STATA fue incluido ya que es un
paquete popular que la mayoría no consideraría como un paquete de series temporales. Sin embargo,
como se muestra a continuación, STATA puede producir casi todos los resultados obtenidos en el
texto. Adobe Acrobat le permite copiar un programa de la versión *.pdf de este manual y pegarlo
directamente en STATA o RATS. Los lenguajes usados en RATS y STATA son relativamente
transparentes. Por lo tanto, los usuarios de otros paquetes deberían ser capaces de traducir los
programas que se proporcionan aquí.
1. Ecuaciones de diferencia
Sugerencias de conferencias 1
Respuestas a las preguntas2
3. Modelado de la volatilidad
Sugerencias de conferencias 41
Respuestas a las preguntas43
Preguntas y ejercicios 42
Sugerencias de conferencias
Casi todos los estudiantes tendrán alguna familiaridad con los conceptos desarrollados en el
capítulo. Un primer curso de cálculo integral hace referencia a las soluciones convergentes frente
a las divergentes. Dibujo la analogía entre la solución particular de una ecuación de diferencia y las
integrales indefinidas.
Es importante destacar la distinción entre soluciones convergentes y divergentes. Asegúrese
de destacar la relación entre las raíces características y la convergencia o divergencia de una
secuencia. Gran parte de la literatura actual sobre series temporales se centra en la cuestión de las
raíces unitarias. Es conveniente introducir a los estudiantes en las propiedades de las ecuaciones de
diferencia con raíces características unitarias en esta etapa temprana del curso. La pregunta 5, al
final de este capítulo, está diseñada para anticiparse a esta importante cuestión. Los instrumentos
que hay que destacar son el método de los coeficientes indeterminados y los operadores de
desfase. Pocos estudiantes habrán sido expuestos a estos métodos en otras clases.
Utilizo los gastos generales para mostrar a los estudiantes varias series de datos y pedirles
que discutan el tipo de
modelo de ecuación de diferencia que podría capturar las propiedades de cada uno. En la figura
siguiente se muestran tres de las series de tipos de cambio reales utilizadas en el capítulo 4. Algunos
estudiantes ven una tendencia de la serie a revertir a un valor medio a largo plazo. La discusión en
el aula podría centrarse en la manera apropiada de modelar la tendencia de los niveles a meandro.
Página1 Ecuaciones de
diferencia
En esta etapa, los modelos precisos no son importantes. El objetivo es que los estudiantes
conceptualicen los datos económicos en términos de ecuaciones de diferencia.
Página2 Ecuaciones de
diferencia
Tipos de cambio reales (Panel. xls)
180
160
(1996 = 100)
140
120
100
80
60
1980 1983 1986 1989 1992 1995 1998 2001
U. S. Canadá Alemania
yt = a0 + a1yt-1
= a0 + a1[a0 + a1yt-2 ]
= a0 + a0a1 + a0(a1)2 + + a0(a1)t-1 + (a1)ty0
Bill sumó las soluciones homogéneas y particulares para obtener: yt = a0/(1 - a1) + (a1)t[y0 -
a0/(1 -
a1)].
Primero, cancela (a1)ty0 de cada lado y luego divide por a0. Los dos lados de la ecuación
son idénticos si:
Página3 Ecuaciones de
diferencia
Ahora, multiplica cada lado por (1 - a1) para
1 - (a1)t
Los dos lados de la ecuación son idénticos. Por lo tanto, Jill y Bob obtuvieron el idéntico
respond
er.
yt = a0t + A
Para eliminar la constante arbitraria, imponga la condición inicial. La solución general debe
ser válida para todo t incluyendo t = 0. Por lo tanto, en t = 0, y0 = a0t + A de modo que A =
y0. Por lo tanto, el método de Bill rinde:
yt = a0t +
y0
Página5 Ecuaciones de
diferencia
A. Encuentra la solución homogénea para
t
p*
[ 1 - (1-L ] p*
t
= pt-1
op* = pt-1/[
t
1 - (1-)L ] de modo que
[pt-1 + (1-)pt-2 + (1-)2pt-3 + ... ] = pt-1 + (1-)[pt-2 + (1-)pt-3 + (1-)2pt-4 + ... ] Debe
A. Demostrar que es posible expresar mt+n en términos del valor conocido mt y la secuencia
{t+1,
, ... ...t+n).
Página7 Ecuaciones de
diferencia
= m + t+3 + [m + m + t+2 + t+1 + 2mt] Para
B. Supongamos que todos los valores de t+i para i > 0 tienen un valor medio de cero. Explique
cómo podría utilizar su resultado en la parte A para pronosticar la oferta monetaria n-períodos en
el futuro.
Responde: Asumiendo a1 < 1, puedes usar operadores de retardo para escribir la ecuación como
(1 - a1L)yt =
t + 1t-1. Por lo tanto, yt =t + 1t-1)/(1 - a1L).
Ahora aplica la expresión (1 - a1L)-1 a cada término del numerador de manera que
yt = b0 + t + (1+ 1) t -i
i=1
ii. yt = a1yt-1 + 1t + 2t
Página9 Ecuaciones de
diferencia
yt = 1t + a11t-1 + (a1)21t-2 + (a1)31t-3 + ... +2t + a12t-1 + (a1)22t-2 + (a1)32t-3 + ...]
yt = ci1t-i + di2t-i
donde los coeficientes satisfacen: ci = (a1)i y di = (a1)i.
i) yt = a0 + 1.5yt-1 - 0.5yt-2 +
t
Responde: La ecuación homogénea es yt - 1.5yt-1 + .5yt-2 = 0. La solución homogénea
tomará la forma yt = At. Para formar la ecuación característica, primero sustituya esta solución
de desafío en la ecuación homogénea para obtener
A
-1,5At-1 + 0,5At-2 = 0
Las dos raíces características son 1 = 1, 2 = 0,5. La combinación lineal de las dos soluciones
homogéneas es también una solución. Por lo tanto, dejando que A1 y A2 sean dos constantes
arbitrarias, la solución homogénea completa es
A1 + A2(0.5)t
ii) yt = a0 + yt-2 + t
Responde: La ecuación homogénea es yt - yt-2 = 0. La solución homogénea tomará la forma
yt = At. Para formar la ecuación característica, primero sustituya esta solución de desafío en
la ecuación homogénea para obtener
At
- At-2 = 0
A continuación, divide por At-2 para obtener la ecuación característica 2 - 1 = 0. Las dos
raíces características son 1 = 1, 2 = -1. La combinación lineal de las dos soluciones
homogéneas es también una solución. Por lo tanto, dejando que A1 y A2 sean dos constantes
arbitrarias, la solución homogénea completa es
Página10 Ecuaciones de
diferencia
A1 + A2(-1)t
Las dos raíces características son 1 = 1, y 2 = 1; de ahí que haya una raíz repetida. La
combinación lineal de las dos soluciones homogéneas es también una solución. Dejando que A1
y A2 sean dos constantes arbitrarias, la solución homogénea completa es
A1 + A2t
- -
i) yt = a0 + 1.5yt-1 - .5yt-2 + t
Responde: Usando operadores de retardo, escribe la ecuación como (1 - 1.5L + 0.5L2)yt =
Página11 Ecuaciones de
diferencia
a0 + t. Factorización
el polinomio produce (1 - L)(1 - 0.5L)yt = a0 + t. Aunque la expresión (a0 + t)/(1 - 0.5L)
es convergente, (a0 + t)/(1 - L) no converge.
Página12 Ecuaciones de
diferencia
ii) yt = a0 + yt-2 + t
Responde: Usando operadores de retardo, escribe la ecuación como (1 - L)(1 + L)yt = a0 +
t. Está claro que
ni (a0 + t)/(1 - L) ni (a0 + t)/(1 + L) convergen.
C. Demuestra que la ecuación (i) puede ser escrita completamente en primeras diferencias; i. e., yt
= a0 + .5yt-1 + t. Encuentra
la solución particular para el Yt. [CONSEJO: y* = yt para y* = a0 - 0.5 y * + . Encuentra
Defina que el
t t t
solución particular y*
t
en términos de la secuencia {t}.]
para
Página13 Ecuaciones de
diferencia
ii) yt = a0 + yt-2 + t,
Responde: Reste yt-1 de cada lado para formar yt - yt-1 = a0 - yt-1 + yt-2 + t o
yt = a0 - yt-1 + t para que
y t * = a0 - yt * + t
Obsérvese que la primera diferencia yt tiene una raíz característica que es igual a -
1. La forma apropiada de la solución de retroceso no existe para esta ecuación. Si se
intenta
Página14 Ecuaciones de
diferencia
la solución del desafío y*
t
= b0 + it-i, encuentras
b0 = a0 - b0 b0 = a0/2
=1
=- 1 = -1 y
i
i = (-1)
En la Parte E, se pide a los estudiantes que resuelvan una ecuación de esta forma con una
condición inicial dada.
yt = a0 + yt-1 + t
Utilizando la definición de
t
y* se deduce y* = a0 + y t* + . De nuevo, una forma
que adecuada para el
t
Noten que la segunda diferencia 2yt tiene una solución convergente ya que
t
= a0 + t
yt = a0 + 0.25yt-2 + t o
y t* = a0 + 0.25 y*
t
+
Página15 Ecuaciones de
diferencia
y t* = (a0 + t)/[(1 - 0.5L)(1 + 0.5L)]
Página16 Ecuaciones de
diferencia
Responde: Puedes usar la iteración o el Método de Coeficientes Indeterminados para
verificar que la solución es
t
yt = (-1)i+t i + (-1)t y0 + a0 [1 - (-1)t
i=1 ]2
Usando el método iterativo, y1 = a0 + 1 - y0 y y2 = a0 + 2 - y1 de modo
que
y2 = a0 + 2 - a0 - 1 + y0 = 2 - 1 + y0
y4 = a0 + 4 - y3 = a0 + 4 - a0 - 3 + 2 - 1 + y0 = 4 - 3 + 2 - 1 + y0
Para confirmar la solución para yt, nótese que (-1)i+t es positivo para los valores pares de
(i+t) y negativo para los valores impares de (i+t), (-1)t es positivo para los valores pares de
t, y (a0/2)[1 - (-1)t] es igual a cero cuando t es par y a0 cuando t es impar.
A. Supongamos que en los períodos 0 y 1, la tasa de inflación fue del 10% y 11%,
respectivamente. Encuentre las soluciones homogéneas, particulares y generales para la tasa de
inflación.
t = A1(1.2)t + A2(-0.5)t
Página17 Ecuaciones de
diferencia
b + b0t + b1t-1 + b2t-2 + b3t-3 + ... = -0,05 + 0,7(b + b0t-1 + b1t-2 + b2t-3 + b3t-4 + ...)
+ 0,6(b + b0t-2 + b1t-3 + b2t-4 + b3t-5 + ...) + t
Página18 Ecuaciones de
diferencia
b = -0,05 + 0,7b + 0,6b b= 1/6
b0 = 1
b1 = 0.7b0 = 0.7
b2 = 0.7b1 + 0.6b0 = 0.49 + 0.6 = 1.09
bi = 0.7bi-1 + 0.6bi-
2
Tenga en cuenta que la solución de futuro no es satisfactoria aquí a menos que esté dispuesto
a asumir una perfecta previsión. Sin embargo, esto es inconsistente con la presencia del
término de error. (Después de todo, la regresión no tendría que ser estimada si todos tuvieran
una perfecta previsión.) El punto es que la solución de previsión expresa la tasa de inflación
actual en términos de los valores futuros de la secuencia {t}. Si se supone que {t} es un
proceso de ruido blanco, no tiene sentido económico suponer que la tasa de inflación actual
está determinada por las realizaciones futuras de t+i.
t = 1/6 + t + 0,7t-1 + b2t-2 + ... + bt-22 + bt-11 + bt0 + bt+1-1 + ... + A1(1.2)t + A2(-0.5)t
Para t = 0 y t = 1:
Estas dos últimas ecuaciones definen A1 y A2. Insertar las soluciones para A1 y A2 en la
solución general para t elimina las constantes arbitrarias.
Página19 Ecuaciones de
diferencia
B. Discuta la forma de la función de respuesta al impulso. Dado que los EE.UU. no se dirigen a
una inflación galopante, ¿por qué cree que la ecuación del investigador está mal estimada?
Responde: La función de respuesta al impulso viene dada por la secuencia {bi}. El impacto
de un choque t en la tasa de inflación es 1. Sólo el 70% de este efecto inicial permanece
durante un período. Después de este decaimiento único, el efecto del choque t sobre t+2, t+3,
... explota. Puedes ver la función de respuesta al impulso en el gráfico adjunto. Las
respuestas de impulso implican que la tasa de inflación crecerá exponencialmente. Dado
que no habrá una inflación galopante, querríamos ignorar el modelo estimado.
satisfacer b + b0t + b1t-1 + b2t-2 + b3t-3 + ... = a0 + a2(b + b0t-2 + b1t-3 + b2t-4 + b3t-5
Página12 Ecuaciones de
diferencia
b = a0 + a2b b= a0/(1-a2)
Página13 Ecuaciones de
diferencia
b0 = 1
b1 = 0
b2 = a2b0 b2 = a2
b3 = a2b1 b3 = 0 (ya que b1 = 0)
1 - (1 + 1/)L]pt = ( - mt-1)/
Como se supone que es positivo, la expresión (1 + 1/) es mayor que la unidad. Por lo tanto,
la solución retrospectiva para el pt es divergente.
pt = [ - mt-1]/[1 - (1 + 1/)L]
Ya que (1 + 1/) = a, se deduce que a-1 = /(1+). También note que /[1 - (1 + 1/)L] = -.
Por lo tanto, la solución para el pt es
i
pt = - + mt+i
1+ 1+
Página14 Ecuaciones de
diferencia
Página15 Ecuaciones de
diferencia
Responde: El multiplicador de impacto es el efecto de mt sobre pt. Como tal pt/mt = 1/(1+).
Para cualquier i, el efecto de mt+i sobre pt es [1/(1+)]/(1+)]i. Dado que/(1+)]i disminuye
a medida que aumenta la i, los valores futuros de la oferta monetaria tienen un efecto menor
sobre el nivel de precios actual que el valor actual. Observe que un aumento permanente de
la oferta monetaria, tal que mt = mt+1 =
... tiene un efecto proporcional en el pt ya que [1/(1+)][/(1+)]i =
1.
9. Para cada uno de los siguientes, verifique que la solución propuesta satisface la ecuación de
diferencia. Los símbolos c, c0 y a0 denotan constantes.
Ecuación Solución
A. yt - yt-1 = 0 yt = c
B. yt - yt-1 = a0 yt = c + a0t
C. yt - yt-2 = 0 yt = c + c0(-1)t
D. yt - yt-2 = t yt = c + c0(-1)t + t + t-2 + t-4 + ...
10. Parte 1: Para cada uno de los siguientes, determine si {yt} representa un proceso estable.
Determinar si las raíces características son reales o imaginarias y si las partes reales son positivas o
negativas.
A. yt - 1.2yt-1 + .2yt-2 B. yt -
1.2yt-1 + .4yt-2
C. yt - 1.2yt-1 - 1.2yt-2 D.
yt + 1.2yt-1
E. yt - 0.7yt-1 - 0.25yt-2 + 0.175yt-3 = 0 [Pista: (x - 0.5)(x + 0.5)(x - 0.7) = x3- 0.7x2 - 0.25x +
0.175]
Respuest
as:
A. La ecuación característica 2 - 1,2 + 0,2 = 0 tiene raíces 1 = 1 y 2 = 0,2. La raíz unitaria
significa que la secuencia {yt} no es convergente.
B. La ecuación característica 2 - 12 + 0,4 = 0 tiene raíces 12 = 0,6 ± 0,2i. Las raíces son
Página16 Ecuaciones de
diferencia
imaginarias. La secuencia exhibe oscilaciones amortiguadas de tipo ondulatorio.
C. La ecuación característica 2 - 1.2 - 1.2 = 0 tiene raíces 1 = 1.85 y 2 = -0.65. Una de las
raíces está fuera del círculo de la unidad, de modo que la secuencia {yt} es explosiva.
D. La ecuación característica + 1,2 = 0 tiene la raíz = -1,2. La secuencia {yt} tiene
oscilaciones explosivas.
E. La ecuación característica 3 - 0.72 - 0.25 + 0.175 = 0 tiene raíces 1 = 0.7, 2 = 0.5 y
= -0.5. Aunque todas las raíces son reales, hay oscilaciones amortiguadas debido a la
presencia de
Página17 Ecuaciones de
diferencia
término (-
0,5)t.
Parte 2: Escriba cada una de las ecuaciones anteriores utilizando operadores de retardo.
Determinar las raíces características de la ecuación característica inversa.
Respuestas: Reescribir cada uno usando operadores de retardo para obtener la ecuación
característica inversa.
A. (1 - 1.2L + 0.2L2)yt tiene la ecuación característica inversa 1 - 1.2L + 0.2L2 = 0.
Resolviendo
esta ecuación cuadrática para los dos valores de L (llamados L1 y L2) produce las raíces
características
de la ecuación característica inversa. Aquí, L1 = 1,0 y L2 = 5,0. Dado que una raíz se
encuentra en el
la secuencia no es convergente. Nótese que estas raíces son las recíprocas de
las raíces que se
encuentran en la Parte 1.
B. (1 - 1,2L + 0,4L2)yt tiene la ecuación característica inversa 1 - 1,2L + 0,4L2 = 0. Las
raíces son L1, L2 = 1,5 ± 0,5i. Las raíces de la ecuación característica inversa están fuera
del círculo unitario de modo que la secuencia {yt} exhibe oscilaciones convergentes de tipo
ondulatorio.
C. (1 - 1,2L - 1,2L2)yt tiene la ecuación característica inversa 1 - 1,2L - 1,2L2 = 0. Las
raíces son -1,54 y 0,54. Una de las raíces características inversas se encuentra dentro del
círculo unitario de modo que el
La secuencia es explosiva.
D. La ecuación característica inversa (1 + 1,2L)yt tiene la raíz característica inversa: L = -
1/1.2 = -0.8333. Dado que esta raíz característica inversa es negativa y se encuentra dentro
de la unidad
la secuencia tiene oscilaciones explosivas.
E. (1 - 0,7L - 0,25L2 + 0,175L3)yt tiene la ecuación característica inversa 1 - 0,7L - 0,25L2
+ 0,175L3 = 0. El factoraje da la representación equivalente (1 - 0,5L)(1 + 0,5L)(1 - 0,7L) =
0. Las raíces características inversas son 2,0, -2,0 y 1,0/0,7 = 1,429. Todas las raíces
características inversas se encuentran fuera del círculo unitario.
Responde: Si asumimos que todos los valores futuros de {t} = 0 podemos encontrar la
solución. En esencia, este es el método utilizado para obtener la función de respuesta al
impulso.
Página19 Ecuaciones de
diferencia
yt = t + 0,3t-1 + 0,8(0,3t-2 + 0,82(0,3t-3 + ...
tanto
A=- - -1 - 0.8(0.3 -2 - 0.82(0.3 -3 + ...
i
t y=
t + 0.3(0.8)
t -i-1
i=0
D. Trace la trayectoria temporal de un choque t en toda la trayectoria temporal de la secuencia.
a1 + a2 < 1
a2 < 1 + a1
-a2 < 1 (desde a2 < 0 ).
Note que a1 + a2 = (1+) - = . Desde 0 < < 1, la primera condición de estabilidad siempre se
cumple. Para satisfacer la segunda condición (es decir, a2 < 1 + a1), es necesario restringir
los coeficientes de tal manera que - 1 + (1+; la simple manipulación cede: 0 < 1 +
Página20 Ecuaciones de
diferencia
2Puesto que son positivos, la segunda condición de estabilidad se mantiene
necesariamente. La tercera condición (es decir, -a2 < 1) equivale a < 1 o <. Por lo tanto,
para asegurar la estabilidad, es necesario restringir para que sea inferior a 1/.
Página21 Ecuaciones de
diferencia
CAPÍTULO 2
MODELOS ESTACIONARIOS DE SERIES
TEMPORALES
1. Modelos de ecuaciones de diferencias estocásticas48
2. Modelos ARMA51
3. Estabilidad 52
4. Restricciones estacionarias para un modelo de ARMA (p,q) 56
5. La función de autocorrelación 60
6. La función de autocorrelación parcial 65
7. Muestra de autocorrelaciones de la serie estacionaria 67
8. Selección de modelo de Box-Jenkins 76
9. Propiedades de las previsiones79
10. Un modelo del índice de precios al productor 87
11. Estacionalidad 93
12. Resumen y conclusiones 99
Sugerencias de conferencias
Utilizo la figura M2-1 para ilustrar los efectos de la diferenciación y la
sobrediferenciación. El primer gráfico muestra 100 realizaciones del proceso de la raíz unitaria yt
= 1,5yt-1 - 0,5yt-2 + t. Si se examina el gráfico, es evidente que no hay tendencia a la reversión
media. Esta serie no estacionaria tiene una raíz unitaria que puede eliminarse mediante la
diferenciación. El segundo gráfico de la figura muestra la primera diferencia de la secuencia
{yt}: yt = 0.5yt-1 + t. La autocorrelación positiva1 = 0,5) se refleja en la tendencia a que a los
valores grandes (pequeños) de yt les sigan otros valores grandes (pequeños). Es sencillo señalar
que la secuencia {yt} puede ser estimada usando la metodología de Box- Jenkins. Es obvio para
los estudiantes que el ACF reflejará la autocorrelación positiva. El tercer gráfico muestra la
segunda diferencia: 2yt = -0.52yt-1 + t - t-1. Los estudiantes entienden rápidamente las dificultades de
estimar esta serie sobre-diferenciada. Debido a la extrema volatilidad de la serie {2yt}, el valor
actual de 2yt no es útil para predecir 2yt+1.
Los efectos de las transformaciones de los datos logarítmicos a menudo se dan por
sentados. Utilizo la figura
M2-2 para ilustrar los efectos de la transformación de Box-Cox. El primer gráfico
Página17 muestra 100
Modelos
estacionarios
realizaciones del proceso AR(1) simulado: yt = 5 + 0,5yt-1 + t. La serie {t} es precisamente la
misma que la utilizada en la construcción de los gráficos de la Figura M2-1. De hecho, la única
diferencia entre
Página18 Modelos
estacionarios
Figura M2-1: Los efectos de las diferencias
Secuencia no estacionaria
5
La secuencia se construyó como:
yt = 1.5yt-1 - 0.5yt-2 + t
La raíz de la unidad significa que la
secuencia no muestra ninguna tendencia a
0
la reversión media.
5
20406080100
Primera diferencia
1
1
020406080100
Segunda diferencia
1
0.5
La segunda diferencia de la secuencia es:
yt = -0.5yt-1 + t - t-1
0 La secuencia sobrediferenciada tiene un
término de error invertible.
0.5
1
020406080100
Página19 Modelos
estacionarios
Figura M2-2: Transformaciones de Box-Cox
yt = 5 + 0.5yt-1 + t 0.5
126
104
8 2
050100 050100
0
050100 050100
El primer gráfico muestra 100 realizaciones de un proceso AR(1) simulado; por construcción, la
desviación estándar de la secuencia {yt} es de 0,609. Los tres gráficos siguientes muestran los
resultados de las transformaciones de Box- Cox utilizando valores de = 0,5, 0,0 y -0,5,
respectivamente. Puedes ver que la disminución actúa para suavizar la secuencia.
Página20 Modelos
estacionarios
el gráfico medio de la Figura M2-1 y el primer gráfico de la Figura M2-2 implica la presencia del
término de intercepción. Los efectos de una transformación logarítmica pueden verse comparando
los dos gráficos del lado izquierdo de la Figura M2-2. Debe quedar claro que la transformación
logarítmica suaviza" la serie. La tendencia natural es que los estudiantes piensen que el suavizado
es deseable. Sin embargo, señalo que los datos reales (como los precios de los activos) pueden ser
bastante volátiles y que los individuos pueden responder
a la volatilidad de los datos y no al logaritmo de los datos. Por lo tanto, puede haber casos en los
que no queramos reducir la varianza realmente presente en los datos. En este momento,
menciono que el material del Capítulo 3 muestra cómo estimar la varianza condicional de una
serie. En los gráficos del lado derecho de la Figura M2-2 se muestran dos transformaciones de
Box-Cox. Obsérvese que la disminución reduce la variabilidad y que un pequeño cambio en ella
puede tener un efecto pronunciado en la varianza.
A. Encuentra el valor esperado de tus ganancias. Encuentra el valor esperado dado que t-3 = t-2 = 1.
Respuestas: A lo largo del texto, el término t denota una perturbación de ruido blanco. El
las propiedades de la secuencia {t} son tales que:
i. Et = Et-1 = Et-2 = ... = 0, ii. Ett-i = 0 para i, y iii. Et)2 = Et-i)2 = ... = 2.
Por lo tanto:
Ewt = E(1/4t + 1/4t-1 + 1/4t-2 + 1/4t-3)
Dado que la expectativa de una suma es la suma de las expectativas, se deduce que
Página22 Modelos
estacionarios
var(wt) = (1/16)42 = 0.252
ii. Cov(wt, wt-2) = (1/16)Et + t-1 + t-2 + t-3)t-2 + t-3 + t-4 + t-5)
= (1/16)E[t-2)2 +t-3)2 + términos de productos cruzados]
iii. Cov(wt, wt-5) = (1/16)Et + t-1 + t-2 + t-3)t-5 + t-6 + t-7 + t-8)
= (1/16)E[términos de producto cruzado]. Por lo tanto:
Cov(wt, wt-5) =
0
2. Sustituir (2.10) por yt = a0 + a1yt-1 + t. Muestra que la ecuación resultante es una identidad.
Responde: Para que (2.10) sea una solución, debe satisfacer:
2 t-1 t 2 t-1
a0[1 + a1 + + ... + a1 ] + a1 y0 + t + a1t-1 + a1 t-2 + ... + a1 =
a1
2 t-2 t-1 2 t-2
a0 + a1{a0[1 + a1 + a + ...1+ a1 ] + a1
Página23 Modelos
estacionarios
y0 + t-1 + a1t-2 + a1 t-3 + ...+ a1 +
Página24 Modelos
estacionarios
2 t-2
2 t-1
t + a1t-1 + a1 t-2 + ... + a1 1 = a1{ t-1 + a1t-2 + a1 t-3 + ... + a1 +
y = a0 / (1 - a1 ) + ai t-i
t 1
i=0
y0 = / (1 - a1 ) a1 i
-i +A
a0 + i=0
Resuelva para A y sustituya la respuesta por la solución general para obtener (2.10).
Página26 Modelos
estacionarios
La forma más simple de responder a las partes iv. y v. es obtener la solución
particular para
yt. Los estudiantes deben ser capaces de mostrar:
vi). Como se muestra en la Parte iv, la covarianza entre yt e yt-1 es cero. Por lo tanto, a
partir de (2,35), 1
= 11 = 0. Dado 1 = 0, (2.36) indica que 22 = 2. Dada la respuesta a v y que var(yt) = var
(yt-i) = ... = 2/[1 - (a2)2], se deduce que
2 2
22 = cov(yt, yt-2)/var(yt) = {a22/[1 - (a2) ]}/{2/[1 - (a2) ]} = a2
B. Encuentra la función de respuesta a los impulsos. Dada la yt-2, rastrea los efectos de un
choque de t en la secuencia de {yt}.
Responde: Una forma de responder a la pregunta es usar la solución particular para el yt:
Página28 Modelos
estacionarios
Por lo tanto: E0yt = a0[1 + a2 + (a2)2 + ... + (a2)t/2-1] + (a2)t/2y0. Para encontrar
Etyt+2s, actualizar los subíndices de tiempo de tal manera que
Etyt+2s = a0[1 + a2 + (a2)2 + ... + (a2)s-1] + (a2)syt
4. Se sacan dos bolas diferentes de un frasco que contiene tres bolas numeradas 1, 2 y 4. Sea x
= número de la primera bola extraída y y = suma de las dos bolas extraídas.
A. Encuentra la distribución de probabilidad conjunta para x e y; es decir, encuentra prob(x = 1, y
= 3), prob(x = 1, y
= 5), ... ...y prob(x = 4, y = 6).
Responde: Que x = número en la primera bola; z = número en la segunda bola; y y = x + z.
Considere el cuadro de contingencia
Resúmenes
x=1x=2x=4z=1y=3y=5
z=2y=3y=6z=4y=5y=6
Página29 Modelos
estacionarios
Noten que el mismo resultado para x y z no es posible ya que se sacan dos bolas
diferentes del frasco. Por lo tanto, prob(x=1, y=2), prob(x=2, y=4), y prob(x=3, y=6)
son todas iguales a cero. Los seis resultados restantes son igualmente probables. Las
probabilidades (x=1, y=3), (x=1, y=5), ... ...(x=4, y=6) todas son iguales a 1/6.
B. Encuentra cada uno de los siguientes: E(x), E(y), E(yx = 1), E(xy = 5), Var(xy = 5), y E(y2)
Respuestas: Cada resultado para x tiene una probabilidad de 1/3. Por lo tanto:
i) E(x) = (1/3)(1 + 2 + 4) = 7/3
v) Var(xy = 5) = E(x2y = 5) - [E(xy =5)]2 = 0,5(12 + 42) - (2,5)2 = 8,5 - 6,25 = 2,25
Var(xy = 5) = 2.25
C. Considere las dos funciones: w1 = 3x2 y w2 = x-1. Halla: E(w1 + w2) y E(w1 + w2y = 3).
Respuestas: El valor esperado de una función de x [(es decir, F(x)] es igual al valor de la
función evaluada en cada posible realización de x multiplicada por la probabilidad de las
realizaciones asociadas. Además, como la expectativa de una suma es la suma de las
expectativas, E(w1 + w2) = E(3x2) + Ex-1 = 3(1/3)(12 + 22 + 42) + (1/3)(1 + 1/2 + 1/4) = 21
+ 1.75/3. Por lo tanto:
E(w1 + w2) = 21.5833
Cuando y = 3, x sólo puede tomar los valores 1 o 2. Por lo tanto, E(w1 + w2y = 3) =
E(w1y
= 3) + E(w2y = 3) = 3(1/2)(12 + 22) + (1/2)(1 + 1/2) =15/2 + 3/4 = 33/4. Por lo tanto:
E(w1+ w2y = 3) = 33/4
D. ¿Cómo cambiarían sus respuestas si las bolas fueran extraídas con reemplazo?
Responde: La tabla de contingencia cambia ya que es posible que x y z tomen los
mismos valores. La nueva tabla de contingencia se convierte:
Página30 Modelos
estacionarios
Resúmenes
x=1x=2x=4z=1y=2y=3
y=5z=2y=3y=4y=6z=4y=5 y
=6y=8
Cada entrada de (x=1, y=2) a (x=4, y=8) tiene una probabilidad de 1/9.
La parte B se convierte:
i) E(x) = 1/3(1 + 2 + 4) = 7/3.
ii) E(y) = (1/9)(2 + 3 + 5 + 3 + 4 + 6 + 5 + 6 + 8) = 42/9 = 14/3
iii) E(yx=1) = (1/3)(2 + 3 + 5) = 10/3.
iv) E(xy=5) = (1/2)(1 + 4) = 2.5.
v) Var(xy=5) = E(x2y=5) - [E(xy=5)]2 = (1/2)(1 + 42) - (2.5)2 = 17/2 - 6.25 = 2.25.
vi). E(y2) = (1/9)[22 + 2(3)2 + 42 + 2(5)2 + 2(6)2 + 82] = 224/9.
Página31 Modelos
estacionarios
0 = 1; 1 = 0,75; y todas las i posteriores son tales que i = 0,75i-1 - 0,125i-2
B. Encuentra los valores de las condiciones iniciales (es decir, y0 e y1) que aseguran que la
secuencia {yt} es estacionaria (Nota: A1 y A2 son las constantes arbitrarias en la solución
homogénea).
Responde: La solución general es la suma de las soluciones homogéneas y particulares:
Página33 Modelos
estacionarios
yt = A1 + A2(0.5)t
B. Demostrar que las raíces de 1 - 1,5L + 0,5L2 son los recíprocos de su respuesta en la parte A.
Respuesta: Para resolver la ecuación característica inversa para L, la forma (1 - L)(1 -
0.5L) = 0. Las soluciones son L = 1 y L = 1/0.5 = 2. Por lo tanto, las dos raíces
características inversas son los recíprocos de las raíces características que se encuentran
en la Parte A.
C. Dadas las condiciones iniciales para y0 y y1, encuentra la solución para yt en términos de
los valores actuales y pasados de la secuencia {t}. Explica por qué no es posible obtener la
solución para yt si no se dan esas condiciones iniciales.
Responde: Una forma de resolver el problema es usar las condiciones iniciales y0 y y1
e iterar hacia adelante. Ya que y2 = 1.5y1 - 0.5y0 + 2, y y3 = 1.5y2 - 0.5y1 + 3, se
deduce que:
Página34 Modelos
estacionarios
s-2
yt+s = i t+s-i + s-1 yt +1 + s yt
i=0
/*Nota: Todo el código está escrito para la versión 8.0 de STATA. Como STATA no puede
leer los conjuntos de datos en el formato de Excel, por favor guarde los conjuntos de datos
de Excel como archivos de texto y léalos usando la línea de abajo, o puede usar un programa
como Stat/Transfer para traducir los conjuntos de datos del formato de Excel al formato de
STATA */
claro
cd "X:\NNNNNuevos_datos" /*Por favor, cambie esta línea de acuerdo con el lugar en el
*C:estimate Model 1
reg y1 l. y1, noconstant
/*el cálculo de AIC y SBC hace uso de los resultados guardados después de los comandos
de estimación como -reg-, -arima-. escriba -ereturn list- para obtener una lista completa de
los resultados guardados después de un comando de estimación particular*/
pantalla " AIC = " =e(N)*ln(e(rss))+2*e(df_m) /*computar AIC del Modelo 1*/
pantalla " SBC = " =e(N)*ln(e(rss))+e(df_m)*ln(e(N)) /*Calcular el CEB del
Modelo 1*/
predecir los residuos, residuos /*calcular los residuos después de la estimación y guardarlo como una
Página37 Modelos
estacionarios
nueva variable llamada residuos*/
corrigiendo los residuos, lag(24) /*verificar las estadísticas Q de los residuos del Modelo 1*/
Página38 Modelos
estacionarios
/*Siguiente, reestimar el Modelo 1 usando el comando ARIMA. la razón para hacerlo es
hacer que los dos modelos sean comparables porque el Modelo 2 no puede ser estimado por
la regresión lineal*/
/*Nota: aquí el tamaño de la alfombra requerida debe ser max(AR, MA+1)^2, que es
169(max(1,13)^2). Pero el tamaño del tapete para la estática intercoolerizada se establece
inicialmente en 40, muy por debajo del tamaño requerido. Refiérase a [R]matsize para más
detalles.*/
/*Nota: Dado que ARIMA en STATA estima un modelo utilizando una combinación de
BHHH y BFGS, no informa de la suma residual de cuadrados que hace imposible el cálculo
de AIC y SBC utilizando la fórmula apropiada para un modelo estimado por OLS. Sin
embargo, el AIC y el SBC todavía se pueden obtener si utilizamos el valor de la función de
logaritmo de probabilidad. La conclusión final de qué modelo es mejor permanece
inalterada*/
8. La segunda columna del archivo titulado SIM_2. XLS contiene los 100 valores del proceso
simulado ARMA(1, 1) utilizado en la Sección 7. Esta serie se titula Y2. Los siguientes
programas realizarán las tareas indicadas en el texto. Debido a las diferencias en el manejo de
los datos y el redondeo, sus respuestas sólo necesitan aproximarse a las indicadas en el texto.
Página40 Modelos
estacionarios
cor(partial=pacf,qstats,number=24,span=8) y2;* calcula el ACF, PACF, y el gráfico de
estadísticas Q 1;* traza la serie simulada
# y2
*Para comparar el MA(2) con el ARMA(1, 1) hay que tener un poco de cuidado. Para un cara a
cara
*comparación, es necesario estimar los modelos sobre el mismo período de muestra. El
ARMA(1, 1)
* utiliza 99 observaciones mientras que el MA(2) utiliza las 100 observaciones. Utiliza:
boxjenk(ma=2) y2 2 100 resids ;* Esto instruye a las RATS a usar sólo las observaciones 2 -
100.
boxjenk(ar=1,ma=1) y2 / resids
cor(number=24,partial=partial,qstats,span=8) resids / cors
compute aic = %nobs*log(%rss) + 2*%nreg
calcular sbc = %nobs*log(%rss) + %nreg*log(%nobs)
visualizar ' aic = ' AIC ' sbc = ' sbc
Página41 Modelos
estacionarios
Programa de muestra para los usuarios de STATA
claro
Página42 Modelos
estacionarios
cd " a:\NNNNNuevos_datos" /*Cambiar si el conjunto de datos
se guarda en otro lugar*/ insheet usando sim_2.txt
tsset obs/*declarar que este es un conjunto de datos de series de tiempo*/
*B:estimate Model 1
reg y2 l. y2, noconstant
/*computar AIC y SBC del Modelo 1(99
obs)*/ visualizar " AIC = "
=e(N)*ln(e(rss))+2*e(df_m)
pantalla " SBC = " =e(N)*ln(e(rss))+e(df_m)*ln(e(N))
/*compute el AIC y el SBC del Modelo 1(98
obs)*/ visualice " AIC*= " =(e(N)-
1)*ln(e(rss))+2*e(df_m)
pantalla " SBC*= " =(e(N)-1)*ln(e(rss))+e(df_m)*ln(e(N)-1)
9. La tercera columna de SIM_2.XLS contiene los 100 valores de un proceso AR(2); esta serie
Página43 Modelos
estacionarios
se titula Y3. Los siguientes programas realizarán las tareas indicadas en el texto. Debido a las
diferencias en el manejo de los datos y el redondeo, sus respuestas sólo necesitan aproximarse a
las indicadas en el texto.
Página44 Modelos
estacionarios
Programa de muestra para los usuarios de RATS
Utilice las tres primeras líneas de la pregunta 7 u 8 para leer el conjunto de datos. Para
graficar la serie use:
Use las primeras cuatro líneas de la pregunta 7 u 8 para leer el conjunto de datos.
Página34Modelos
estacionarios
*E:estimar la serie como un proceso AR(2)
Página35Modelos
estacionarios
reg y3 l. y3 l2.y3, noconstante
pantalla " AIC = " =e(N)*ln(e(rss))+2*e(df_m) /*computar AIC del modelo AR(2)*/
pantalla " SBC = " =e(N)*ln(e(rss))+e(df_m)*ln(e(N)) /*computar SBC del modelo
AR(2)*/ predecir el residuo, los residuos
corrigiendo el residuo, lag(24) /*verificar las estadísticas Q de los residuos del modelo AR(2)*/
10. El texto utiliza AIC = T ln(SSR) + 2 n . Supongamos que el AIC del modelo (AIC1) es más
pequeño que el del modelo 2 (AIC2). Por lo tanto, el modelo 1 se selecciona sobre el modelo 2.
De hecho, cualquier transformación monótona de la AIC siempre llevará a que se seleccione el
modelo 1 sobre el modelo 2. La cuestión es
para mostrar si las diversas formas de informar sobre la AIC (y la CBS) son transformaciones
monótonas de cada una de ellas. Considere la versión reportada por E-Views:
Dado que -(T/2)ln(2) es una constante, puede ser ignorada en el cálculo de la fórmula (es
decir, sumando
o restar es una transformación monótona) ya que no afectará a la clasificación relativa de los dos
modelos. Obsérvese también que 2 se calcula comot)2/T. Obsérvese que esto implica que2)-1t)2
= T (es decir, una constante). Por lo tanto, una transformación monótona de ln L es
-(T/2) ln(t)2/T)
AIC = T ln(SSR) + 2 n
El argumento es idéntico para el SBC y para la fórmula AIC = exp(2n/T) (SSR/T).
Página37Modelos
estacionarios
dif ppi / dy
log ppi / ly Estas dos líneas forman el cambio
logarítmico difuso.
/* Las siguientes tres líneas estiman un ARMA(1, 1), ARMA(1, ||1,4|||) y un AR(2) durante
todo el período de muestra. Para comparar los tres usando el AIC o SBC, estimar los tres
sobre el mismo período de muestra.
*/
boxjenk(define=eq1,constante,ar=1,ma=1,dif=1) ly / resids
boxjenk(define=eq1,constante,ar=1,ma=|||1,4|||,dif=1) ly /
resids boxjenk(define=eq1,constante,ar=2,dif=1) ly / resids
*Para realizar las 50 previsiones fuera de muestra de los modelos ARMA(1, 1), ARMA(1, ||1,4|||),
nosotros
*Necesito inicializar dos series para mantener los 50 pronósticos:
set arma11 = 0.
set arma114 = 0.
*Ahora cada modelo se estimará cincuenta veces utilizando el período de muestra 2 hasta el
período 118 + i
*(1989:3 = 2002:1-50). Al final, i = 50 para que el período final sea 2001:4. En cada estimación,
* se hace el pronóstico de un paso adelante. Los pronósticos del ARMA(1, 1) serán almacenados
en arma11
*y los del ARMA(1, ||1,4|||) estarán en el arma114.
do i = 1,50
boxjenk(define=eq1,constante,ar=1,ma=1,noprint) dly * 2002:1-51+i
resids forecast 1 1 2002:1-50+i
# eq1 arma11
boxjenk(define=eq1,constante,ar=1,ma=||1,4|||,noprint) dly * 2002:1-51+i
resids forecast 1 1 2002:1-50+i
# eq1 arma114
Página38Modelos
estacionarios
end do i
*Crea los dos errores de pronóstico como el valor actual de dly menos el error
de pronóstico establecido11 1989:4 * = dly - arma11
Página39Modelos
estacionarios
set err114 1989:4 * = dly - arma114
*El valor medio (es decir, d ) y la varianza (es decir, 0) pueden obtenerse
*La correlación es -0.0767318. Esto está almacenado en rxz(1). Por lo tanto, la estadística de
Granger-Newbold puede ser computada usando:
claro
cd "a:\NNNNnuevos_datos" /*Por favor, cambie esta línea en consecuencia si el conjunto de
datos se guarda en otro lugar*/ dentro de la hoja usando trimestralmente.txt
gen obs = _n /*obs es 1,2,...,_N, un nuevo vector de columna creado para actuar como una
Página40Modelos
estacionarios
variable de tiempo*/
Página41Modelos
estacionarios
tsset obs/*declarar que este es un conjunto de
datos de series de tiempo*/ gen lppi=ln(ppi)
gen dlppi=d.lppi /*hacer la transformación de datos*/
*C:DM test usando el error absoluto medio para comparar el modelo ARMA(1,1) con el
ARMA(1,(1,4)) gen yt=abs(e1t)-abs(e2t) si el tiempo es > 19893
summ yt if tiempo > 19893,detalle
mostrar " DM Stat=" =r(media)/sqrt(r(Var)/(r(N)-1))
Página42Modelos
estacionarios
*D:Prueba de Granger-Newbold para comparar el modelo AR(2) con el modelo ARMA(1,1)
reg dlppi l.dlppi l2.dlppi si el tiempo <= 19893 /*obtener primero los cincuenta y un pasos por
delante de los errores de pronóstico del modelo AR(2)*/
Página43Modelos
estacionarios
predecir el e3t si el tiempo > 19893, residuos
12. Los usuarios de RATS pueden utilizar lo siguiente para obtener los resultados que se
indican en la sección 11.
conjunto x = m1nsa
log x / lx ;*Transformación del registro = lx
dif lx / dlx ;* Diferencia del log = dlx
dif(sdiffs=1) lx / slx ; * Primera diferencia estacional del log = slx
dif(sdiffs=1,dif=1) lx / sdlx ;* Primera diferencia estacional y diferencia regular del log =
crecimiento del conjunto sdlx = 100*dlx ;* Equivalente a 100*log(x/x{1})
Página44Modelos
estacionarios
*El modelo AR(1) con un coeficiente multiplicador estacional AR(1) fue estimado
usando: box(ar=1,sar=1,constante) sdlx / resids
Página45Modelos
estacionarios
*El modelo MA(1) con un coeficiente multiplicador estacional MA(1) fue estimado
usando: box(ma=1,sma=1,constante) sdlx / resids
B. Ahora usa DDNSA. Simplemente redefina x como ddnsa y haga las transformaciones
*Si se forma la correlación de x, se deben obtener los valores indicados. El ACF y PACF de la
tasa de crecimiento (es decir, dlx) viene dado por
D. Estime los tres modelos de sdlx en el mismo período de muestra. El primer modelo
tiene el AIC y el SBC más bajos. Los residuos de este modelo no muestran ningún signo
de correlación en serie.
Página46Modelos
estacionarios
CAPÍTULO
3
MODELIZACIÓN DE LA
VOLATILIDAD
1. Serie de tiempo económico: Los hechos estilizados 108
2. Procesos ARCH112
3. Estimaciones de inflación de ARCH y GARCH 120
4. Un modelo de GARCH del PPI: Un ejemplo 123
5. Un modelo de riesgo de GARCH 127
6. El modelo ARCH-M 129
7. Propiedades adicionales de los procesos de GARCH132
8. Estimación de la máxima probabilidad de los modelos GARCH138
9. Otros modelos de variación condicional 140
10. Estimando el Índice Compuesto de la Bolsa de Valores de Nueva York 143
11. Resumen y conclusiones 150
Sugerencias de conferencias
1. Hago una transparencia de la Figura 3-7 para ilustrar los procesos del ARCH. Como se describe
en la página 116 del texto, el gráfico superior izquierdo muestra 100 perturbaciones no
correlacionadas en serie y normalmente distribuidas que representan la secuencia {vt}. Estas
perturbaciones se utilizaron para construir la secuencia {εt} que se muestra en el gráfico superior
derecho. Cada valor de εt se construyó utilizando la fórmula εt = vt[1 + 0,8(εt-1)2]. Los dos gráficos
inferiores muestran la interacción del término de error ARCH y la magnitud de los coeficientes
AR(1). Aumentando la magnitud del coeficiente AR(1) de 0,0, a 0,2, a 0,9, se aumentó la volatilidad
de la secuencia simulada {yt}. Para su comodidad, a continuación se reproduce una copia de la figura.
2. En lugar de asignar la pregunta 4 como tarea, utilizo los tres modelos para ilustrar las propiedades
de un proceso ARCH-M. Considere los siguientes tres modelos:
Modelo 1: yt = 0.5yt-1 + εt
Modelo 2: yt = εt - (εt-1)2
Modelo 3: yt = 0,5yt-1 + εt - (εt-1)2
El modelo 1 es un proceso puro de AR(1) que es familiar para los estudiantes. El modelo 2
es un proceso puro de ARCH-M. Cuando el valor realizado de εt-1 es grande en valor absoluto, la
expectativa condicional de yt es negativa: Et-1yt = -(εt-1)2. Así pues, el Modelo 2 ilustra un proceso
simple en el que la media condicional es Página41 de la volatilidad
Figura 3.7: Procesos ARCH simulados
1 + 0.8⋅(εt-1 )
2
El proceso de ruido blanco vt εt = νt⋅
0 0
8 8
0 20 40 60 80 100 0 20 40 60 80 100
(b)
(a)
yt = 0.2yt-1 + εt yt = 0.9yt- 1 + εt
20
20
0 0
20
20 0 20 40 60 80 100
0 20 40 60 80 100
(c) (d)
Página42 de la volatilidad
relacionado negativamente con el valor absoluto del término de error del período anterior.
Supongamos que todos los valores de εi para i ≤ 0 son cero. Ahora bien, si los siguientes 5 valores
de la secuencia de εt son (1, -1, -2, 1, 1), yt tiene la trayectoria temporal que se muestra en la Figura
3M-1 (véase la respuesta a la Pregunta 4 más adelante). Utilizo una transparencia de la Figura 3M-
1 para comparar la trayectoria de los modelos AR(1) y ARCH-M. El modelo 3 combina el modelo
AR(1) con el efecto ARCH-M exhibido por el modelo 2. La línea de puntos de la Figura 3M-1
muestra cómo interactúan los efectos AR(1) y ARCH-M.
2. Consideremos el modelo ARCH-M representado por las ecuaciones (3.23) a (3.25). Recordemos
que {εt} es una perturbación de ruido blanco; para simplificar, dejemos que E(εt)2 = E(εt-1)2 = ... =
1.
Eyt = β + δ.
(α0 + ∑ αi)
i= 1
Página44 de la volatilidad
Σαi. Es sencillo mostrar que α0 + Σαi = 1. Como E(εt)2 = E[(vt)2ht] = 1 y E(vt)2 = 1, se
deduce que E(ht) = 1. Por lo tanto: Eht = E[α0 + Σαi (εt-i)2] = α0 + Σαi = 1. Dado β = -4, δ
= 4, la media incondicional de yt es:
3. Bollerslev demostró que el FCA de los residuos cuadrados resultantes del proceso GARCH (p,
q) representado por (3.9) actúa como un proceso ARMA (m, p) donde m = max(p, q). Este resultado
Página45 de la volatilidad
debe ilustrarse con los ejemplos siguientes.
Página46 de la volatilidad
A. Considere el proceso GARCH(1,2): ht = α0 + α1(εt-1)2 + α2 (εt-2)2 + β1 ht-1. Siguiendo los pasos de
la pregunta, es posible escribir:
2
(εt)= α0 + (α1 + β1) (εt-1)2 + α2 (εt-2)2 - β1ηt-1 + ηt
donde: ηt = (εt)2 - ht
Mostrar que ηt no está correlacionada en serie y que la secuencia {(εt)2} actúa como un proceso
ARMA(2,1).
Responde: Recuerda que: εt = vt ht donde E(vt) = 0 y Var(vt) = 1. Para demostrar que ηt no está
correlacionado en serie, necesitamos probar Cov(ηt, ηs) = 0, para t≠s. Por definición, ηt = (εt)2 -
ht, y εt =
vt Eso es lo que..:
E(ηt) = 0 y
Cov (ηt,ηs) = 0, para t≠s.
Dado que (εt)2 = α0 + (α1+β1) (εt-1)2 + α2 (εt-2)2 - β1ηt-1 + ηt, queda inmediatamente claro que
la secuencia {(εt)2} actúa como un proceso ARMA(2,1) con coeficientes autorregresivos
(α1+β1),
α2, un coeficiente de promedio móvil -β1, y {ηt} como un proceso de ruido blanco.
Demuestra que sumando y restando los términos β1(εt-1)2 y β2 (εt-2)2 a la derecha de esta ecuación
se obtiene un proceso ARMA(2,2).
Página47 de la volatilidad
Responde: Dado el proceso de GARCH(2, 1), ht = α0 + α1(εt-1)2 + β1 ht-1 + β2 ht-2, es posible
Página48 de la volatilidad
para añadir ηt = (εt)2 - ht a cada lado para
obtener:
Por lo tanto: (εt)2 = α0 + α1 (εt-1)2 + ηt + β1 ht-1 + β2 ht-2. Ahora, suma y resta los
términos
2 2
β1(εt-1) y β2(εt-2) a la derecha de los rendimientos de la ecuación anterior:
2
(εt) = α0 + α1(εt-1)2 + ηt + β1ht-1 + β2ht-2
= α0 + α1(εt-1)2 + ηt + β1 ht-1 - β1(εt-1)2 + β1(εt-1)2 + β2ht-2 - β2(εt-2)2 + β2(εt-2)2
= α0 + α1(εt-1)2 + ηt - β1[(εt-1)2 - ht-1] + β1(εt-1)2 - β2 [(εt-2)2 - ht-2]+ β2(εt-2)2
(εt)
2
= α0 + (α1 + β1)(εt-1)2 + β2(εt-2)2 + ηt - β1ηt-1 - β2ηt-2
Dado que {ηt} actúa como un proceso de ruido blanco, la secuencia {(εt)2} actúa como un
proceso de ARMA(2,2) con coeficientes AR (α1 + β1) andβ2 y coeficientes MA (-β1), y (-β2).
(εt)
2
= α0 + ∑ αi(εt-i)2 + ∑ βjht-j + (εt)2 - ht
i= 1 j =1
q p p p
Página49 de la volatilidad
j =1 j =1
p
Página50 de la volatilidad
donde ηt ≡ (εt)2 - ht, m = max(p,q), αi ≡ 0 para i > q, y βj ≡ 0 para j > p. Por lo tanto:
m
2
(εt) = α0 + ∑ (αk + βk)(εt-k)2 + ηt - β1ηt-1 - β2ηt-1 -β2ηt-2 -...- βp ηt-p,
k =1
Dado que ηt no está correlacionado en serie, el ACF de los residuos cuadrados resultantes
del proceso GARCH(p, q) actúa como un proceso ARMA(m, p) donde m = max(p, q).
4. Dejemos que y0 = 0 y dejemos que las primeras cinco realizaciones de la secuencia {εt} sean:
(1,-1,-2, 1, 1). Traza cada una de las siguientes secuencias:
Modelo 1: yt = 0.5yt-
1+εt
Modelo 2: yt = εt - (εt-1)2
Modelo 3: yt = 0,5yt-1 + εt - (εt-1)2
Responde: Las trayectorias temporales de los tres modelos se muestran en la Figura 3M-1.
Observe que el modelo 3 contiene efectos autorregresivos y ARCH-M. El efecto de
introducir el término autorregresivo al pasar del Modelo 2 al Modelo 3 aumenta la
volatilidad de la serie. De manera similar, el efecto de introducir el efecto ARCH-M al pasar
del Modelo 1 al Modelo 3 es aumentar la volatilidad de la serie. Los coeficientes
autorregresivos y los efectos ARCH-M interactúan.
Página51 de la volatilidad
B. Para cada uno de los tres modelos, calcula la media de la muestra y la varianza de {yt}.
Para el Modelo 2, las realizaciones son: (1,-2,-3,-3, 0). La media de la muestra del Modelo
2 es: (1/5) (1-2-3-3+0) = -1,4, y la varianza de la muestra es (1/5) [12 +(-2)2+(-3)2+(-3)2+0] -
(-1,4)2 = 2,64.
Modelo Significa
Variación
1 -0.18751.40625
2 -1.42.64
3 -2.31254.05625
5. El archivo denominado ARCH.XLS contiene las 100 realizaciones de la secuencia simulada {yt}
utilizada para crear el panel inferior derecho de la figura 3.10. El siguiente programa reproducirá
los resultados reportados.
* Ahora, define el cuadrado como los residuos cuadrados del modelo AR(1) y construye el
ACF
Página52 de la volatilidad
* y PACF de estos residuos cuadrados. set sqresid =
resids*resids
cor(partial=pacf,qstats,number=24,span=4,dfc=1) sqresid
Página53 de la volatilidad
linreg sqresid ;* estimar un modelo AR(1) de los residuos
cuadrados
# constante sqresid{1}
/*D:estimar
Página54losderesiduos cuadrados como un proceso
la volatilidad
AR(1)*/ reg sqresid l.sqresid
scalar define lm = e(N)*e(r2) /*utilizar los resultados guardados después de la estimación para
calcular las estadísticas de la prueba*/
pantalla " El multiplicador de Lagrange es: " =lm
Página55 de la volatilidad
pantalla " El valor probable es: " =chi2tail(e(df_m),lm)
cal 1960 1 4;* Establece las fechas del calendario para comenzar en 1960:Q1 todo
el 2002:1;* hasta el 2002:Q1
Abrir datos a:\Ntrimestralmente. xls;* Cambiar esta línea si los datos no están en la
unidad a: data(format=xls,org=obs)
*La siguiente línea estima el modelo ARMA(1, ||1,4|||) y almacena los residuos en los residuos de
la serie. El
* Las siguientes líneas crean las correlaciones y las estadísticas Q
de los residuos. boxjenk(define=eq1,constante,ar=1,ma=||1 , 4 ||)
dly / resids cor(qstats,number=24,span=4) resids
* A continuación, crear los residuos cuadrados. Las correlaciones de los residuos al cuadrado y la
estadística Q son
* obtenido usando el conjunto r2
= resids**2
cor(qstats,span=4,number=12) r2
* Estimar una regresión lineal en forma de (3.17) usando cuatro rezagos de los residuos
cuadrados lin r2 ; # constante r2{ 1 a 4}
Página57 de la volatilidad
set u = 0.0
nonlin b0 b1 b2 b3 a0 a1 a2 a3 a4
frml e = dly - b0 - b1*dly{1} - b2*u{1} - b3*u{4}
frml var = a0 + a1*e{1}**2 + a2*e{2}**2 + a3*e{3}**2 + a4*e{4}**2
frml L = (u = e), -.5*(log(var)+e(t)**2/var)
boxjenk(noprint,constant,ar=1,ma=||1,4||) dly
calcular b0=%beta(1), b1=%beta(2), b2 = %beta(3) , b3 = %beta(4)
calcular a0=%seesq, a1=.1 , a2 = .1 , a3 = .6 , a4 = .1
maximizar(iteraciones=75) L 6 *
* Para limitar los coeficientes en el proceso ARCH(4) a 0,4, 0,3, 0,2 y 0,1, utilice el
conjunto u = 0,0
nonlin b0 b1 b2 b3 a0 a1
frml e = dly - b0 - b1*dly{1} - b2*u{1} - b3*u{4}
frml var = a0 + a1*(.4*e{1}**2 + .3*e{2}**2 + .2*e{3}**2 + .1*e{4}**2)
frml L = (u = e), -.5*(log(var)+e(t)**2/var)
boxjenk(noprint,constant,ar=1,ma=||1,4||) dly
calcular b0=%beta(1), b1=%beta(2), b2 = %beta(3) , b3 = %beta(4)
calcular a0=%seesq, a1=.1 , a2 = .1 , a3 = .6 , a4 = .1
maximizar(iteraciones=75) L 6 *
*Los residuos están contenidos en la serie u. Puede realizar los diagnósticos apropiados en esta
serie.
/*A:ecuación de estimación
(3.16)*/ arima piet,ar(1) ma(1
4)
predecir los residuos, residuos
corren los residuos, lag(24) /*obtener el ACF y el PACF de los residuos*/
reg r2 l.r2
reg r2 l.r2 l2.r2 l3.r2 l4.r2 /*estimar una regresión lineal en forma de (3.17) usando cuatro
rezagos de los residuos cuadrados*/
prueba l2.r2 l3.r2 l4.r2 /*prueba si un modelo ARCH(1) es adecuado para caracterizar
el proceso de error*/
quietly reg r2 l.r2 l2.r2 l3.r2 l4.r2 l5.r2 l6.r2 l7.r2 l8.r2 /*utiliza ocho rezagos*/
prueba l5.r2 l6.r2 l7.r2 l8.r2 /*prueba si es necesario un modelo ARCH(4) para
caracterizar el proceso de error*/
arch piet,ar(1) ma(1 4) arch(1) garch(1) /*estimar piet usando un modelo ARMA(1,(1,4))
asumiendo un error GARCH(1,1)*/
Página59 de la volatilidad
7. La segunda serie del archivo ARCH.XLS contiene 100 observaciones de un ARCH-M
simulado
Página60 de la volatilidad
proceso. Los siguientes programas producirán los resultados indicados.
* Las siguientes tres líneas se leen en las 100 observaciones del archivo.
todos los 100
open data a:/arch. xls
data(format=xls,org=obs)
tabla / y_m;* La segunda serie del archivo se llama y_m. TABLA produce la deseada
;* estadísticas
resumidas.
* Realice la prueba del multiplicador de Lagrange para los errores ARCH(4) haciendo una
regresión del error al cuadrado por sí mismo
* cuatro rezagos.
linreg ressq; # constante ressq{1 a 4}
set u = 0.0
nonlin b0 b1 a0 a1
frml var = a0 + a1*u{1}**2;* ecuación de varianza frml e = y_m - b0 -
b1*var(t);* ecuación media
frml L = (u = e), -.5*(log(var)+e**2/var);* función de probabilidad
computar b0=.8, b1=.6 , a0=.2, a1=.7;* conjeturas iniciales maximizar L 2
*
Página61 de la volatilidad
Programa de muestra para los usuarios de STATA
claro
Página62 de la volatilidad
cd "X:\NNNNNuevos_datos" /*Por favor, cambie esta línea en consecuencia si el conjunto
de datos se guarda en otro lugar*/ insheet usando arch.txt
resumir y_m
gen obs = _n /*obs es 1,2,...,_N, un vector de columna que actúa como una
variable de tiempo*/ tsset obs /*declara que es un conjunto de datos de series
de tiempo*/
Página63 de la volatilidad
Var(yt|yt-1, yt-2,...) = Et-1[yt-Et-1(yt)]2
= Et-1 [(a0+a1yt-1+εt) - (a0+a1yt)]2 = Et-1(εt)2
= Et-1[α0 + α1(εt-1)2 + α2(εt-2)2]
= α0 + α1(εt-1)2 + α2(εt-2)2
Para encontrar la variación incondicional de (yt) encontrar la solución particular para (yt)
como:
Página64 de la volatilidad
yt = a0/(1-a1) + εt + a1εt-1 + (a1)2εt-2 + ...
Por lo tanto, la media incondicional es: Eyt = a0/(1-a1). Usando la solución para yt y Eyt,
la varianza incondicional de yt es:
E(εt)2 = α0 /(1-α1-α2)
B. Supongamos que {yt} es un proceso ARCH-M tal que el nivel de yt está positivamente
relacionado con su propia varianza condicional. Para simplificar, digamos que: yt = α0 + α1(εt-1)2 +
2
α2(εt-2) + εt. Trace la función de respuesta de impulso de {yt} a un choque de εt. Se puede suponer
que el sistema ha estado en equilibrio a largo plazo (εt-2 = εt-1 = 0) pero ahora ε1 = 1. Por lo tanto, la
cuestión es encontrar los valores de y1, y2, y3, y4 dado que ε2 = ε3 =...= 0.
. 2
y2 = α0 + α1(ε1)2 + α2(ε0)2 + ε2 = α0 + α1 + α2 0 + 0 = α0+α1
. 2 . 2
y3 = α0 + α1(ε2)2 + α2(ε1)2 + ε3 = α0 + α1 0 + α2 1 + 0 = α0+α2
. 2 . 2
y4 = α0 + α1(ε3)2 + α2(ε2)2 + ε4 = α0 + α1 0 + α2 0 + 0 = α0
. 2 . 2
2 2
y5 = α0 + α1(ε4) + α2(ε3) + ε5 = α0 + α1 0 + α2 0 + 0 = α0,....
Por lo tanto:
Página65 de la volatilidad
dy1/dε1 = 1; dy2/dε1 = α1; dy3/dε1 = α2; y dyi/dε1 = 0 para i > 3.
C. Use su respuesta a la Parte B para explicar el siguiente resultado. Un estudiante estimó {yt}
como un proceso de MA(2) y encontró que los residuos no están correlacionados en serie. Un
segundo estudiante estimó lo mismo
Página66 de la volatilidad
como el proceso ARCH-M: yt = α0 + α1(εt-1)2 + α2(εt-2)2 + εt. ¿Por qué ambas estimaciones podrían
parecer razonables? ¿Cómo decidiría usted cuál es el mejor modelo?
Responde: Si α1 y α2 son positivos, los valores positivos de εt se asociarán con los valores
positivos de yt, yt+1 y yt+2. Las realizaciones negativas de εt se asociarán con los valores
positivos de yt+1 y yt+2. En cualquier caso, yt+1 y yt+2 siempre parecerán moverse juntos.
Sin embargo, no hay una tendencia particular de yt+1 y yt+3 a moverse juntos. La secuencia
puede parecer un proceso de MA. La comprobación diagnóstica de los cuadrados de los
residuos del modelo MA(2) indicará si hay efectos ARCH-M. El punto (ver pregunta 8d) es
que un proceso ARCH-M puede parecer un proceso MA
9. Este programa produce los resultados de los datos de la Bolsa de Valores de Nueva York
utilizados en la Sección 10.
* Para empezar, las primeras cuatro líneas se leen en el conjunto de datos NYSE.XLS. Observe
que el conjunto de datos comienza el 3 de enero de 1995 y termina el 30 de agosto de 2002. La
semana típica tiene cinco observaciones. Sin embargo, el mercado cierra por eventos como las
vacaciones y el 11 de septiembre de 2001. No se ha hecho ningún intento de ajustar las fechas
para esas observaciones que faltan. Por lo tanto, el conjunto de datos contiene 1938
observaciones, por lo que parece terminar el 28 de mayo de 2001.
CAL(diario) 1995 1 3
todo 2002:9:30
open data a:\nyse. xls
data(org=obs,format=xls)
Página68 de la volatilidad
cor(qstats,number=24,span=4) resids ;* Obtener el ACF de los residuos a partir del conjunto de
MA(2) r2 = resids**2;* Crear los residuos cuadrados llamados r2.
cor(qstats,number=24,span=4) r2 ;* Obtener el ACF de r2.
* Las siguientes dos líneas realizan la prueba de LM para los errores de ARCH, regresando los
cuadrados residuales en
* sus propios cuatro rezagos. La estadística F es producida por la instrucción
EXCLUIR lin r2 ; # constante r2{1 a 4}
excluye ; # r2{1 a 4}
* Estima que el modelo IGARCH tiene los residuos nacionalizados en nres y el condicional
* variación en cvar (como se describe en la página 147, ht = cvar y nres = εt/(ht)0.5
@garch(mod=igarch,ma=1,p=1,q=1,nointeractive,nogra) rate / nres cvar
* Como en la página 147, compruebe los efectos de palanca haciendo una regresión de n2 en los
residuos normalizados retardados.
lin n2 ; # constante nres{1 a 3}
* Para la prueba de sesgo de signos positivos y negativos múltiples d1 y (1-d1) por los residuos
estandarizados, establecer xminus = d1*nres ; establecer xplus = (1-d1)*nres
lin n2 ;# constante d1{1} xmás{1} xmenos{1} ;* estimar la regresión
Página70 de la volatilidad
cd "X:\NNNNNuevos_datos" /*Por favor, cambie esta línea en consecuencia si el conjunto
de datos se guarda en otro lugar*/ insheet usando arch.txt
resumir y_m
gen obs = _n /*obs es 1,2,...,_N, un vector de columna que actúa como una
variable de tiempo*/ tsset obs /*declara que es un conjunto de datos de series
de tiempo*/
Página71 de la volatilidad
CAPÍTULO 4
MODELOS CON TENDENCIA
1. Tendencias determinantes y estocásticas 157
2. Eliminando la tendencia 164
3. Raíces de la unidad y residuos de regresión 170
4. El método de Monte Carle 175
5. Las pruebas de Dickey-Fuller 181
6. Ejemplos de la prueba de llenado de la polla 185
7. Extensiones de la prueba de llenado de la polla 189
8. Cambio estructural 200
9. El poder y los regidores deterministas207
10. Tendencias y descomposiciones univariantes 215
11. Pruebas de la raíz de la unidad de panel 225
12. Resumen y conclusiones 229
Sugerencias de conferencias
1. Un error común es que es posible determinar si una serie es estacionaria o no mediante la
inspección visual de la trayectoria temporal de los datos. Intento disipar esta noción utilizando
transparencias de los tipos de interés que se muestran en la figura 4.2 y los cuatro gráficos de la
figura 4.3. Encubro los encabezamientos de las figuras y pregunto a los estudiantes si creen que las
series son estacionarias. La mayoría argumentará que los tipos de interés no pueden comportarse
como procesos no estacionarios. Sin embargo, no serán capaces de discernir ninguna diferencia
entre las series de tipos de interés y los paneles (a) y (d) de la figura 4.3.
Todos están de acuerdo en que las dos series de los gráficos b) y c) de la figura 4.3 son no
estacionarias. Sin embargo, no hay una forma sencilla de determinar si las series son estacionarias
de tendencia o estacionarias de diferencia. Utilizo estos mismos gastos generales para explicar por
qué las pruebas de la raíz de la unidad tienen una potencia muy baja. La Figura 4.3 (con los pies de
foto eliminados) se reproduce en la siguiente página para su conveniencia.
2. Gran parte del material del capítulo 4 se basa en el material del capítulo 1. Recuerdo a los
estudiantes la relación entre las raíces características, la estabilidad y la estacionariedad. En este
punto, resuelvo algunas de las cuestiones matemáticas que implican el proceso de la raíz unitaria.
Pueden elegir entre las preguntas 5, 6, 9 y 10 del capítulo 1 y la pregunta 1 del capítulo 4.
Página59Modelos con
tendencia
Figure 4.3: Four Series W ith Trends
(a) (b )
10 56
8 48
6 40
4 32
2 24
0 16
-2 8
-4 0
10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100
(c) (d )
56 10
48 8
40 6
32 4
24 2
16 0
8 -2
0 -4
10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100
y1 = y0+ε1+0.5 ε0,
y2 = y1+ε2+0.5 ε1 = (y0+ε1+0.5 ε0) + ε2+0.5 ε1 = y0+ε2+1.5 ε1+0.5 ε0,
y3 = y2+ε3+0.5 ε2 = (y0+ε2+1.5 ε1+0.5 ε0) + ε3+0.5 ε2
= y0+ε3+1.5 ε2+1.5 ε1+0.5 ε0,
y4 = y3 + ε4 + 0.5ε3 = (y0 + ε3 + 1.5ε2 + 1.5ε1+ 0.5ε0) + ε4 + 0.5ε3
= y0 + ε4 + 1.5ε3 + 1.5ε2 + 1.5ε1+0.5ε0,
…
yt = y0+εt+1.5 (εt-1+εt-2 +...+ ε2+ε1) + 0.5 ε0.
Update the solution for yt by s periods so that the solution for yt+s can be written as:
Hence, the value of (yt+0.5εt) is the unbiased estimator of all future values of yt+s for all s>o.
B. yt = 1.1 yt-1 + εt
Update by s periods so that the solution for yt+s can be written as:
yt+s = 1.1syt + εt+s + 1.1 εt+s-1 + 1.12εt+s-2 +...+ 1.1s-2εt+2 + 1.1s-1 εt+1.
In contrast to part (a), the forecast function is not flat. As s increases, the forecast value will
grow at the rate of 1.1. Note also that this process is not stationary since it explodes.
C. yt = yt-1+1+εt
Answer: Iterating forward:
y1 = y0 +1+ε1,
y2 = y1+1+ε2 = (y0 +1+ε1) + 1+ε2 = y0 +2+ε2+ε1,
y3 = y2+1+ε3 = (y0 +2+ε2+ε1) +1+ε3 = y0 +3+ε3+ε2+ε1,
y4 = y3+1+ε4 = (y0 +3+ε3+ε2+ε1) +1+ε4 = y0 +4+ε4+ε3+ε2+ε1,
…
t
yt = y0 + t + ∑ εi
i=1
The solution for yt+s can be written as:
s
yt+s = yt + s + ∑ εt+i.
i=1
Taking the expectation, the forecast function is:
Etyt+s = yt + s
The mean change in yt is always the constant 1, is reflected in the forecast function.
This is a random-walk plus drift model with drift term equal to 1.
Página61Modelos con
tendencia
D. yt = yt-1+t+εt
Answer: Using the same technique as in A through C.
y1 = y0 +1+ε1,
y2 = y1+2+ε2 = (y0 +1+ε1) +2+ε2 = y0 +1+2+ε2+ε1,
y3 = y2+3+ε3 = (y0 +1+2+ε2+ε1) +3+ε3 = y0 +1+2+3+ε3+ε2+ε1,
y4 = y3+4+ε4 = (y0 +1+2+3+ε3+ε2+ε1) +4+ε4 = y0+1+2+3+4+ε4+ε3+ε2+ε1,
…
yt = y0 +(1+2+3 +...+ t) + (εt+εt-1 +...+ ε2+ε1).
y1 = µ1 + η1 + 0.5η0 = µ0 + ε1 + η1 + 0.5η0,
y2 = µ2+η2+0.5η1 = (µ1+ε2) +η2+0.5η1 = µ0+ε1+ε2+η2+0.5η1,
y3 = µ3+η3+0.5η2 = (µ2+ε3) +η3+0.5η2 = µ0+ε1+ε2+ε3+η3+0.5η2,
y4 = µ4+η4+0.5η3 = (µ3+ε4) +η4+0.5η3 = µ0+ε1+ε2+ε3+ε4+η4+0.5η3,
_
yt = µ0+ε1+ε2+...+εt-1+εt+ηt+0.5ηt-1.
In period zero, the value of y0 is given by: y0 = µ0+η0+0.5η-1 (assume that µ0, η0 and
η-1 are known) so that we can write the model as:
t
yt = (y0-η0-0.5η-1) + ∑ εi+ηt+0.5ηt-1.
i= 1
The solution for yt+s can be written as:
s
In period zero, the y0 is: y0 = µ 0+η0+0.5η-1. For given values of µ0,η0 and η-1:
Note that {yt} is a general trend plus irregular process. The change in the trend (i.e.,
∆µt) consists of a stochastic component εt plus a deterministic component (i.e., change 0.5).
The irregular component contains the stationary MA(1) process ηt+0.5ηt-1. Other properties
of this model can be seen in Section 8.
For Part D, write yt = yt-1 + t + εt as: ∆yt = t + εt. Now, simply detrend the ∆yt sequence to
obtain a stationary sequence.
Página63Modelos con
tendencia
H. Does model E have an ARIMA(p,1,q) representation?
Answer: The model has an ARIMA(0,1,2) representation. Recall that: yt = µt+ηt+0.5ηt-1,
where µt = µt-1+εt. Differencing once yields:
∆yt = εt + (1 - 0.5L - 0.5L2)ηt, where ∆yt is stationary.
Thus, the autocorrelation function of ∆yt has the same characteristics as an MA(2)
process, hence, yt has an ARIMA(0,1,2) representation.
2. Given the initial condition y0, find the general solution and the forecast function for the following
variants of the trend plus irregular model:
A. yt = µt+vt where µt = µt-1+εt, vt = (1+β1L) ηt and Eεtηt = 0.
Answer: Iterate from period zero forward to obtain:
y1 = µ1+v1 = µ0+ε1+η1+β1η0,
y2 = µ2+v2 = µ1+ε2+η2+β1η1 = µ0+ε2+ε1+η2+β1η1,
y3 = µ3+v3 = µ2+ε3+η3+β1η2 = µ0+ε3+ε2+ε1+η3+β1η2,
_
t
yt = µ0+ ∑ εi+ηt+β1ηt-1.
i=1
Página65Modelos con
tendencia
Hence the general solution for yt is:
t
yt = y0-η0-β1η-1 + ∑ εi+ηt+β1ηt-1
i= 1
Next, update by s periods so that:
s
B. yt = µt+vt where µt = µt-1+εt and vt = (1+β1L)ηt and the correlation between εt and ηt equals unity.
Answer: The general solution and the forecast function are identical to those given in part A.
The point is that the underlying model is not identified unless the correlation between the
innovations is known.
∆yt = εt + [1+(β1-1)L-β1L2]ηt.
and all higher autocorrelations are zero. Hence, the model acts as an ARIMA(0, 1, 2) process
such that:
ρ1 = -(1-β1)2σ2η / [σ2+2(β2 -β +1)σ2 ]
1 1 η
ρ2 = -β1σ2η / [σ2+2(β2 -β +1)σ2 ]
1 1 η
and ρi = 0 for i > 2.
Página66 Modelos con
tendencia
Difference the model of Part B to obtain:
Página67Modelos con
tendencia
∆yt = εt + [1+(β1-1)L-β1L2]ηt.
and all higher autocorrelations are zero. Hence, the model acts as an ARIMA(0, 1, 2) process
such that
ρ1 = [(β1-1)σση-(1-β1)2σ2η] /[σ2+2(β2 -β +1)σ2 +2σσ ]
1 1 η η
ρ2 = (-β1σση-β1σ2η) /[σ2+2(β2 -β +1)σ2 +2σσ ]
1 1 η η
and all ρi = 0 for i > 2.
3. The programming manual contains the program for RATS users. Even if you do not use RATS,
the logic is virtually identical for any software package. Notice that John’s results (see part c) are
similar to those reported from a standard t-table. Additional replications would improve the accuracy
of his results.
Página69Modelos con
tendencia
/*B:replicate the Monte Carlo results for the t-dist. of an autoregressive coefficient*/
capture program drop mc1
program mc1,rclass
version 8.0
drop _all
set obs 500 /*you may also change the sample size here, say 100*/
gen a0 = 2
gen epsilon = invnorm(uniform()) /*epsilon is a random variable distributed as N(0,1)*/
gen y = a0 + epsilon /*y is generated using the equation y = 2 + et*/
gen time = _n
tsset time
reg y l.y /*estimate the model under the alternative hypothesis*/
return scalar tdist1 = (_b[l.y]/_se[l.y]) /*obtain the t-stat of a single estimation*/
end
/*run the program mc1 a thousand times to obtain the Monte Carlo critical values of the t-stat*/
simulate "mc1" tdist1 = r(tdist1), reps(1000)
summarize tdist1, detail
sort tdist1
display tdist1[50] " " tdist1[950] /*show the critical values at 10% significance level*/
display tdist1[25] " " tdist1[975] /*show the critical values at 5% significance level*/
display tdist1[5] " " tdist1[995] /*show the critical values at 1% significance level*/
4. The columns in the file labeled REAL.XLS contain the logarithm of the real exchange rates for
Canada, Japan, Germany, and the U.K. The following program can be used to answer Question 4.
;* The following steps can be repeated for each real exchange rate series.
dif rcan / drcan ;* Create the first-difference of the Canadian rate.
Página71Modelos con
tendencia
set trend = t ;* create a time trend
lin drcan ; # constant rcan{1} drcan{1 to 12} ;* Now use 12 lags plus the time trend
* Use the ττ statistic to test for a unit root
/*ACF and PACF of the first difference of the real exchange rate*/
corrgram d.rcan, lag(12)
corrgram d.rger,lag(12)
corrgram d.rjap,lag(12)
corrgram d.ruk,lag(12)
Página72
/*C:DFModelos
and ADFcon
tests of unit root*/
tendencia
dfuller rcan /*Dicky-Fuller test for RCAN (No lags)*/
Página73Modelos con
tendencia
dfuller rcan, lags(12)/*Augmented Dicky-Fuller test for RCAN (12 lags)*/ dfuller
rcan, lags(12) trend /*Augmented Dicky-Fuller test for RCAN (Trend + 12 lags)*/
dfuller rger
dfuller rger, lags(12)
dfuller rger, lags(12) trend
dfuller rjap
dfuller rjap, lags(12)
dfuller rjap, lags(12) trend
dfuller ruk
dfuller ruk, lags(12)
dfuller ruk, lags(12) trend
5. The seasonal unit root procedures can be downloaded from the Estima website
www.estima.com. HEGYQNEW.SRC performs the Hylleberg, Engle, Granger, and Yoo
(HEGY) unit root test on quarterly data. MHEGY.SRC performs the test using monthly data.
cal 1960 1 4;* Read in the data set. The format is the same as that for Chapter 2 all 2002:1
datos abiertos
a:\\Ntrimestral. xls
data(format=xls,org=obs)
log m1nsa / lm1 ;* Call lm1 the log of the M1NSA series.
* Now regress the seasonal difference on a constant, trend, y1t-1, y2t-1, y3t-1, y3t-2, and various lags.
* You can experiment with different lag lengths and by including the deterministic seasonal
* dummy variables.
gen yt = ln(m1nsa)
/*form the four variables for quarterly data*/
gen y1t = l.yt + l2.yt + l3.yt + l4.yt
gen y2t = l.yt - l2.yt + l3.yt - l4.yt
gen y3t = l.yt - l3.yt
gen y4t = l2.yt - l4.yt
/*estimate the regression(Intercept + Seasonal dummies + time + no lags)*/
reg s4.yt time y1t y2t y3t y4t
test y3t y4t /*determine whether there is a seasonal unit root in M1*/
/*use the package "hegy4" to perform the test for seasonal unit root in a quarterly timeseries.
First search "seasonal unit root" in the range "all",then click to install the module "HEGY4"*/
hegy4 yt, lags(1/9) det(strend) /*estimate the regression(Intercept + Seasonal dummies + time
+ 9 lags)*/
6. The second column in the file BREAK.XLS contains the simulated data used in Section 8.
all 100;* These three lines read in the data set open data a:\break.xls
data(format=xls,org=obs)
* The graph of the series shown in Figure 4.10 was created using
graph 1 ; # y1
Página75Modelos con
tendencia
dif y1 / dy1;* Difference y1
* The next three lines perform the Dickey-Fuller tests reported on the top of page 207.
linreg dy1 ; # y1{1}
linreg dy1 ; # constant y1{1}
linreg dy1 ; # constant trend y1{1}
* Next, create a dummy variable with a break occurring in period 51
set dummy = %if(t.ge.51,1,0)
* Regress y1 on a constant, a trend and the dummy variable. Save the residuals as resids
lin y1 / resids ; # constant trend dummy
cor y2 ;* Creates the ACF of y2. Note that the ACF shows little decay dif y2 / dy2;*
Difference y2
* Now perform the Dickey-Fuller test. Diagnostic testing does not reveal the need for
* any lagged changes. Nevertheless, the constant and trend do not appear to be significant.
lin dy2 ; # constant trend y2{1}
* Now estimate y2t = a0 + a2t + µ2DL and save the residuals as resids
lin y2 / resids; # constant trend dummy
* The coefficient on the lagged residual is 0.965. The series seems to contain a unit root.
* Instead create a pulse dummy called d2; d2 = 1 only in period 51
set d2 = %if(t.eq.51,1,0)
* The coefficient on the lagged residual is 0.982. Hence, there is a unit root.
Página76 Modelos con
tendencia
Sample Program for Stata Users
claro
cd "x:\New_data"
insheet using quarterly.txt
gen obs = _n
tsset obs
/*B:perform the Perron test to determine if real gdp is trend stationary with a break occuring
in mid-1973*/
gen x=0
replace x=1 if _n>=55 /*generate a dummy variable x which takes the value 1 after
1973Q3*/
reg lgdp x obs
predict resid,residuals
dfuller resid,noconstant
reg resid l.resid, noconstant
predict resid1,residuals
corrgram resid1,lag(12)
7. The file QUARTERLY.XLS contains the real GDP data that was used to estimate (4.45).
A. The following program will replicate the results in Section 9.
* The data set runs from 1960Q1 through 2002Q1. Read in the data with
cal 1960 1 4
all 2002:1
datos abiertos
a:\\Ntrimestral. xls
data(format=xls,org=obs)
B. Create the level and pulse dummies beginning with the fourth quarter of 1973
set level = %if(t.ge.1973:4,1,0)
set pulse
C. * RATS contains the procedures BNDECOMP.SRC and HPFILTER.SRC that allow you
to perform the Beveridge-Nelson decomnposition and the HP filter. If you do not have the
procedures, you can download them from the Estima website www.estima.com. You can
perform the two decompositions using
source(noecho) c:\winrats\bndecomp.src
@bndecomp(log) gdp perm 1960:1 1970:1 2002:1 2 0
source(noecho) c:\winrats\hpfilter.src
@hpfilter gdp / hp_rgdp
/*B:perform the Perron test to determine if real gdp is trend stationary with a break occuring
in mid-1973*/
gen x=0
replace x=1 if _n>=55 /*generate a dummy variable x which takes the value 1 after 1973Q3*/
reg lgdp x obs
predict resid,residuals
Página79Modelos con
tendencia
dfuller resid,noconstant
reg resid l.resid, noconstant
predict resid1,residuals
corrgram resid1,lag(12)
8. The file PANEL.XLS contains the real exchange rate series used to perform the panel unit root
tests reported in Section 12.
A. Replicate the results of Section 12.
SAMPLE RATS PROGRAM
cal 1980 1 4;* The first four lines read in the data set. The quarterly observations all 2002:2
;* begin in 1980Q1 and end in 2002Q2.
open data a:\panel.xls
data(format=xls,org=obs)
* To select lag lengths, you can begin with 8 lags and pare down the model by dropping a lag if
* it is not significant at the 5% level. An automated way to do this is to use a do loop. Consider
log australia / lx ; dif lx / dlx ;* Form the logarithmic change in the real Australian rate
do i = 8,1,-1 ;* Use lag 8 through 1 in steps of -1
* Now, perform a augmented Dickey-Fuller test using lags 1 to i
lin(noprint) dlx ; # dlx{1 to i} lx{1} constant
dis i %tstats(i) %tstats(i+1) ; Display the t-stat for lag i and for Dickey-Fuller test
end do i
* Repeat for each country for find the lag lengths reported in Table 4.8.
* To find the common time effect, form the average value of the real rate
* Subtract the time average from each rate. Since we are using logs, we can use the following
* to create log of the modified Australian real rate
set lx = log(australia/aver); dif lx / dlx
* Repeat for each nation and perform the Dickey-Fuller test for each. For the Australian case
do i = 8,1,-1
Página80 Modelos con
tendencia
lin(noprint) dlx ; # dlx{1 to i} lx{1} constant
dis i %tstats(i) %beta(i+1) %tstats(i+1)
end do i
B. If Germany and Canada are excluded from the sample, the evidence in favor of PPP is much
stronger. However, the selection of the panel should be made on theoretical grounds.
C. As in a standard unit root test, the power of a panel unit root test is decreased in the presence of
a time trend that is not actually in the data generating process.
Q9. The Programming Manual contains the complete answer Questions 9 for RATS users.
Programa de muestra para los usuarios de STATA
claro
set seed 12
/*B:show the downward bias for the first-order AR coefficient in sample of 100 and 50
observations*/
/*this is to replicate the results with a sample size of 100*/
capture program drop bias
program define bias,rclass
version 8.0
drop _all
args alpha1
set obs 100 /*to see the results of a smaller sample size, just change the obs to 50*/
gen time = _n
tsset time
gen y=0
gen ep=invnorm(uniform())
forvalues i=1/100 {
replace y=`alpha1'*y[`i']+ep[`i'+1] if (_n>`i')
}
reg y l.y
return scalar discrep = `alpha1' - _b[l.y]
end
Página81Modelos con
tendencia
summarize discrep
simulate "bias 0.9" discrep = r(discrep),reps(1000)
summarize discrep
simulate "bias 0.99" discrep = r(discrep),reps(1000)
summarize discrep
simulate "bias 0" discrep = r(discrep),reps(1000)
summarize discrep
end
Página83Modelos con
tendencia
display " when alpha1=0.99,the power of the test(10% significance level) = "=r(N)
summarize hits5
display " when alpha1=0.99,the power of the test(5% significance level)= "=r(N)
summarize hits1
display " when alpha1=0.99,the power of the test(1% significance level)= "=r(N)
Página85Modelos con
tendencia
CHAPTER 5
MULTIEQUATION TIME-SERIES MODELS
1. Intervention Analysis 240
2. Transfer Function Models247
3. Estimating a Transfer Function 257
4. Limits to Structural Multivariate Estimation 261
5. Introduction to VAR Analysis 264
6. Estimation and Identification 269
7. The Impulse Response Function 272
8. Testing Hypotheses 281
9. Example of a Simple VAR:Terrorism and Tourism in Spain 287
10. Structural VARs291
11. Examples of Structural Decompositions 295
12. The Blanchard–Quah Decomposition 301
13. Decomposing Real and Nominal Exchange Rates: An Example 307
14. Summary and Conclusions 310
Sugerencias de conferencias
1. Although many economists are skeptical of parsimonious intervention and transfer function
models, it is wise not to skip Sections 1 through 3. These sections act as an introduction to VAR
analysis. In a sense, VAR analysis can be viewed as a progression. Intervention analysis treats {yt}
as stochastic and {zt} as a deterministic process. Transfer function allows {zt} to be stochastic, but
assumes that there is no feedback from the {yt} sequence to the {zt} sequence. The notion of an
autoregressive distributed lag (ADL) is also introduced here. Finally, VAR analysis treats all
variables symmetrically. Use Section 4 to explain the limitations of intervention and transfer
function analysis and to justify Sims' methodology.
2. You should emphasize the distinction between the VAR residuals and the structural innovations.
Questions 4, 5, and 6 at the end of the chapter are especially important. I work through one of these
questions in the classroom and assign the other two for homework. You might also make an
overhead of Figure 5.7 in order to illustrate the effects of alternative orderings in a Choleski
decomposition. A large-sized version of the figure is included here for your convenience.
1 1
0.5 0.5
0 0
0 10 20 0 5 10 15 20
(a) (b)
0.25 0.25
A. Show how each of the following {yt} sequences responds to the three types of interventions:
i) yt = 0.5yt-1 + zt + t
Answer: Using lag operators to solve for yt:
Note that dyt+i/dzt = dyt/dzt-i and that for a pure pulse, only z1 = 1. Hence:
dyt/dzt = 1; dyt+1/dzt = dyt/dzt-1 = 0.5; dyt+2/dzt = dyt/dzt-2 = 0.25; ... . Thus, for t 1:
dyt/dz1= (0.5)t-1
Notice that as t , the limiting value of the pure jump is: dyt/dz1 = 1/(1-0.5) = 2.0.
For the prolonged impulse, use the solution for yt and treat: dz1 = 1; dz2/dz1 = 0.75; dz3/dz1 =
0.5; dz4/dz1 = 0.25 and all other values of dzi = 0. Thus, the impulse responses are: obtained
as:
dy1/dz1 = 1; dy2/dz1 = 1(0.75) + 0.5(1); dy3/dz1 = 1(0.5)+0.5(0.75) + 0.25(1); and for t 4:
dyt/dz1 = 0.5t-1 + 0.75(0.5)t-2 + 0.5(0.5)t-3 + 0.25(0.5)t-4
ii) yt = -0.5yt-1 + zt + t
Answer: Use lag operators to write:
(1 + 0.5L) yt = zt + t.
yt = (zt + t)/(1+0.5L)
= zt + (-0.5)zt-1 + (-0.5)2zt-2 + (-0.5)3zt-3 + ... + (-0.5)izt-i + ... + t/(1+0.5L)
iv) yt = yt-1 + zt + t
Answer: Write the solution for yt using (1-L)yt = zt + t, so that given y0:
B. Notice that the intervention models in iv) and v) have unit roots. Show that the intervention
variable z1 = 1; z2 = -l; and all other values of zi = 0, has only a temporary effect on these two
sequences.
Answer: From the solution for yt in part iv), yt = zt + zt-1 + zt-2 + zt-3 + ... + z1 + t + ... + 1 +
y0. Set z1 = 1 and z2 = -1 so that:
dy1/dz1 = 1, dy2/dz1 = 1 -1 = 0, so that for all t 2:
dyt/dz1 = 0
For the model in part v), yt = (zt + t)/[(1-L)(1+0.25L)]. Abstracting from terms
containing elements of the {t} sequence, the improper form of the particular solution is:
To find the proper form of the solution, it is necessary to impose two initial
conditions. However, from the improper form of the solution, it is clear that for z1 = 1 and z2
= -1:
dy1/dz1 = 1, dy2/dz1 = -1 + 0.75 = -0.25, dy3/dz1 = 0 - 0.75 + (1 - 0.25 + 0.252), ... and:
dyt/dz1 = (-0.25)t-1 for t 1.
Hence, the long-run effect converges to zero.
C. Show that an intervention variable will not have a permanent effect on a unit root process if all
values of zi sum to zero.
Answer: If yt has a single unit root, the model can be written in the form (1-L)A(L)yt = zt + t.
D. Discuss the plausible models you might choose if the {yt} sequence is:
i) stationary and you suspect that the intervention has a permanent effect on Eyt.
Answer: The intervention variable {zt} might be a pure jump or gradually increasing
(decreasing) process.
ii) stationary and you suspect that the intervention has a growing and then a diminishing
effect.
Answer: The intervention variable {zt} might be a prolonged impulse process.
iii) non-stationary and you suspect that the intervention has a permanent effect on the level of
{yt}.
Answer: Model {yt} as a unit root process and model the intervention variable {zt} as a pulse
or gradually increasing (decreasing) process.
iv) non-stationary and you suspect that the intervention has a temporary effect on the level of
the {yt}.
Answer: Model {yt} as a unit root process and model the intervention variable {zt} such that
the values of zi sum to zero.
v) non-stationary and you suspect that the intervention increases the trend growth of {yt}.
Answer: Model {yt} as a unit root process and model the intervention variable {zt} as a pure
jump or gradually increasing process.
2. Let the realized value of the {zt} sequence be such that z1 = 1 and all other values of zi = 0.
A. Use equation (5.11) to trace out the effects of the {zt} sequence on the time path of yt.
Answer: From (2.9) yt = a1yt-1 + c0zt + t so that:
yt = (c0zt + t)/(1-a L)
2 12 i i
= c0(1+a1L+a1 L +...+a 2 1 L +...) zt + it/(1-a1L)
= c0zt + c0a1zt-1 + c0a1 zt-2 + ... + c0a1 zt-i + ... + t/(1 - a1L)
Since the form of the equation is identical to that in part A, it follows that:
d(y1)/dz1 = c0, d(y2)/dz1 = c0a1, d(y3)/dz1 = c0a 12, ..., and in general:
d(y1+i)/dz1= c0a1i .
To find the effects of the {zt} sequence on the time path of yt, write (2.10) as follows:
yt = c0zt/[1-(1+a1)L+a1L2] + t/[1-(1+a1)L+a1L2]
= c0zt/[(1-L)(1-a1L)] + t/[1-(1+a
2 2 1
)L+a1L2] 2 i i
= c0[1+(1+a1)L + (1+a1+a1 )L + ... + (1+a1+a1 +...+a1 )L +...] zt
+ t/[1-(1+a1)L+a1L2]
2 2 i
= c0zt + c0(1+a1)zt-1 + c0(1+a1+a1 )zt-2 +...+ c0(1+a1+a1 +...+a1 )zt-i + ...
+ t/[1-(1+a1)L+a1L2]
Hence, dyt/dzt = c0, dyt/dzt-1 =2 dyt+1/dzi t = c0(1+a1), dyt/dzt-2 = dyt+2/dzt = c0(1+a1+a 12),
and dyt/dzt-i = dyt+i/dzt = c0(1+a1+a1 +...+a1 ), ... . 2
It follows that dy1/dz1 = c0, dy2/dz1 = c0(1+a1), dy3/dz1 = c0(1+a1+a1 ), ... and:
dy1+i/dz1 = c0(1 + a1 + a 12 + ... + a1i).
C. Use (5.13) to trace out the effects of the {zt} sequence on the time patterns of yt and yt.
Answer: Write (2.11) as follows:
yt = c0(1-L)zt/[1-(1+a1)L+a1L2] + t/[1-(1+a1)L+a1L2]
= c0(1-L)zt/[(1-L)(1-a1L)] + t/[(1-L)(1-a1L)]
= c0zt/(1-a1L) +2 2t/[(1-L)(1-a
i i 1
L)]
= c0[1+a1L+a1 L +...+a 2 1
L +...]zt + i t/[(1-L)(1-a1L)]
= c0zt + c0a1zt-1 + c0a1 zt-2 +...+ c0a1 zt-i +...+ t/[(1-L)(1-a1L)]
Página88 Modelos de series temporales de
multiecuaciones
Hence, dyt/dzt-i = dyt+i/dzt = c0a 1i. Given that z 1 = 1 and all other z i= 0:
Next, to find the effects of the {zt} sequence on the time path of yt, rewrite (2.11) as:
yt = a1yt-1 + c0(1-L)zt + t.
i-1 t + t/(1-a1L)
= c0[1+(a1-1)L+a1(a1-1)L2+a1 (a1-1)L2 +...+a (a1-1)L +...]z
= c0zt+c0(a1-1)zt-1+c0a1(a1-1)zt-2+c0a1 (a1-1)zt-3+... + c0a1 (a1-1)zt-i+...+ t/(1-a1L).
Hence, dw
i-1t
/dzt = c0 and for i > 0, dwt/dzt-i = dwt+i/dzt = dyt+i/dzt = c0a 1i-1 (a1-1). Thus:
dyt+i/dzt = c0 a1 (a1-1).
D. Would your answers to parts A through C change if {zt} was assumed to be a white noise process
and you were asked to trace out the effects if a zt shock of the various {yt} sequences?
Answer: The answers will not change if {zt} was assumed to be a white noise process.
Since if we were interested to trace out the effects of a zt shock (which equals to unity), we
only need to change the time index from 1 to t in parts A through C.
E. Assume that {zt} is a white noise process with a variance equal to unity.
(i) Use (5.11) to derive the cross-correlogram between {zt} and {yt}.
Answer: From part A, we obtain:
2 i
yt = c0zt + c0a1zt-1 + c0a1 zt-2 +...+ c0a1 zt-i +...+ t/(1-a1L).
Eytzt = c0
Eytzt-1 = c0a1
...
Eytzt-i = c0a1i.
ii) Use (5.12) to derive the cross-correlogram between {zt} and {yt}.
Answer: Again, let wt yt, so that:
Note that the pattern of the cross-correlogram is the same as that above, i.e.,
2 2 2 1/2
yz(i) c0(a1)i/[(c0 + )/(1-a1 )]
(iii) Use (5.13) to derive the cross-correlogram between {zt} and {yt}.
Answer: Let wt yt, and using lag operators to write: (1-a1L)wt = c0(1-L)zt + t.
Forming the Yule-Walker equations and noting that {zt} and {t} are
Ewtzt = Eytzt = c0
Ewtzt-1 = Eytzt-1 = c0(a1-1)
Ewtzt-2 = Eytzt-2 = c0a1(a1-1)
...
Ewtzt-i = Eytzt-i = c0a 1i-1 (a1-1).
(iv) Now suppose that zt is the random walk process zt = zt-1 + zt. Trace out the effects of an
zt shock on the yt sequence.
Answer: Case (1): yt = a1yt-1 + c0zt + t. Since (1-L)zt = zt, it follows that:
Case (2): yt = a1yt-1 + c0zt + t. Define wt = yt and note that zt = zt. Hence:
wt = a1wt-1 + c0zt + t .
3. Consider the transfer function model: yt = 0.5 yt-1 + zt + t where zt is the autoregressive process:
zt = 0.5 zt-1 + zt
A. Derive the cross-correlation between the filtered {yt} sequence and the {zt} sequence.
Answer: Since zt = 0.5 zt-1 + zt, we may write the {zt} sequence as: (1-0.5L)zt = zt. In terms
of the notation used in the text, D(L) (1-0.5L) and E(L) 1, so that D(L)zt = E(L)zt. Also
let A(L) = 0.5, C(L) = 1, and B(L) = 1, so that:
Página93 Modelos de series temporales de
multiecuaciones
yt = A(L)yt-1 + C(L)zt + B(L)t. Here, the filtered value of yt (yft) is:
Eyftzt = 2z
Eyftzt-1 = 0.52z
Eyftzt-2 = 0.52 2z
Eyftzt-3 = 0.53 2z, so that in compact form:
Eyftzt-i = 0.5i 2z.
The cross-correlation between yft and zt-i is defined as:yz(i) = Cov(yft, zt-i)/(yfz).
Since Eyft = 0, Ezt = 0, and var(yft) = (1+0.52+0.54+0.56+...)2z + 2, it follows that yf = (4/3
2z + 2)1/2 . Hence, the cross-correlations between the filtered {yt} sequence and the {zt}
sequence are:
You can obtain the Yule-Walker equations in precisely the same way as in part A above. For an
alternative solution technique, obtain the moving average representation for yft as:
yft = (1+0.5L)zt/(1-0.5L) + t
= (1+L + 0.5L2 + 0.52L3 + 0.53L4 + 0.54L5 +...) zt + t
= zt + zt-1 + 0.5 zt-2 + 0.52 zt-3 + 0.53 zt-4 + 0.54 zt-5 +... + t.
Eyftzt = 2z ,
Eyftzt-1 = 2z ,
Eyftzt-2 = 0.5 2z ,
Eyftzt-3 = 0.52 2z
...
Eyftzt-i = 0.5i-1 2z for all i 2
Clearly, the cross-autocovariances decay at the rate of 0.5. Since c0 = 1, it is obvious
that the first two autocovariances are proportional to the transfer function coefficients.
4. Use (5.28) to find the appropriate second-order stochastic difference equation for yt.
yt 0.8 0.2 yt1 e1t
= +
z t 0.2 0.8 e2t
z t1
One way to answer the questions is to first transform the first-order VAR in the {yt}
and {zt} sequences into a second-order difference equation for yt. Using (5.10), it follows
that:
B. Discuss the shape of the impulse response function of yt to a one unit shock in e1t and to a one
unit shock in e2t.
Answer: Iterating backwards from t yields:
yt = (1+0.8L + 0.80.6L2 + 0.80.62L3 + 0.80.63L4 + ...) e1t
Página96 Modelos de series temporales de
multiecuaciones
+ (0.2L + 0.32L2 + 0.392L3 + 0.4352L4 + 0.46112L5 +...)e2t .
Hence,
dyt+1/de1t = dyt/de1t-1 = 0.8; dyt+1/de2t = dyt/de2t-1 = 0.2
D. Suppose e1t = yt and that e2t = 0.5yt + zt. Discuss the shape of the impulse response function of
yt to a one-unit shock in yt. Repeat for a one-unit shock in zt.
Answer: The responses to an zt shock are identical to those given in part B above. However,
in response to a one-unit shock in yt, zt changes by 0.5 units. Hence, the response to an yt
shock is equal to that reported in part B plus 0.5 times the effect of an zt shock on yt+i, i.e.,
E. Use your answers to C and D to explain why the ordering in Choleski decomposition is
important.
Answer: In essence, part C uses a Choleski decomposition such that the current value of yt
does not have a contemporaneous effect on zt. In part D the current value of zt does not have a
contemporaneous effect on yt. Both models show that the effect of a one unit shock of yt will
eventually die out (with different rates). However, the impulse responses of {yt} to an zt
shock are profoundly different. In C, the effects of zt shocks eventually die out; in parts B
and D, the effects of zt shocks increase without bound.
F. Using the notation in (5.27), find (A1)2 and (A1)3. Does (A1)n appear to approach zero (i.e., the null
matrix)?
Answer:
0.8 0.2 0.8 0.2 0.68 0.32
A1 A1 = =
0.2 0.8 0.32 0.68
and: 0.8 0.2
The expression (A1)n does not approach zero as n increases. Instead (A1)n approaches:
n 0.5 0.5
A1 =
0.5 0.5
Thus, for large n, A1(A1)n = (A1)n. To verify this result, note that:
0.8 0.2 0.5 0.5 0.5 0.5
=
0.2 0.5 0.5 0.5
0.8 0.5
5. Using the notation of (5.20) and (5.21) suppose: a10 = 0, a20 = 0, a11 = 0.8, a12 = 0.2, a21 = 0.4, and
a22 = 0.1.
A. Find the appropriate second-order stochastic difference equation for yt. Determine whether the
{yt} sequence is stationary.
Answer: Using the same technique as in question 4, the solutions for yt and zt are:
Notice that the inverse characteristic equation has a single root; i.e.,
B. Answer the parts B through F of Question 4 using these new values of the a ij
Part B: Discuss the shape of the impulse response function of yt to a one unit shock in e1t and to a
one unit shock in e2t.
Answer: Write the solution for yt in its moving-average form:
yt = (1+0.8L + 0.80.9L2 + 0.80.92L3 + 0.80.93L4 +...) e1t
+ (0.2L + 0.20.9L2 + 0.20.92L3 + 0.20.93L4 +...) e2t .
Página99 Modelos de series temporales de
multiecuaciones
Hence the impulse responses are:
dyt+1/de1t = dyt/de1t-1 = 0.8,dyt+1/de2t = dyt/de2t-1 = 0.2
dyt+2/de1t = dyt/de1t-2 = 0.80.9 = 0.72,dyt+2/de2t = dyt/de2t-2 = 0.20.9 = 0.18 dyt+3/de1t
= dyt/de1t-3 = 0.80.92 = 0.648,dyt+3/de2t = dyt/de2t-3 = 0.20.92 = 0.162 dyt+4/de1t =
dyt/de1t-4 = 0.80.93 = 0.5832,dyt+4/de2t = dyt/e2t-4 = 0.20.93 = 0.1458
...
Part D. Suppose e1t = yt and e2t = 0.5yt + zt. Discuss the shape of the impulse response
function of yt to a one unit shock in yt. Repeat for a one unit shock in zt.
Answer: Now, the effects of an zt are unchanged from the answer in part B. However, the
yt shock induces a 0.5 change in e2t. Hence, the response to an yt shock is equal to that
reported in part B plus 0.5 times the effect of an e2t shock on yt+i:
dyt+1/dyt = 0.9, dyt+2/dyt = 0.81, and in general:
dyt+i/dyt = dyt/dyt-i = (0.9)i
Part E. Use your answers to parts C and D to explain why the ordering in a Choleski
decomposition is important.
Answer: A Choleski decomposition equates 100% of the 1-step ahead forecast error in one
of the variables with a pure innovation in that variable. In part C, for example, e2t is
equivalent to an innovation in zt. The triangular structure means that an e2t shock has a
contemporaneous effect on yt and zt but that an e1t shock has a contemporaneous effect only
on yt. Since the VAR innovations cannot be identified, the restriction imposed by Choleski
decomposition is not testable. Part D introduces the alternative Choleski decomposition.
Obviously, the decay patterns present using the alternative decompositions are quite
different.
Part F. Using the notation in (5.19), find (A1)2 and (A1)3. Does (A1)n appear to approach zero
(i.e., the null matrix) ?
Answer:
0.8 0.2 0.8 0.2 0.72 0.18
A1 A1 = =
0.4 0.1 0.36 0.09
0.1 0.4
A1 = =
0.36 0.09 0.8 0.324 0.081
0.2
Página101 Modelos de series temporales de
multiecuaciones
As opposed to the answer in question 4, here (A1)n does approach zero.
Here, yt has a non-zero mean. However, the impulse responses are invariant to the
non-zero intercept.
6. Suppose the residuals of a VAR are such that Var(e1) = 0.75, Var(e2) = 0.5 and Cov(e1t, e2t) =
0.25.
A. Using (5.55)-(5.58) as guides, show that it is not possible to identify the structural VAR.
Answer: Given that:
0.25
0.75
=
0.25 0.5
it follows that:
=
The second and third are identical. Hence, there are three independent equations to
solve for the four unknowns b12, b21, Var(1), and Var(2). Without an additional restriction,
it is not possible to identify the structural VAR.
B. Using Choleski decomposition such that b12 = 0, find the identified values of b21, Var(1), and
Var(2).
Answer: If b12 = 0, the three independent equations in part A yield:
Var(1) = 0.75
0= 0.25 + 0.75b21, so that: b21 = -1/3.
Página103 Modelos de series temporales de
multiecuaciones
Var(2) = 0.5 + 0.5b21 + 0.75b221 = 5/12.
C. Using Choleski decomposition such that b21 = 0, find the identified values of b12, Var(1), and
Var(2).
Answer: If b21 = 0, the three independent equations in part A yield:
D. Using a Sims-Bernanke decomposition such that b12 = 0.5, find the identified values of b21,
Var(1), and Var(2).
Answer: If b12 = 0.5, we find:
E. Using a Sims-Bernanke decomposition such that b21 = 0.5, find the identified values of b12,
Var(1), and Var(2).
Answer: If b21 = 0.5, we find:
F. Suppose that the first three values of e1t are estimated to be 1, 0, -1 and that the first three values
of e2t are estimated to be -1, 0, 1. Find the first three values of 1t and 2t using each of the
decomposition in parts B through E.
Answer: Given that the first three errors terms are:
t e1t e2t
1 1.0-1.0
2 0.00.0
3 -1.01.0
then 21 = 2/3, 12 = 21 = -2/3, and 2 = 2/3 . Hence, the variance/covariance matrix is:
2
2/3-2/3
= so that
-2/32/3
=
Página105 Modelos de series temporales de
multiecuaciones
0.0 var( 2) 1 - 2/3 1
b 21 2/3 b12
If b12 = 0, we find:
Var(1) = 2/3.
0= -2/3 + 2/3 b21, so that: b21 = 1.
Var(2) = 2/3 - 4/3 b21 + 2/3 b2 21 so that Var(2) = 2/3 - 4/3 + 2/3 = 0.
Using the notation of the text, each {1t} and {2t} sequence can be recovered as t =
Bet so that:
Var(2) = 2/3.
0= -2/3 + 2/3 b12, so that: b12 = 1.
Var(1) = 2/3 - 4/3 b12 + 2/3 b2 , so that Var( ) = 0.
12 1
Using the notation of the text, each {1t} and {2t} sequence can be recovered as t =
Bet so that:
t 1t 2t
1 0.0-1.0
2 0.00.0
3 0.01.0
7. This set of exercises uses data from the file entitled QUARTELY.XLS. In Chapter 2 the
logarithmic changes in the U.S. Producer Price Index and M1 (not seasonally adjusted) were
both estimated using the Box-Jenkins method. Here, the goal is to model both simultaneously
using a VAR.
Program for RATS Users
* The first four lines read in the data set
cal 1960 1 4
all 4 2002:1
datos abiertos
a:\\Ntrimestral. xls
data(format=xls,org=obs)
* Next, create the growth rate of the money supply (gm1) and the inflation rate (inf)
set gm1 = log(m1nsa) - log(m1nsa{1})
set inf = log(ppi) - log(ppi{1})
seasonal seasons; * Create the seasonal dummy variable
* Now use 8 lags. Be sure to begin the estimation in 1963Q2 so that the two systems are
* estimated over the same sample period.
system 1 to 2
vars gm1 inf
lags 1 to 8
Página108 Modelos de series temporales de
multiecuaciones
det constant seasons{-2 to 0}
system 1 to 2
vars gm1 inf
lags 1 to 4
det constant seasons{-2 to 0}
end(system)
estimate(noprint) 62:2 * 3
ratio(degrees=16,mcorr=20) 62:2 *;* Estimate beginning with 1962Q2. Now the small
# 1 2;* correction is 20 since the 8-lag equations contain 20
# 3 4;* regressors (8 lags of each variable plus the intercept
;* plus the three seasonals
* The 8-lag model including the seasonals and intercepts can be estimated using
system 1 to 2
vars gm1 inf
lags 1 to 8
det constant seasons{-2 to 0}
end(system)
estimate(outsigma=V,sigma) / 1
* The following can be used to produce the impulse responses and variance decompositions
errors(impulses) 2 24 V
#1;#2
system 1 to 2
Página110 Modelos de series temporales de
multiecuaciones
vars m1 lp
lags 1 to 12
det constant seasons{-2 to 0}
end(system)
estimate / 1
errors(impulses) 2 24 V
#1;#2
/*iii:perform the likelihood ratio test for the null hypothesis of 8 lags*/
scalar lr8 = (e(T)-numpar12)*(ldet8-ldet12)
display "likelihood ratio = "= lr8
/*iv:estimate the VARs with 8 and 4 lags over the same sample period (1962Q2 - 2002Q1)*/
quietly var mt piet,lags(1/8) exog(d1 d2 d3)
scalar ldet88 = ln(e(detsig))
display ldet88
scalar numpar8 = e(tparms)/e(neqs)
quietly var mt piet in 10/169,lags(1/4) exog(d1 d2 d3)
scalar ldet4 = ln(e(detsig))
display ldet4
/*perform the likelihood ratio test for the null hypothesis of 4 lags*/
scalar lr4 = (e(T)-numpar8)*(ldet4-ldet88)
display "likelihood ratio = "= lr4
display "the significance level of the likelihood ratio stat = "= chi2tail(e(neqs)*numpar8-
e(tparms), lr4)
The results indicate that gm1 Granger causes inf . At conventional significance levels, inf does not
Granger cause gm1.
The VAR treats seasonality using deterministic dummy variables. One issue might be the
presence of a seasonal unit root in the M1NSA series. The 2-variable VAR omits the presence of
other potentially important influences on the variables. The other examples in the text suggest that
real GDP and interest rates can have important influences on the money supply and inflation.
Página112 Modelos de series temporales de
multiecuaciones
9. Most of Question 9 is answered in the Programming Manual. For part F, notice that dlrgdp shows
no contemporaneous response to either dlrm2 or drs shocks. Hence, dlrgdp must be causally prior
to dlrm2 and drs. Also notice that dlrm2 shows no contemporaneous response to drs. Hence,
dlrm2 must be causally prior to drs. The scales in the figures are difficult to interpret because the
variables have different units. Notice that real GDP and the money supply are expressed in
logarithmic form while drs is the change in the short-term interest rate. As such, to compare the
magnitudes of the various effects is it typical to standardize units so as to express the responses in
terms of standard deviations.
/*c:perform the likelihood ratio test for the null hypothesis of 8 lags*/
scalar lr8 = (e(T)-numpar12)*(ldet8-ldet12)
display "likelihood ratio = "= lr8
display "the significance level of the likelihood ratio stat = "= chi2tail(e(neqs)*numpar12-
e(tparms), lr8)
Página113 Modelos de series temporales de
multiecuaciones
/*D:show that drs is not block exogenous for dlrgdp and dlrm2*/
quietly var dlrgdp dlrm2 drs, lags(1/12)
scalar ldet3d = ln(e(detsig))
scalar numpar3d = e(tparms)/e(neqs)
quietly var dlrgdp dlrm2,lags(1/12)
scalar ldet2d = ln(e(detsig))
scalar lrd = (e(T)-numpar3d)*(ldet2d-ldet3d)
display "likelihood ratio = "= lrd
display "the significance level of the likelihood ratio stat = "= chi2tail(e(tparms), lrd)
/*E:Granger-causality test*/
quietly var dlrgdp dlrm2 drs, lags(1/12)
vargranger
/*G:estimate a near-VAR*/
constraint 1 [dlrgdp]:l.dlrgdp l2.dlrgdp l3.dlrgdp l4.dlrgdp l5.dlrgdp l6.dlrgdp l7.dlrgdp
l8.dlrgdp l9.dlrgdp l10.dlrgdp l11.dlrgdp l12.dlrgdp
constraint 2 [dlrm2]:l.dlrgdp l2.dlrgdp l3.dlrgdp l4.dlrgdp l5.dlrgdp l6.dlrgdp l7.dlrgdp
l8.dlrgdp l9.dlrgdp l10.dlrgdp l11.dlrgdp l12.dlrgdp
var dlrgdp dlrm2 drs, lags(1/12) constraint(1 2)
10. Question 9 suggests that is appropriate to estimate three-variable twelve-lag VAR for
dlrdgpt, dlrm2t and drst. Now suppose we want the contemporaneous relationships among the
variables to be:
emt 100 yt
e g
yt 21 1 g 23 mt
In this way, the contemporaneous values of real GDP and the interest rate are unaffected by
the other variables in the system. In contrast, the real money supply responds to all three
variables. Notice that the system is overidentified.
Sugerencias de conferencias
Figure 6.1 and Worksheet 6.1 illustrate the concept of cointegration. Worksheet 6.2 illustrates
spurious regressions. You can use Figures M6-1 and M6-2 below for further emphasis. The first two
panels in Figure M6-1 show 100 realizations of two independent unit root processes. The {yt} and
{zt} sequences were constructed as:
Two sets of one hundred random numbers were drawn to represent the {yt} and {zt}
sequences. Using the initial values y0 = 0 and z0 = -5, the next 100 realizations of each were
constructed using the formulas above. The drift terms impart a positive trend to each. Since each
sequence tends to increase over time, the two appear to move together. The scatter plot in the third
panel and the time plots in the fourth panel reflect this tendency. The spurious regression of yt on zt
Página107Cointegración
Figure M6-1: A Spurious Regression
yt = 0.1 + y t-1 + yt zt = 0.2 + zt-1 + zt
20 20
10 10
0 0
10 10
0 20 40 60 80 100 0 20 40 60 80 100
10
10
y sequence
0
0
5 10
5 0 5 10 15 0 20 40 60 80 100
z sequence
The scatter plotcaptures the tendency of both Transform the z sequence as: w = 0.68z + 1.63. The time
series to increase over time. The regression paths of y and w seem to move together. However, the
of y on z yields: y = 0.68z + 1.63. regression coefficients are meaningless.
2
0 20 40 60 80 100
The regression error-term y - 0.68z - 1.63 is non-stationary. Hence, all
Página108Cointegración
deviations from the estimated relationship are permanent; the regression is spurious.
Página109Cointegración
Figure M6-2: An Equilibrium Relationship
yt = yt-1 + yt zt = zt-1 + zt
4 4
2 2
0 0
2 2
4 4
0 20 40 60 80 100 0 20 40 60 80 100
The simulated {yt} and {zt} sequences are both random-walk plus noise processes. Each meanders without any
tendency to return to a long-run mean value. The error terms are: yt = t + yt - yt-1 and zt = t + zt - zt-1.
Since each has the same stochastic trend, the {yt} and {zt} series are cointegrated.
Scatter Plot The Transformed Sequence
4 4
2 2
y sequence
0 0
2 2
4 4
4 2 0 2 4 0 20 40 60 80 100
z sequence {y} sequence
{w} sequence
The scatter plot of zt and yt captures the tendency Transform the zt sequence as: wt = 0.889zt +
of both series to move together. The regression of 0.007. The time paths of yt and wt move together
yt on zt yields: yt = 0.889zt + 0.007.
as a result of the common stochastic trend.
0.5
The regression error-term yt - 0.889zt - 0.007 is
stationary. Hence, all deviations from the estimated
0
relationship are temporary. The variables are
cointegrated
0.5
Página110Cointegración
1
020406080100
Página111Cointegración
appears to have a "good" fit. However, regression coefficients are meaningless. The problem is
that the error-term is a unit-root process; all deviations from the regression line are permanent.
In contrast, the simulated {yt} and {zt} sequences shown in Figure M6-2 are cointegrated.
The two random-walk plus noise processes were simulated as:
where: t, yt, and zt are computer generated random numbers.
The series have the same stochastic trend. The scatter plot in the third panel and the time
plots in the fourth panel reflect the tendency of both to rise and fall together in response to the
common {t} shocks. The regression of yt on zt yields a stationary error process. Hence, all
deviations from the regression line are temporary.
=
Using Cramer's Rule or matrix inversion, we can obtain the solutions for yt as:
(1 a 22 L)(a10 + y t ) + a12 L(a 20 + z t )
y=
t
(1 a11 L)(1 a 22 L) a12 a 21 L 2
Página112Cointegración
Since (1 - a22L)a10 = (1-a22)a10, and a12La20 = a12a20, the solution for yt is verified.
Página113Cointegración
B. Find the solution for zt.
Answer: Use your answer to Part A and apply Cramer's Rule or matrix inversion to obtain:
a 21 L(a10 + y t ) + (1 a11 L)(a 20 + z t )
zt = 2
(1 a11 L)(1 a 22 L) a12 a 21 L
C. Suppose that yt and zt are CI(1, 1). Use the conditions in (6.19), (6.20), and (6.21) to write the
error-correcting model. Compare your answer to (6.22) and (6.23). Show that the error-correction
model contains an intercept term.
Answer: Imposing the restrictions necessary to ensure that yt and zt are CI(1, 1), the equations
for yt and zt can be written as:
Thus, the error-correcting equations for yt and zt each contain a drift term. Another
way to answer the question is to note that the solutions for yt and zt obtained in Parts A and B
contain the deterministic expressions [(1-a22)a10 + a12a20] and [a21a10 + (1-a11)a20],
respectively. Since the denominator contains a characteristic root equal to unity, the solution
for each contains a deterministic trend.
D. Show that {yt} and {zt} have the same deterministic time trend (i.e., show that the slope
coefficient of the time trends are identical).
Answer: The constant in the numerator of the solution for yt is: [(1-a22)a10 + a12a20]. Since 1-
a22 = a12a21/(1-a11), this constant can be rewritten as: [a12/(1-a11)][a21a10 + (1-a11)a20]. Up to
the expression [a12/(1-a11)], this deterministic numerator expression is the same as that in the
solution for zt. Given that the denominators are identical, yt and zt can be said to have the
same deterministic time trend.
E. What is the condition such that the slope of the trend is zero? Show that this condition is such
that the constant can be included in the cointegrating vector.
Answer: The {yt} sequence does not have a slope if (1-a22)a10 + a12a20 = 0. Solving for a10
yields a10 = -a12a20/(1-a22). Using this relationship, the error-correction equation for yt is:
yt = y(yt-1 - zt-1) + yt - a12a20/(1-a22)
= y(yt-1 - zt-1 + a20/a21) + yt
Since z = a21, the error-correction model for zt can be written as:
Página114Cointegración
zt = z(yt-1 - zt-1 + a20/a21) + zt.
Thus, the normalized long-run equilibrium relationship is yt-1 - zt-1 + a20/a21. The
cointegrating vector has an intercept although the {yt} and {zt} sequences do not contain
deterministic trends.
2. The data file COINT6.PRN contains the three simulated series used in sections 5 and 9. The
following programs will reproduce the results.
* Repeat the four lines above for z and w. Alternatively, you can use the procedure entitled
* DFUNIT.SRC. To use DFUNIT.SRC, type the statements
source c:\rats\dfunit.src ;* The procedure is assumed the dfunit.src procedure is in the
:*RATS directory on drive c:
dfunit(lags=4) / y
system 1 to 3;* Set up the system for the error-correction model variables dy dz
dw
Página115Cointegración
lags 1 to 2 ;* Use 2 lags of dy, dz, and dw
det constant residy{1} ;* Include a constant and the error-correction term. You can
end(system) ;* use the residuals from the other two equilibrium relations
estimate(outsigma=vsigma) * Estimate the model. Vsigma is the variance/covariance matrix
* To reproduce the results in Section 9, use the CATS procedure or the downloadable file
* entitled johansen.src. Note that the Johansen procedure in RATS does not allow you to use
* the variable name w. Redefine w using the following statement
set x = w
source c:\rats\johansen.src ;* It is assumed the johansen.src procedure is in the RATS
directory on drive c:\
@johansen.src(lags=2) /
#yzx
Note that johansen.src may inappropriately add seasonal dummy variables to your
model. Moreover, there is no simple way to choose the form of the intercept term. If you use
RATS, your answers will be slightly different from those reported in the text. For example,
the max and trace statistics will be reported as:
/*the above two lines test the number of cointegrating vectors using Johansen procedure with
95% and 90% Osterwald-Lenum critical values respectively. In accord with the results in the
textbook, critical values of Case 1* with the assumption that the intercept term is in the
cointegration equation are appropriate*/
3. The file COINT_PPP.XLS contains quarterly values of German, Japanese, and Canadian
wholesale prices and bilateral exchange rates with the United States. The file also contains the
U.S. wholesale price level. The names on the individual series should be self-evident. For
example, p_us is the U.S. price level and ex_g is the German exchange rate with the United
States. All variables except the mark/dollar exchange rates run from 1973:Q4 to 2001:Q4 and all
have been normalized to equal 100 in 1973:Q4.
Página117Cointegración
A. Form the log of each variable. Estimate the long-run relationship between Canada
and the United States as
Do the point estimates of the slope coefficients seem to be consistent with long-run PPP?
Answer: Although the point estimates seem to be consistent with long-run PPP, you need to be a bit
careful. There is a natural tendency to think that 0.937 is approximately equal to unity and 0.830 is
approximately equal to minus one. However, inference on the cointegrating is unwarranted since the
residuals from the regression are serially correlated and prices are not necessarily weakly
exogeneous.
B. Since the residuals from the equilibrium regression contain a unit root, shocks to the real
exchange rate never decay. Hence, long-run PPP fails.
cal 1973 4 4;* The data set begins in 1973Q4 and ends in 2004Q4 all 2001:4
open data a:\coint_ppp.xls
data(org=obs,format=xls)
Página118Cointegración
insheet using coint_ppp.txt
gen obs = _n
tsset obs
gen lex_ca = ln(ex_ca)
gen lex_j = ln(ex_j)
gen ex_g1 = real(ex_g) /*note:some observations in the original series of ex_g are denoted by
the string "NA" so it is treated as a string variable. To perform estimation, however, ex_g
needs to be changed to a numeric variable by the "real" function.*/
gen lex_g1 = ln(ex_g1)
gen lp_ca = ln(p_ca)
gen lp_j = ln(p_j)
gen lp_g = ln(p_g)
gen lp_us = ln(p_us)
4. The second, fourth, and fifth columns of the file labeled INT_RATES.XLS contain the
interest rates paid on U.S. 3-month, 3-year, and 10-year U.S. government securities. The data run
from 1954:7 to 2002:12. These columns are labeled TBILL, r3, and r10, respectively.
RATS PROGRAM
cal 1954 7 12;* The data set runs from July 1954 to December 2002 all 2002:12
open data a:\int_rates.xls
data(org=obs,format=xls)
* The long-run relationship can be estimated using the T-bill rate as the ‘dependent’ variable.
linreg tbill / resids; * Save the residuals as resids
# constant r3 r10
Página119Cointegración
* Perform the Engle-Granger test on resids
diff resids / dresids;* Obtain first-difference of the residuals
linreg dresids ;* Perform the Dickey-Fuller test of the residuals
# resids1{1} dresids1{1 to 9}
* Beginning with RATS 5.0, you can estimate the error-correction model as a system of
equations. Note that the resisuals from part B (i.e., resids) are used as the error-correction terms
system 1 to 3
variables dtbill dr3 dr10
lags 1 to 12
det resids{1} end(system)
estimate(noftests,outsigma=v) / 1
Página120Cointegración
gen obs = _n
tsset obs
Página121Cointegración
predict residr10,equation(#3) residuals
wntestb residr10,table
wntestq residr10
B. Show that two of the characteristic roots are zero and that the third is 0.75.
Answer: Construct the determinant:
0.6 - 0.5 0.2
0.3 0.25 - 0.1 = 0.75 2 - 3
1.2 1.0 -
The three values of such that the determinant is zero are obtained by solving the
equation: 2( - 0.75) = 0, so that:
= 0, 0, and 0.75
C. Let ' = (3 -2.5 1) be the single cointegrating vector normalized with respect to x3. Find the (3
1) vector such that = '.
Answer: The problem is to select = (1 2 3)' such that = (1 2 3)'(3 -2.5 1). Hence,
Página123Cointegración
Answer: Normalizing with respect to x1 yields: ' = (1, -5/6, 1/3). All values of i must be
three times larger. Hence:
1 = 0.6; 2 = 0.3; 3 = 1.2
0.75 0.25
E. Show that the three characteristic roots are: 0.0, 0.5, and 0.9.
Answer: Form the determinant
0.8 - 0.4 0.0
0.2 0.1 - 0.0 = - 0.45 +1.4 2 - 3
0.75 0.25 0.5 -
Solving for the values of such that the determinant is zero yields:
(2 - 1.4 + 0.45) = 0 so that:
= 0, 0.5, 0.9
6. Suppose that x1t and x2t are integrated of orders 1 and 2, respectively. You are to sketch the proof
Página125Cointegración
that any linear combination of x1t and x2t is integrated of order 2. Towards this end:
A. Allow x1t and x2t to be the random walk processes:
i) Given the initial conditions x10 and x20, show that the solution for x1t and x2t have the form
x1t = x10 + Σ1t-i and x2t = x20 + Σ2t-i.
Answer: Let the index of summation run from i = 0 to t-1 so that: x1t = 1t + 1t-1 + ... + 11 +
x10. This challenge solution must satisfy x1t = x1t-1 + 1t. The issue is whether:
1t + 1t-1 + ... + 11 + x10 = 1t-1 + ... + 11 + x10 + 1t.
Clearly, the two sides are identical for all possible realizations of the {1t} sequence.
The same argument applies to x2t. Hence the two solutions are:
t -1 t -1
ii) Show that the linear combination 1x1t + 2x2t will generally contain a stochastic trend.
Answer: The linear combination 1x1t + 2x2t will contain the expression:
t -1 t -1
1 1t -i + 2 2t -i
i=0 i=0
The sum of these two stochastic trends is also a stochastic trend. Simply define t = 11t +
22t, so that the linear combination 1x1t + 2x2t contains the stochastic trend t.
iii) What assumption is necessary to ensure that x1t and x2t are CI(1, 1)?
Answer: Suppose {1t} and {2t} are perfectly correlated such that 2t = 1t where is a
constant. Now, select values of 1 and 2 such that 1 + 2 = 0. The linear combination
1x1t + 2x2t does not contain a stochastic trend since:
t -1 t -1
1 1t -i + 2 1t -i =0
i=0 i=0
B. Now let x2t be integrated of order 2. Specifically, let x2t = x2t-1 + 2t. Given initial conditions
for x20 and x21, find the solution for x2t. [You may allow 1t and 2t to be perfectly correlated].
Answer: One simple way to find x2t is to define zt = x2t so that zt = zt-1 + 2t. Given the initial
condition for z1 (= x21 - x20), the solution for zt is:
zt = 2t + 2t-1 + ... + 22 + z1 so that:
x2t = x2t-1 + 2t + 2t-1 + ... + 22 + x21 - x20.
Página121
Cointegración
Now eliminate x2t-1 by iterating backwards:
x2t = 2t + 2t-1 + ... + 22 + x21 - x20 + (2t-1 + 2t-2 + ... + 22 + x21 - x20 + x2t-2).
Página122Cointegración
= 2t + 22t-1 + ... + 222 + 2(x21 - x20) + x2t-2
x2t = 2t + 22t-1 + ... + 222 + 2(x21 - x20) + [2t-2 + 2t-3 + ... + 22 + (x21 - x20) + x2t-3]
ii. Is there any linear combination of x1t and x2t that contains only a stochastic trend? Is there
any linear combination of x1t and x2t that does not contain a stochastic trend?
Answer: No. Rewrite the solution for x2t as:
t -2 t-2 t -2
Even if 1t and 2t are perfectly correlated, the linear combination of the two must
contain the following expression:
t -2 t -2
Thus, the linear combination contains a double summation of the {2t} sequence. No
linear combination contains only a stochastic trend. The point is that all linear combinations
are I(2).
C. Provide an intuitive explanation for the statement: If x1t and x2t are integrated of orders d1 and d2
where d2 > d1, any linear combination of x1t and x2t is integrated of order d2.
Answer: If x2t ~ I(d2), its solution will contain a d2-tuple summation of the {2t} sequence.
However, the solution for x1t will contain only a d1-tuple summation. There is no linear
combination of the two sequences that reduce the order of the summation in the solution for
x2t.
7. The Programming Manual that accompanies this text contain a discussion of nonlinear least
squares and maximum likelihood estimation. If you have not already done so, download the
manual and programs from the Wiley website.
A. Section 5.5 in Chapter 4 contains discussion of the problem of conducting inference on the
parameters of a cointegrating vector. Execute Program 4.10. Why is it a problem that only
16.8% of the true values of 1 lie within a 95% confidence interval?
B. How would you modify the program so as to generate the Engle-Granger critical values?
Página123
Cointegración
The question is answered in the Programming Manual using RATS.
Página124Cointegración
STATA Users can obtain the results for question 7 using:
claro
/*A:this is to rewrite program 4.10 in the program manual in stata*/
capture program drop coint
program define coint,rclass
version 8.0
drop _all
args alpha1 alpha2 beta1
set obs 150
gen time = _n
tsset time
gen yt = invnorm(uniform())
gen xt = invnorm(uniform())
gen e1t = invnorm(uniform())
gen e2t = invnorm(uniform())
scalar success = 0
forvalues i=1/149 {
replace yt =(1-`alpha1')*yt[`i'] + (`alpha1'*`beta1')*xt[`i'] + e1t[`i'+1] if (_n>`i')
replace xt =(1-`alpha2'*`beta1')*xt[`i'] + `alpha2'*yt[`i'] + e2t[`i'+1] if (_n>`i')
}
reg yt xt in 51/150
if `beta1'>=(_b[xt]-1.96*_se[xt]) & `beta1'<=(_b[xt]+1.96*_se[xt]) {
return scalar success = success + 1
}
return scalar betahat = _b[xt]
end
Página125
Cointegración
tsset time
gen e1t = invnorm(uniform())
gen e2t = invnorm(uniform())
gen yt = sum(e1t)
gen xt = sum(e2t)
reg yt xt
predict ut,residuals
reg d.ut l.ut, noconstant
return scalar tphi = -(_b[l.ut]/_se[l.ut]) /*in the original paper, the model is d.ut=-
_b*(l.ut)+et*/
end
8. Section 3 of Chapter 2 of the Programming Manual that comes with this text estimate the
relationship between the long-term and short-term interest rate as
A. Use the data set MONEYDEM.XLS to estimate the error-correction model. Use five lags of
each variable.
B. As shown in the manual, you can use the error-correction model to obtain the impulse
response functions with a Choleski decomposition.
C. In the equation for tb1yrt, the coefficient on the error-correction term is –0.098 with a t-
statistic equal to –0.427. Why is it possible to argue that tb1yrt is weakly exogenous. How
can you model the long-term rate using the general-to-specific approach?
Página126Cointegración
to be first transformed into a numeric variable. The function "real" does this and leaves the
first two as missing values*/
reg tb1yr1 tb3mo
predict resid,residuals
gen dtb1yr = d.tb1yr1
gen dtb3mo = d.tb3mo
var dtb1yr dtb3mo,lags(1/5) exog(l.resid)
Página127
Cointegración
CHAPTER 7
NONLINEAR TIME-SERIES MODELS
Sugerencias de conferencias
1. Once you abandon the linear framework, it is necessary to select a specific nonlinear
alternative. Unfortunately, the literature does not provide a solid framework for this task. It is
possible to estimate a series as a GAR, Bilinear, TAR, LSTAR, ESTAR, Markov switching, or
ANN process. General tests for nonlinearity do not have a specific alternative hypothesis.
Lagrange Multiplier tests generally accept a number of nonlinear alternatives. The issue can be
illustrated by the estimate industrial production series beginning on page 419. Although a
nonlinear model may be appropriate, the final TAR specification is a bit doubtful. My own view
is that an underlying theoretical model should guide the model selection process. For example, in
Section 7, a TAR model was used since theory suggests that low-terrorism states should be more
persistent than high-terrorism states. To make the point, I rely heavily on Questions 1 and 2.
Question 1 is designed to give the student practice in formulating a nonlinear model that is
consistent with an underlying economic model. Question 2 asks the student to think about the
nature of the nonlinearity that is suggested by any particular nonlinear estimation. In guiding the
class discussion, you might want to make an overhead transparency of Figure M7.1 below.
2. The estimation of many nonlinear models requires the use of a software package with a
programming language. Although the syntax explained in RATS Programming Manual may not
be directly compatible with your software package, the logic will be nearly identical. As such,
you can have your students read the following sections of the Programming Manual: Nonlinear
Least Squares in Chapter 1.4, Do Loops in Chapter 3.1; If-Then-Else Blocks in Chapter 4.1, and
Estimating a Threshold Autoregression (beginning on page 130).
Página127 Modelos no
lineales
Respuestas a las preguntas
1. Let pA and pM denote the price of cotton in Alabama and Mississippi, respectively. The price
gap, or discrepancy, is pA - pM. For each part, present a nonlinear model that captures the
dynamic adjustment mechanism given in the brief narrative.
A. A large price gap (in absolute value) tends to be eliminated very quickly as compared to a
small gap.
Answer: Let the price gap in period t be defined as gt = pAt - pMt. One characterization is
ESTAR specification from page 401:
gt = 0 + 1gt-1 + (1 - exp[-(gt-1 - c)2]) ( 0 + 1gt-1)
B. The price gap is closed more quickly if it is positive than if it is negative.
Answer: Again, there are many possible specifications. A TAR specification is
1 gt 1 if gt1 0
gt
2 g t1 if gt1 0
If 1 and 2 are both positive such that 2 > 1 , the positive gap is closed more quickly.
C. It costs ten cents to transport between Alabama and Mississippi. Hence, a price discrepancy
of less than ten cents will not be eliminated by arbitrage. However, fifty percent of any
price gap exceeding ten cents will be eliminated within a period.
Answer: A band-TAR specification is
1 g t1 if g t1 0.10
gt 0 if | gt 1 | 0.10
gif g 0.10
1 t1 t1
Here, there is no change in the gap if gt-1 is less than $0.10. Adjustment occurs only if the
absolute value of the gap exceeds $0.10.
D. The value of pA, but not the value of pM, responds to a price gap.
Answer: Here, there is no need to use a nonlinear mechanism since a linear specification
can cature the dynamics. Consider
pAt = 1(pAt-1 - pMt-1)
Answer: Note that we can reparameterize the model as the NLAR(1) process: yt = [1.5 -
0.5(yt-1)2]yt-1. As you should infer from Panel (a) of Figure M7.1, equilibrium positions (i.e., yt
Página128Modelos no
lineales
= yt-1) occur at -1, 0 and +1. However, 0 is not a stable point since [1.5 - 0.5(yt-1)2] exceeds 1
in the neighborhood of yt-1 = 0. Moreover, the absolute value of the slope exceeds 1 when | yt-1
| > 50.5. Hence, the system will converge to 1 beginning with values 0 < yt-1 < 50.5 and will
converge to -1 beginning with values -50.5 < yt-1 < 0.
B. The TAR model: yt = 1 + 0.5yt-1 + t if yt-1 > 2 and yt = 0.5 + 0.75yt-1 + t if yt-1 2.
Answer: Panel (b) of Figure M7.1 indicates a break in the slope of the phase diagram at yt-1 =
2. There is a single stable ‘equilibrium’ position at yt-1 = 2. However, there is more persistence
when yt-1 < 2.
C. The TAR model: yt = 1 + 0.5yt-1 + t if yt-1 > 0 and yt = -1 + 0.5yt-1 + t if yt-1 0.
Answer: Panel (c) of Figure M7.1 indicates that this model is discontinuous at the threshold.
Equilibrium positions occur when yt-1 = +2 and yt-1 = –2. Since the degree of auroregressive
decay is always 0.5, both of the equilibrium values of the skeleton are stable.
D. The TAR model: yt = -1 + 0.5yt-1 + t if yt-1 > 0 and yt = +1 + 0.5yt-1 + t if yt-1 0.
Answer: Panel (d) of Figure M7.1 indicates that this model is discontinuous at the threshold
of zero. There is no value satisfying the relation yt = yt-1; hence, there is not an attractor for
this model.
E. The LSTAR model: yt = 0.75yt-1 + 0.25yt-1/[ 1 + exp(-yt-1) ] + t
Answer: Panel (e) of Figure M7.1 indicates that this model acts like a unit root process for
large values of yt-1. At the other extreme, only 75% of a highly negative value of yt-1 persists
into the subsequent period.
F. The ESTAR model: yt = 0.75yt-1 + 0.25yt-1[ 1 - exp(- y 2t1 ) ] + t
Answer: Panel (f) of Figure M7.1 indicates that this model acts like a unit root process when
| yt-1 | is large. When yt-1 is near zero, only 75% of yt-1 persists into the subsequent period.
3. In the Markov switching model, let p1 denote the unconditional probability that the system is in
regime one and let p2 denote the unconditional probability that the system is in regime two. As
in the text, let pii denote the probability that the system remains in regime i. Prove the assertion
p1 = (1 – p22)/(2 – p11 – p22)
p2 = (1 – p11)/(2 – p11 – p22)
Answer: Note that the probabilities are independent of time. Unconditional probability of
being in regime 1 (p1) is given by:
p1 = p1p11 + p2(1 – p22)
Note p1 is expressed as a sum:
p1p11 is the probability that the system is in regime 1 (p1) multiplied by the probability of
remaining in state 1 and remains in regime 1 (p11)
p2(1 – p22) is the probability that the system is in state 2 (p2) multiplied by the probability
of switching to state 1 from state 2 (1 – p22)
Since p2 = 1 – p1, we get p1 = (1 – p22)/(2 – p11 – p22)
Página129 Modelos no
lineales
Figure M7.1: The Six Phase Diagrams
54
42024
2024
52
(a) (b)
55
505 505
55
(c) (d)
22
202 202
22
(e) (f)
Página130Modelos no
lineales
4. The file labeled LSTAR.XLS contains the 250 realizations of the series used in Section 5.
Programa de muestra para los usuarios de RATS
all 250;* The first three lines read in the data set open data a:\lstar.xls
data(format=xls,org=obs)
lin y / resids; # constant y{1} ;* Estimate the linear model and save the residuals
;* as the series resids
cor(number=24,span=4,qstats) resids ;* Obtain the ACF of the residuals set
r2 = resids**2;* Create the squared residuals
cor(number=24,span=4,qstats) r2;* The residuals and squared residuals show no
;* serial correlation
* B. Perform the RESET rest. To perform the RESET test we need to regress the residuals on
* the regressors and powers of the fitted values. Obtain the fitted values using
prj fitted; * The series fitted corresponds to { ŷt }. Next, obtain the powers of { ŷt }.
set f2 = fitted**2; set f3 = fitted**3 ; set f4 = fitted**4
* Next, regress the residuals on a constant, yt-1 and powers of the fitted values
lin resids ; # constant y{1} f2 f3 f4 234
exc ; # f2 f3 f4;* Test the exclusion of ( ŷt ) , ( ŷt ) and ( ŷt )
*D. Perform the LM test for LSTAR versus ESTAR adjustment. Let yt-1 be the delay
* parameter
set delay = y{1}
* To determine if yt-2 should be the delay parameter, use: set delay = y{2}
exc ; # y1d y1d2 y1d3;* Perform the F-test to see if you can reject the null of linearity
Página131 Modelos no
lineales
exc ; # y1d3;* The t-test to see if you can reject the LSTAR in favor of the
;* ESTAR model
* Now iterate. As illustrated in Table 7.1, you can use the estimated value of = 3.83 to find
* the estimates of 0, 1, 0 1 and c. Use these estimated values to find an updated value of .
lin y / resids ; # constant y{1 to 2} y2 ; * Estimate the model and save the residuals
5. The file INDPROD_60.XLS contains the industrial production series used to estimate the
TAR model in Section 6. Use the data to replicate the results reported in the text.
Programa de muestra para los usuarios de RATS
* The first four lines read in the data set. The sample runs from Jan. 1960 to June 2002
cal 1960 1 12
all 2002:6
open data a:\indpro_60.xls
data(org=obs,format=xls)
* Estimate the growth rate as an AR(3) and save the residuals as resids
lin y / resids; # constant y{1 to 3 }
Página132 Modelos no
lineales
* To perform the RESET test, obtain the fitted values
prj fitted
* Regress the residuals of the AR(3) on a constant, yt-1 yt-2, yt-3 and powers of the fitted values
set f2 = fitted**2; set f3 = fitted**3 ;set f4 = fitted**4
lin resids ; # constant y{1 to 3 } f2 f3 f4
exc ; # f2 f3 f4;* Obtain the F-statistic
* Let d = 1 and suppose that the threshold is zero. Let flag denote the indicator variable. Set
* flag =1 if yt-1 > 0
set flag = %if(y{1}<0,0,1)
* Regress yt on flag, plus1, plus2, plus3, minus, minus1, minus2, and minus3
linreg y
# flag plus1 plus2 plus3 minus minus1 minus2 minus3
*The Programming Manual (see page 130) shows how to use Chan’s method to obtain a
* consistent estimate of the threshold. Another example is found in Question 6 below.
6. The file GRANGER.XLS contains the interest rate series used to estimate the TAR and M-
TAR models in Section 8.
RATS programmers can estimate the TAR and M-TAR models using
cal 1958 1 4;* These four lines read in the data set. The data begin in all 8 1994:1
;* 1958Q1 and end in 1994Q1
open data a:\granger.xls
data(format=xls,org=obs)
set spread = r_10 - r_short ;* Create spread as the difference between the 10-year rate dif
spread / ds;* and the short rate. Take the first difference of spread
* Perform the Dickey-Fuller test on the spread. Save the residuals as resids
lin ds / resids; # constant spread{1} ds{1}
Página133 Modelos no
lineales
prj fitted;* Obtain the fitted values
set f2 = fitted**2; set f3 = fitted**3 ;* Powers of the fitted values
lin resids ; # constant spread{1} ds{1} f2 f3;* Regress resids on a constant, spreadt-1
;* and powers of the fitted values
exc ; # f2 f3;* F-test for excluding f2 and f3
* For Chan’s method, we want exclude the lowest 15% and highest 15% of the observations
* from being used as potential thresholds. One simple programming trick is to order the
* observations from lowest to the highest using
set thresh_test = spread ; order thresh_test
/* Now, thresh_test contains the sorted values of yt. Thresh_test(1) is the smallest value of yt and
thresh_test(145) contains the largest value. Hence, thresh_test(22) through thresh_test(124)
contain the desired middle 70% of the sorted observations. The first instruction below creates a
variable rss_test that will be used to hold the residual sum of squares for the best fitting model.
This value is initially set to be higher than any possible value of the estimated residual sum of
squares. The second instruction creates the series that will hold the calculated residual sum of
squares from each regression estimated. The third initializes the variable indicating the threshold
(thresh) to be the first usable value.
*/
lin(noprint) ds
# spread_plus spread_minus ds{1}
Página134 Modelos no
lineales
com rss(i) = %rss
if %rss < rss_test { compute
rss_test = %rss compute thresh
= thresh_test(i)
}
end do i
* Once the loop is exited, thresh contain the threshold with smallest residual sum of squares.
dis ' Threshold = ' thresh ;* Display the threshold
* Calculate and display the AIC and SBC. Note that the number of regressors should include
* the fact that was estimated.
compute aic = %nobs*log(%rss) + 2*(%nreg+1)
compute sbc = %nobs*log(%rss) + (%nreg+1)*log(%nobs)
display 'aic = ' aic ' sbc = ' sbc
do i = 22,124
set flag = %if(ds{1}.le.0.,0,1) ;* Set the indicator according to whether spreadt-1 < 0
set minus = 1 - flag
set spread_plus = flag*(spread{1}-thresh_test(i))
set spread_minus = minus*(spread{1}-thresh_test(i))
lin(noprint) ds
# spread_plus spread_minus ds{1}
Página135 Modelos no
lineales
end do i
* Once you exit the loop, estimate the M-TAR model using
set flag = %if(ds{1}.le.0.,0,1)
set minus = 1 - flag
set spread_plus = flag*(spread{1}-thresh)
set spread_minus = minus*(spread{1}-thresh)
lin ds / resids
# spread_plus spread_minus ds{1}
dif r_10 / drl ;* Take the first difference of the two interest rates
dif r_short / drs
system 1 to 2
var drl drs
lags 1 to 2
det spread_plus spread_minus
end(system)
estimate(outsigma=v)
7. Consider the linear process yt = 0.75yt-1 + t. Given yt = 1, find Etyt+1, Etyt+2 and Etyt+3.
Now consider the GAR process yt = 0.75yt-1 – 0.25 y t1
2
+ t. Given yt = 1, find Etyt+1. Can you
Answer: In the linear case, we can use linear projections such that Etyt+1 = 0.75yt and that
Etyt+2 = Et(Et+1yt+2) = Et(0.75yt+1) = 0.75Etyt+1 = 0.752yt. Since the expectations operator is
linear, this method is not feasible in nonlinear equations. When yt = 1, it follows that Etyt+1
= 0.5. However, Etyt+2 = Et[ 0.75yt+1 - 0.25(yt+1)2] = 0.75Et(yt+1) - 0.25 Et( y t1
2
) and Etyt+3 =
2
0.75Etyt+2 - 0.25Et( y t2 ). As discussed in Section 7, it is necessary to use numerical
Página136 Modelos no
lineales
Page 126: Cointegration
Página137 Modelos no
lineales
SEMESTER PROJECT
The best way to learn econometrics is to estimate a model using actual data. At the beginning
of the semester (quarter), students should identify a simple economic model that implies a long-run
equilibrium relationship between a set of economic variables. Data collection should begin as early
as possible so that the econometric tests can be performed as they are covered in class. Some
students may be working on projects for which they have data. Others should be able to construct a
satisfactory data set using the internet. Some of the web sites that were used in writing the test are
1. www.fedstats.gov/ The gateway to statistics from over 100 U.S. Federal agencies such as the
Bureau of Labor Statistics, the Bureau of Economic Analysis, and the Bureau of the
Census.
4. www.oecd.org/statistics/ The statistics portal for the Organization for Economic Cooperation
and Development. Economic indicators, leading indicators, and labor force statistics.
For those who spend too much time searching for a project, students can update
MONEY_DEM.XLS. This data set is used in the Programming Manual. The file contains quarterly
values of seasonally adjusted U.S. nominal GDP, real GDP in 1996 dollars (RGDP), the money
supply as measured by M2 and M3, and the 3-month and 1-year treasury bill rates for the period
1959:1 – 2001:1. Both interest rates are expressed as annual rates and the other variables are in
billions of dollars. The data were obtained from the website of the Federal Reserve Bank of St. Louis
and saved in Excel format.
The semester project is designed to employ all of the material covered in the text. Each
student is required to submit a paper demonstrating competence in using the procedures. I require my
students to use the format below. The various sections are collected throughout the semester so that
student progress can be monitored. At the end of the semester, the individual sections are compiled
into the final course paper. Of course, you might want to adapt the outline to your specific emphasis
and to the statistical software package available to you. In Example 1, the student wants to estimate a
demand for money function. In Example 2, the student wants to estimate the term structure of
interest rates.
1. Introduction
Of course, it is important that students learn to generate their own research ideas. However,
in the short space of a semester (or quarter), it is necessary for students to quickly select a semester
Página137: Proyecto del
semestre
project. After two weeks, I ask my students for a page or two containing:
3. The definition and source of each series to be used in the project. Some mention should be
made concerning the relationship between the variables in the theoretical model and the
actual data available.
Example 1: The student discusses why the demand for money can be represented by:
mt = β0 + β1yt + β2rt + pt + et
Example 2: The student discusses why the term structure of interest rates implies a
relationship among short-term and long-term interest rates of the form:
where: TBILLt is the treasury bill rate, R3t is a three-year rate and R10t is a ten year rate.
Note that these three variables are on the file INT_RATES.XLS.
1. Plot the time path of each variable and describe its general characteristics. There should be
some mention of the tendencies for the variables to move together.
2. For each series, develop a simple difference equation model that mimics its essential
features.
Example 1: This portion of the paper contains time-series plots of the money supply, output,
interest rate(s), and price index. The marked tendency for money, output and prices to
steadily increase is noted. Periods of tranquility and volatility are indicated and the student
mentions that the periods are similar for all of the variables. The student indicates that a
difference equation with one or more characteristic root lying outside the unit circle might
Página138 Proyecto
Semestral
capture the time path of the money supply, price index, and level of output.
Example 2: This portion of the paper contains time-series plots of the various interest rate
series. The tendency for the rates to meander is noted. The student shows how difference
equations with a characteristic root that is unity can mimic the essential features of the
interest rate series. It is also shown that characteristic roots near unity will impart similar
time-paths to the series. The tendency for the rates to move together and any periods of
tranquility and volatility are mentioned.
Example 1: The Box-Jenkins method suggests several plausible models for the money
supply. Each is examined and compared in detail since the project focuses on money
demand. In addition, there are periods of volatility that suggest GARCH errors. The GARCH
estimates are presented.
Example 2: The three interest rate series are estimated using the Box-Jenkins methodology.
The focus is not on any single interest rate series. Instead, several reasonable models for each
series are found. Tests for the presence of GARCH and ARCH-M effects are presented.
1. Use the material in the second portion of Chapter 3 to discuss plausible models for the
trends. The goal is to refine the difference equation model suggested in Step 2 of the project.
3. Use the material in Chapter 4 to conduct formal tests for unit roots and/or deterministic
time trends. There can be a comparison of the effects of "detrending" versus differencing a
series showing evidence of a trend.
Example 1: The money supply is decomposed into its temporary and permanent components
using a Beveridge-Nelson decomposition. Dickey-Fuller tests for unit roots in the money
supply series are conducted. The various tests for the presence of drift and/or time trends are
also conducted. Given that the Federal Reserve has changed its operating procedures, the
money supply is tested for unit roots in the presence of a structural break.
Example 2: The long-term rate is decomposed into its temporary and permanent
components using a Beveridge-Nelson decomposition. Dickey-Fuller tests for unit roots in all
of the interest rate series are conducted. The presence of unit roots in the interest rate series is
mixed. It may be that the interest rates are near unit root processes. The student compares the
ARMA estimates of the long-term rate using levels, "detrended" values, and first-differences
of the data.
1. Estimate the variables as a VAR. The relationship among the variables should be analyzed
using innovation accounting (impulse response functions and variance decomposition)
methods.
2. Compare the VAR forecasts to the univariate forecasts obtained in Step 3 of the project.
3. A structural VAR using the Sims-Bernanke or Blanchard and Quah techniques should be
attempted.
Example 1: The money supply, income level, interest rate and price level are estimated as
an autoregressive system. It is reported that the univariate forecasts from Step 3 are nearly the
same as those from the VAR. Granger causality tests are performed in order to pare down the
model. A Choleski decomposition with various orderings is used to decompose the forecast
error variances of the variables. Impulse response functions are used to examine the effects
of the various shocks on the demand for money. The student estimates a structural VAR
such that contemporaneous real income and interest rate shocks are unaffected by the other
variables in the system.
Example 2: The student estimates the three interest rates as a VAR. Since the issue of
stationarity is unclear, the student estimates the VAR in levels and in first-differences. A
Choleski decomposition with various orderings is used to decompose the forecast error
variances of the variables. Impulse response functions are used to show the effects of shocks
Página140 Proyecto
Semestral
to 10-year and 3-year rates on short-term rates. The student uses a bivariate VAR to
decompose the 10-year interest rate into its temporary and permanent components.
6. Cointegration
This portion of the project introduces the concept of cointegration. Chapter 6 of the text
provides the appropriate background. The student should:
2. Estimate the error-correction model. The error-correction model should be used to analyze
the variables using innovation accounting techniques.
Example 1: For some specifications, the Engle-Granger and Johansen tests for cointegration
will reveal a long-run equilibrium relationship among the variables. For other specifications
and other sample periods, there is no credible money demand function. If the variables are
not cointegrated, the error-correction model is not estimated since the variables are not
cointegrated. Instead, the student discusses some of the credible reasons underlying the
rejection of the theory as presented.
Example 2: The Engle-Granger and Johansen tests for cointegration reveal a long-run
equilibrium relationship among the interest rates. The error-correction model is estimated.
Innovation accounting is conducted; the results are compared to those reported in Step 5.
7. Nonlinearity
The last portion of the project uses nonlinear time-series models presented in Chapter 7. The
student should:
Example 1: One reason why Engle-Granger and Johansen tests may fail is that they
implicitly assume a linear adjustment mechanism. The student tests the variables for linear
versus nonlinear behavior.
Example 2: The text suggests that interest rate spreads are nonlinear. An inverted yield curve
is far less persistent than a situation when short-term rates are below long-term rates. A
nonlinear model of the spread in estimated and compared to the linear model.