Está en la página 1de 221

Suscríbete a DeepL Pro para poder editar este documento.

Entra en www.DeepL.com/pro para más información.

GUÍA DE RECURSOS PARA EL INSTRUCTOR PARA


ACOMPAÑAR

SERIE DE TIEMPO ECONOMÉTRICO


APLICADO (2ª edición)

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í.

Como se indica en el Prefacio de la AETS, el texto seguramente contendrá una serie de


errores. Si la primera edición es una guía, el número es embarazosamente grande. Mantendré
una lista de errores y correcciones en mi página web: www.cba.ua.edu/~wenders. Además, los
métodos y técnicas de las series temporales siguen evolucionando muy rápidamente. Intentaré
mantenerlos actualizados publicando notas de investigación y aclaraciones en mi página web.
Estaré encantado de publicar cualquier programa o comunicación útil que puedan tener; mi
dirección de correo electrónico es wenders@cba.ua.edu.
CONTENID
O

1. Ecuaciones de diferencia
Sugerencias de conferencias 1
Respuestas a las preguntas2

2. Modelos estacionarios de series temporales


Sugerencias de conferencias 17
Respuestas a las preguntas20

3. Modelado de la volatilidad
Sugerencias de conferencias 41
Respuestas a las preguntas43

4. Modelos con tendencia


Sugerencias de conferencias 59
Respuestas a las preguntas60

5. Modelos de series temporales de multiecuaciones


Sugerencias de conferencias 81
Respuestas a las preguntas83

6. Modelos de cointegración y corrección de errores


Sugerencias de conferencias 107
Respuestas a las preguntas110

7. Modelos no lineales de la serie Tine-Series


Sugerencias de conferencias 127
Respuestas a las preguntas128

Proyecto del semestre 137


CAPÍTULO 1
ECUACIONES DE DIFERENCIA
1. Modelos de series temporales1
2. Ecuaciones de diferencia y sus soluciones 6
3. Solución por Iteración 9
4. Una metodología de solución alternativa14
5. El modelo de la telaraña 17
6. Resolución de ecuaciones de diferencias homogéneas 22
7. Soluciones particulares para procesos determinantes30
8. El método de los coeficientes indeterminados 33
9. Operadores de retardo38
10. Resumen 41

Preguntas y ejercicios 42

APÉNDICE 1.1 Raíces Imaginarias y el Teorema de De Moivre 44


APÉNDICE 1.2 Raíces características en ecuaciones de orden superior 46

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

Respuestas a las preguntas


1. Considera la ecuación de diferencia: yt = a0+ a1yt-1 con la condición inicial y0. Jill resolvió
la ecuación de diferencia al iterar hacia atrás:

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)].

A. Demuestra que las dos soluciones son idénticas para a1 < 1.

Responde: La clave es demostrar:

a0 + a0a1 + a0(a1)2 + + a0(a1)t-1 + (a1)ty0 = 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:

1 + a1 + (a1)2 + + (a1)t-1 = 1/(1 - a1) - (a1)t/(1 - a1)

Página3 Ecuaciones de
diferencia
Ahora, multiplica cada lado por (1 - a1) para

obtener: (1 - a1)[1 + a1 + (a1)2 + + (a1)t-1] =

1 - (a1)t

Multiplique las dos expresiones entre paréntesis para

obtener: 1 - (a1)t = 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.

B. Demuestra que para a1 = 1, la solución de Jill es equivalente a: yt = a0t + y0.Cómo utilizarías


el método de Bill para llegar a esta misma conclusión en el caso a1 = 1.

Responde: Cuando a1 = 1, la solución de Jill puede ser


escrita como:

yt = a0(10 + 11 + 12 + ... + 1t-1) + y0


= a0t + y0

Para usar el método de Bill, encuentra la solución homogénea de la ecuación yt = yt-1.


Claramente, la solución homogénea es cualquier constante arbitraria A. La clave para
encontrar la solución particular es darse cuenta de que la raíz característica es la unidad. En
este caso, la solución particular tiene la forma a0t. Añadiendo las soluciones homogéneas
y particulares, la solución general es

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

2. El modelo Cobweb de la sección 5 asumió expectativas estáticas de precios. Considere una


formulación alternativa llamada expectativas de adaptación. Dejemos que el precio t
esperado en t
(denotado por p* ) sea un precio ponderado
promedio del precio en t-1 y la expectativa de precio del período anterior. Formalmente:

pt* = pt-1 + (1 - ) p* t 0< 


Página4 Ecuaciones de
diferencia
Claramente, cuando = 1, los esquemas de expectativas estáticas y adaptativas son equivalentes.
Una característica interesante de este modelo es que puede verse como una ecuación de diferencia
que expresa el precio esperado en función de su propio valor retardado y la variable forzada pt-1.

Página5 Ecuaciones de
diferencia
A. Encuentra la solución homogénea para
t
p*

Responde: Formar la ecuación homogénea p* - (1 - ) p* = 0.


t t

La solución homogénea es:


* t
pt = A(1-)

donde A es una constante arbitraria y (1-) es la raíz característica.

B. Utilice operadores de retardo para encontrar la solución particular. Comprueba tu respuesta


sustituyendo tu respuesta en la ecuación de diferencia original.

Responde: La solución particular puede escribirse como

[ 1 - (1-L ] p*
t
= pt-1

op* = pt-1/[
t
1 - (1-)L ] de modo que

pt* = [pt-1 + (1-)pt-2 + (1-)2pt-3 + ... ]

Para comprobar la respuesta, sustituya la solución particular en la ecuación de diferencia


original

[pt-1 + (1-)pt-2 + (1-)2pt-3 + ... ] = pt-1 + (1-)[pt-2 + (1-)pt-3 + (1-)2pt-4 + ... ] Debe

quedar claro que la ecuación se mantiene como una identidad.

3. Supongamos que el proceso de suministro de dinero tiene la forma mt = m + mt-1 + t donde m


es una constante y 0 < < 1.

A. Demostrar que es posible expresar mt+n en términos del valor conocido mt y la secuencia
{t+1,
, ... ...t+n).

Responde: Un método es usar la iteración hacia adelante. Actualizando el proceso de


suministro de dinero en un período produce mt+1 = m + mt + t+1. Actualizar de nuevo para
obtener

mt+2 = m + mt+1 + t+2


= m + [m + mt + t+1] + t+2 = m + m + t+2 + t+1 + 2mt
Página6 Ecuaciones de
diferencia
Repitiendo el proceso para mt+3

mt+3 = m + mt+2 + t+3

Página7 Ecuaciones de
diferencia
= m + t+3 + [m + m + t+2 + t+1 + 2mt] Para

cualquier período t+n, la solución es

mt+n = m(1 + + 2 + 3 + ... + n-1) + t+n + t+n-1 + ... + n-1t+1 + nmt

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: La expectativa de t+1 a t+n es igual a cero. Por lo tanto, la expectativa de la


oferta monetaria en n períodos en el futuro es

m(1 + + 2 + 3 + ... + n-1) + nmt

Como n , el pronóstico se aproxima a m/(1-).

4. Encuentra las soluciones particulares para cada una de


las siguientes:
i. yt = a1yt-1 + t + 1t-1

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 = t + a1t-1 + (a1)2t-2 + (a1)3t-3 + ... + 1t-1 + a1t-2 + (a1)2t-3 + ...]

yt = t + (a1+1t-1 + a1(a1+1t-2 + (a1)2(a1+1t-3 + (a1)3(a1+1t-4 + ...

Si a1 = 1, la forma incorrecta de la solución particular es:



yt = b0 + t + (1+ 1) t -i
i=1

donde: se necesita una condición inicial para eliminar la constante b0 y la secuencia no


convergente.

ii. yt = a1yt-1 + 1t + 2t

Responde: Escriba la ecuación como yt = 1t/(1-a1L) + 2t/(1-a1L). Ahora, aplica (1 - a1L)-1 a


Página8 Ecuaciones de
diferencia
cada término del numerador de manera que

Página9 Ecuaciones de
diferencia
yt = 1t + a11t-1 + (a1)21t-2 + (a1)31t-3 + ... +2t + a12t-1 + (a1)22t-2 + (a1)32t-3 + ...]

Alternativamente, puede usar el Método de Coeficientes Indeterminados y escribir la


solución del desafío en la forma

yt = ci1t-i + di2t-i
donde los coeficientes satisfacen: ci = (a1)i y di = (a1)i.

5. El problema de la raíz unitaria en la econometría de series temporales se refiere a las raíces


características que son iguales a la unidad. Con el fin de anticipar el problema:

A. Encuentra la solución homogénea a cada uno de los siguientes.

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

A continuación, divide por At-2 para obtener la ecuación


característica

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

iii) yt = a0 + 2yt-1 - yt-2 +


t
Responde: La ecuación homogénea es yt -2yt-1 + yt-2 = 0. La solución homogénea siempre
toma 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
- 2At-1 + At-2 = 0

A continuación, divide por At-2 para obtener la ecuación


característica

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

iv) yt = a0 + yt-1 + 0.25yt-2 - 0.25yt-3


+t
Responde: La ecuación homogénea es yt - yt-1 - 0.25yt-2 + 0.25yt-3 = 0. La solución
homogénea siempre toma 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-1 -0.25At-2 + 0.25At-3 = 0

A continuación, divide por At-3 para obtener la ecuación característica

- -

Las tres raíces características son 1 = 1, 2 = 0,5, y 3 = -0,5. La combinación lineal de


las tres soluciones homogéneas es también una solución. Por lo tanto, dejando que A1, A2 y
A3 sean tres constantes arbitrarias, la solución homogénea completa es
t t
A1 + A2(0,5) + A3(-0,5)

B. Mostrar que cada una de las soluciones particulares de la retrógrada no es convergente.

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.

iii) yt = a0 + 2yt-1 - yt-2 + t


Responde: Usando operadores de retardo, escribe la ecuación como (1 - L)(1 - L)yt = a0 +
t. Aquí hay
dos raíces características que igualan la unidad. La división (a0 + t) por cualquiera de las
expresiones (1 - L) no conduce a un resultado convergente.

iv) yt = a0 + yt-1 + 0.25yt-2 - 0.25yt-3 + t


Responde: Usando operadores de retardo, escribe la ecuación como (1 - L)(1 - 0.5L)(1 +
0.5L)yt = a0 + t.
Las expresiones (a0 + t)/(1 + 0,5L) y (a0 + t)/(1 - 0,5L) son convergentes, pero la expresión
(a0 + t)/(1 - L) no es convergente.

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

Responde: Reste yt-1 de cada lado de yt = a0 + 1.5yt-1 - .5yt-2 + t para obtener

yt - yt-1 = a0 + 0.5yt-1 - .5yt-2 + t para que


yt = a0 + 0.5yt-1 - 0.5yt-2 + t
= a0 + 0.5yt-1 + t

La solución particular para y*


t
= a0 + y t* + t está dada por
0.5

yt = (a0 + t)/(1 - 0.5L) para que


*
yt = 2a0 + t + 0.5t-1 + 0.25t-2 + 0.125t-3 +

D. De manera similar, transforman las otras ecuaciones en su forma de primera diferencia.


Encuentra la solución particular de mirar hacia atrás, si existe, para las ecuaciones transformadas.

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 + 0t + 1t-1 + 2t-2 + 3t-3 + ... = a0 - b0 - 0t-1 - 1t-2 - 2t-3 - ... +

Los coeficientes de coincidencia en términos similares producen

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.

iii) yt = a0 + 2yt-1 - yt-2 + t


Responde: Reste yt-1 de cada lado para obtener yt - yt-1 = a0 + yt-1 - yt-2 + t para que

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

no existe una solución particular. La forma incorrecta es

y t* = a0t + t + t-1 + t-2 +...

Noten que la segunda diferencia 2yt tiene una solución convergente ya que

t
= a0 + t

iv) yt = a0 + yt-1 + 0.25yt-2 - 0.25yt-3 + t


Responde: Reste yt-1 de cada lado y note que 0.25yt-2 - 0.25yt-3 = 0.25yt-2 para que

yt = a0 + 0.25yt-2 + t o
y t* = a0 + 0.25 y*
t
+

Escriba la ecuación como (1 - y*


t
= a0 + t. Ya que (1 - 0.25L2) = (1 - 0.5L)(1 + 0.5L),
0.25L2) sigue que es

Página15 Ecuaciones de
diferencia
y t* = (a0 + t)/[(1 - 0.5L)(1 + 0.5L)]

E. Dada la condición inicial y0, encuentra la solución para: yt = a0 - yt-1 + t.

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

Como y3 = a0 + 3 - y2, se deduce que y3 = a0 + 3 - 2 + 1 - y0. Si se continúa de esta manera


se obtiene

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.

6. Un investigador estimó la siguiente relación para la tasa de inflaciónt):

t = -.05 + 0.7t-1 + 0.6t-2 + t

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.

Responde: La ecuación homogénea es t - 0.7t-1 - 0.6t-2 = 0. Pruebe la solución de desafío t


= At, de modo que la ecuación característica
es
A
- 0,7At-1 - 0,6At-2 = 0 o
- - 0.6 = 0

Las raíces características son: = 1.2, = -0.5. Así, la solución homogénea es

t = A1(1.2)t + A2(-0.5)t

La solución particular de la que se ha hecho retroceder es explosiva. Pruebe la solución del


desafío: t = b +
bit-i. Para que esto sea una solución, debe satisfacer

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

Coeficientes de coincidencia en términos similares rinden:

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

Todos los valores sucesivos para bi satisfacen la ecuación de diferencia explosiva

bi = 0.7bi-1 + 0.6bi-
2

Si continúa de esta manera, los valores sucesivos de la bi son:


b3 = 1,183; b4 = 1,4821; b5 = 1,74727; b6 = 2,11235; b7 =
2,527007...

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.

Aunque la solución particular retrospectiva no es convergente, al imponer las condiciones


iniciales a la solución particular se obtienen valores finitos para todas las t (siempre que t sea
finito). Considere la solución general

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:

0.10 = 1/6 + -1 + -2 + ... + A1 +


A2
0.11 = 1/6 + +0 + -1 + ... + A1(1.2) + A2(-
0.5)

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.

7. Considere el proceso estocástico: yt = a0 + a2yt-2 + t.

A. Encuentra la solución homogénea y determina la condición de estabilidad.


Responde: La solución homogénea tiene la forma yt = At. Forma la ecuación característica
por sustitución de la solución de desafío en la ecuación original, de modo que
At
- a2At-2 = 0 para que 2 = a2.

Las dos raíces características son 1 = a2 y 2 = - a2 . La condición de estabilidad es


para ser menos que la unidad en valor para a2
absoluto.

B. Encuentra la solución particular usando el Método de Coeficientes Indeterminados.


Responde: Prueba la solución del desafío yt = b + bit-i. Para que sea una solución, debe

satisfacer b + b0t + b1t-1 + b2t-2 + b3t-3 + ... = a0 + a2(b + b0t-2 + b1t-3 + b2t-4 + b3t-5

+ ...) + t Coeficientes de coincidencia en términos similares

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)

Continuando de esta manera, se deduce que

bi = (a2)i/2 si es par y 0 si es impar.

8. Considere la función de demanda de dinero de Cagan en la que: mt - pt = - [pt+1 - pt]


A. Mostrar que la solución particular para el pt es divergente.

Responde: Usando operadores de retardo, reescribe la ecuación como pt+1 - (1 + )pt = -


mt. Combinando los términos se obtiene [1 - (1 + 1/)L]pt+1 = ( - mt)/ de modo que el
desfase de un período resulta en

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.

B. Obtener la solución particular de futuro para pt en términos de la secuencia {mt}. Al formar la


solución general, ¿por qué es necesario asumir que el mercado monetario está en equilibrio a
largo plazo?

Responde: Resolver para los rendimientos de pt

pt = [ - mt-1]/[1 - (1 + 1/)L]

La expresión (-mt-1)/[1 - (1 + 1/)L] puede obtenerse utilizando la propiedad 6 de los


operadores de lag. Dejemos que (1 + 1/) corresponda al término a y apliquemos la
propiedad 6 para que

(-mt-1)/[1 - aL] = (aL)-1[(aL)0 + (aL)-1 + (aL)-2 + (aL)-3 + ... ]mt-1


= a-1[(aL)0 + (aL)-1 + (aL)-2 + (aL)-3 + ... ]mt
= a-1[mt + a-1mt+1 + a-2mt+2 + a-3mt+3 + ... ]

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

C. Encuentra el multiplicador de impacto. ¿Cómo afecta el aumento de mt+2 al pt?


Proporciona una explicación intuitiva de la forma de toda la función de respuesta al impulso.

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 + ...

Responde: Sustituir cada solución pospuesta por la diferencia original.


A. Como yt = c y yt-1 = c, inmediatamente sigue que c - c = 0.
B. Como yt-1 = c + a0(t-1), se deduce que c + a0t - c - a0(t-1) =
a0.
C. La cuestión es si c + c0(-1)t - c - c0(-1)t-2 = 0? Ya que (-1)t = (-1)t-2, la solución
propuesta es correcta.
D. ¿C + c0(-1)t + t + t-2 + t-4 + ... - c - c0(-1)t-2 - t-2 - t-4 - t-6 - ... = t? Ya que c0(-1)t =
c0(-1)t-2, la solución propuesta es
correcta.

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 - 12 + 0,4 = 0 tiene raíces 12 = 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.

11. Considere la ecuación de diferencia estocástica: yt = 0.8yt-1 + t - 0.5t-1.


A. Supongamos que las condiciones iniciales son tales que: y0 = 0 y 0 = -1 = 0. Ahora supongamos
que 1 = 1.
Determinar los valores y1 a y5 por iteración hacia adelante.

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.

y1 = 1, y2 = 0,3, y3 = 0,24, y4 = 0,192, y5 = 0,1536


Página18 Ecuaciones de
diferencia
B. Encuentra las soluciones homogéneas y particulares.
Responde: La solución de la ecuación homogénea yt - 0,8yt-1 = 0 es yt = A(0,8)t .
Usando operadores de retardo, la solución particular es yt =t - 0,5t-1)/(1 - 0,8L). Si
aplicamos 1/(1-
0,8L) a t y -0,5t-1, obtenemos

yt = t + 0,8t-1 + (0,8)2t-2 + (0,8)3t-3 + ... -0,5t-1 + 0,8t-2 + (0,8)2t-3 + ... ]


= t + (0,8 - 0,5t-1 + 0,8(0,8 - 0,5t-2 + 0,82(0,8 - 0,5t-3 + ...

Página19 Ecuaciones de
diferencia
yt = t + 0,3t-1 + 0,8(0,3t-2 + 0,82(0,3t-3 + ...

C. Imponer las condiciones iniciales para obtener la solución general.

Responde: Combinando las soluciones homogéneas y particulares se obtiene la solución


general

yt = t + 0,3t-1 + 0,8(0,3t-2 + 0,82(0,3t-3 + ... + A(0,8)t .

Ahora imponga la condición inicial y0 = 0 y 0 = -1 = 0 para

obtener 0 = 0 + 0,3-1 + 0,8(0,3-2 + 0,82(0,3-3 + ... + A. Por lo

tanto
A=- - -1 - 0.8(0.3 -2 - 0.82(0.3 -3 + ...

Por lo tanto, A = 0 si el sistema comenzó en equilibrio inicial. Ahora sustituya A para


obtener
t-2


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.

Respuesta: yt/t = 1; yt+1/t = yt/t-1 = 0,3; yt+2/t = yt/t-2 = 0,3(0,8); yt+3/t =


yt/t-3 = 0.3(0.8)2; y para i 1:
yt+i/t = yt/t-i = 0.3(0.8)i-1
12. Utilice la ecuación (1.5) para determinar las restricciones y las necesarias para asegurar que
el proceso {yt} sea estable.
Responde: Para determinar la estabilidad, sólo es necesario examinar la porción homogénea
de (1,5); es decir, yt - (1+)yt-1 + yt-2 = 0 donde 0 < < 1 y >

En términos de la notación utilizada en la figura 1.6, a1 = (1+) y a2 = -. Dado que y son


positivos, a1 > 0 y a2 < 0 . Así, el punto etiquetado 2 podría corresponder a (1+) unidades a lo
largo del eje a1 y - a lo largo del eje a2. Las condiciones de estabilidad para una
ecuación de diferencia de segundo orden son:

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
2Puesto 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

Preguntas y ejercicios 100

Apéndice 2.1: Estimación de un proceso MA(1)104


Apéndice 2.2: Criterios de selección del modelo 105

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 positiva1 = 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

0.5 La primera diferencia de la secuencia es:


yt = 0.5yt-1 + t
0
La primera diferencia de {yt} es un
proceso estacionario de AR(1) tal que a1 =
0.5 0,5.

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

Desviación estándar = 0.609Desviación estándar = 0.193

Transformación logarítmica: = 0 =-0,5

0
050100 050100

Desviación estándar = 0,061Desviación estándar = 0,019

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.

Respuestas a las preguntas


1. En el ejemplo de lanzamiento de moneda de la Sección 1, sus ganancias en los últimos
cuatro lanzamientos (wt) pueden ser denotadas por
wt = 1/4t + 1/4t-1 + 1/4t-2 + 1/4t-3

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. Et)2 = Et-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

Ewt = (1/4)(Et + Et-1 + Et-2 + Et-3) = 0.

Dada la información t-3 = t-2 = 1, la expectativa condicional de wt es Et-2wt =


E(wt t-3 = t-2 = 1) = (1/4)(Et-2t + Et-2t-1 + Et-2t-2 + Et-2t-3) para que
Et-2wt = 0.25(0 + 0 + 1 + 1) = 0.5

B. Encuentra la var(wt). Encuentra var(wt) condicional en


t-3 = t-2 = 1.
Respuestas: var(wt) = E(wt)2 - [E(wt)]2
para que
var(wt) = E(1/4t + 1/4t-1 + 1/4t-2 + 1/4t-3)2
= (1/16)E[t)2 + 2tt-1 + 2 tt-2 + 2tt-3 +t-1)2 + 2t-1t-2 + 2t-1t-3
+t-2)2 + 2t-2t-3 +t-3)2]
Página21 Modelos
estacionarios
Ya que los valores esperados de todos los productos cruzados son cero, y se deduce
que:

Página22 Modelos
estacionarios
var(wt) = (1/16)42 = 0.252

Dada la información t-3 = t-2 = 1, la varianza condicional es

var(wtt-3 = t-2 = 1) = Et-2(1/4t + 1/4t-1 + 1/4t-2 + 1/4t-3)2 - (Et-2wt)2


= (1/16)Et-2[ 2t + 2tt-1 + 2tt-2 + 2tt-3 +t-1)2 + 2t-1t-2 + 2t-1t-3
+t-2)2 + 2t-2t-3 +t-3)2] - (0.5)2

Como Et-2t-2 = Et-2t-3 = 1, se deduce que

var(wt t-3 = t-2 = 1) = (1/16)2 + 2 + 1 + 1 + 2) - 0,25, de modo que


var(wt t-3 = t-2 = 1) = (1/82

C. Hallazgo: i. Cov(wt, wt-1)ii. Cov(wt, wt-2)iii. Cov(wt, wt-5)


Respuestas: Utilizando las mismas técnicas que en la Parte B:
i. Cov(wt, wt-1) = Ewtwt-1-E(wt)E(wt-1) = (1/16)Et + t-1 + t-2 + t-3)t-1 + t-2 + t-3 + t-4)
= (1/16)E[t-1)2 +t-2)2 +t-3)2 + términos de productos cruzados]

Dado que los valores esperados de los términos de los productos


cruzados son todos cero
Cov(wt, wt-1) = (1/16)32

ii. Cov(wt, wt-2) = (1/16)Et + 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]

Dado que los valores esperados de los términos de los productos


cruzados son todos cero Cov(wt,
wt-2) = (1/16)22

iii. Cov(wt, wt-5) = (1/16)Et + 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 +

Note que todos los términos se cancelan. Específicamente:

a0[1 + a1 + a1 2 + ... + a t-1 ] a0 + a1{a0[1 + a1 + a 2 + ... + a t-2]}


t t-1 1 1 1
a1 y0 a1a1 y0 y:

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 +

A. Encuentra la solución homogénea a: yt = a0 + a1yt-1 + t.


Responde: Intentar una solución de desafío de la forma yt = At. Para que esta solución
resuelva el
ecuación homogénea se deduce que = a1 y A puede ser cualquier constante arbitraria.

B. Encuentra la solución particular dado que a1 < 1.


Responde: Usando operadores de retardo, escribe la ecuación como (1 - a1L)yt = a0 + t.
Ya que a0/(1-a1L) 2 t-1 t t+1
= a0/(1-a1) y t/(1-a1L) = t + a1t-1 + a1 t-2 + ... + a1 1 + a1 0 + a1 -1 + ..., es
se deduce que la solución particular es


y = a0 / (1 - a1 ) + ai t-i
t 1
i=0

C. Muestra cómo obtener (2.10) combinando las soluciones homogéneas y particulares.


Responde: Combinando las soluciones homogéneas y particulares se obtiene la
solución general:
 i t
yt = a0 / (1 - a1 ) + a1 t -i + A(a1 )
i=0

de modo que cuando t = 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).

3. Considere el proceso autorregresivo de segundo orden yt = a0 + a2yt-2 + t ,donde a2 < 1.


A. Hallazgo: i. Et-2yt ii. Et-1yt iii. Etyt+2
i. Cov(yt, yt-1)v. Cov(yt, yt-2)vi. las autocorrelaciones parciales 11 y 22
Respuestas:
i) Et-2yt = Et-2(a0 + a2yt-2 + t) = a0 + a2yt-2
ii) Et-1yt = Et-1(a0 + a2yt-2 + t) = a0 + a2yt-2

Obsérvese que Et-1yt = Et-2yt, ya que la información obtenida en el período (t-


Página25 Modelos
estacionarios
1) no ayuda a predecir el valor del yt.

iii) Etyt+2 puede obtenerse directamente de la respuesta a la Parte i. Basta con


actualizar el índice de tiempo por dos períodos para obtenerlo:
Etyt+2 = a0 +
a2yt

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:

yt = a0/(1-a2) + t + a2t-2 + (a2)2t-4 + (a2)3t-6 + (a2)4t-8 + ...

iv) Cov(yt, yt-1) = E[(yt - Eyt)(yt-1 - Eyt-1)]


= Et + a2t-2 + (a2)2t-4 + (a2)3t-6 + (a2)4t-8 + ...]
t-1 + a2t-3 + (a2)2t-5 + (a2)3t-7 + ...]
para
que Cov(yt, yt-1) = 0

v) Cov(yt, yt-2) = Et + a2t-2 + (a2)2t-4 + (a2)3t-6 + ...]


t-2 + a2t-4 + (a2)2t-6 + (a2)3t-8 + ...]
= a2E[t-2)2 + (a2)2t-4)2 + (a2)4t-6)2 + (a2)6t-8)2 + ... ]

Dado a2 < 1, la suma infinita)2i = 1 / [1 - (a2)2] de modo que:


cov(yt, yt-2) = a22/1 - (a2)2]

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:

yt = a0/(1-a2) + t + a2t-2 + (a2)2t-4 + (a2)3t-6 + (a2)4t-8 + ...

Por lo tanto: yt/t = 1. Por el simple cambio de subíndices:


yt+1/t = yt/t-1 = 0; yt+2/t = yt/t-2 = a2;
yt+3/t = yt/t-3 = 0; yt+4/t = yt/t-4 = (a2)2 ...

C. Determinar la función de pronóstico: Etyt+s. El error de pronóstico et (s) es la diferencia entre


yt+s y Etyt+s. Derivar el correlograma de la secuencia { et (s) }. Pista: Encuentra Et et (s) , Var et
(s), y Et et (s)et (s) para j = 0 a s].
Responde: Para encontrar la función de pronóstico, primero encontrar la solución general
para yt en términos de y0. Página27 Modelos
estacionarios
Para un valor dado de y0, los estudiantes deben ser capaces de mostrar que si t es parejo,
entonces:
yt = a0[1 + a2 + (a2)2 + ... + (a2)t/2-1] + t + a2t-2 + (a2)2t-4 + (a2)3t-6 + ... + (a2)t/2y0

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

Generalizando el resultado de la Parte A supra, nótese que para las previsiones de


períodos impares, Etyt+2s-1 = Etyt+2s-2. Para encontrar el error de pronóstico, reste
Etyt+s de yt+s. Para los valores pares de s, podemos dejar s = j/2 y formar
2 s/2-1
et (s) = t+s + a2t+s-2 + (a2) t+s-4 + ... + (a2)

El error de pronóstico tiene una media de cero desde entonces:

Ett+s + a2t+s-2 + (a2)2t+s-4 + ... + (a2)s/2-1t+2] = 0

Análogamente, la varianza es [1 + (a2)2 + (a2)4 + ... + (a2)s-22.

La correlación entre el error de pronóstico para cualquier período t+s y el


error de pronóstico para cualquier período impar es cero. Para los períodos pares,
podemos empezar formando la covarianza entre et(2) y et(4) como:

E[t+4 + a2t+2)t+2)] = a22 de modo que el coeficiente de correlación es a2/(1 + (a2)2)1/2.

Análogamente, la covarianza entre et(2) y et(6) as:

E[t+6 + a2t+4 + (a2)2t+2)t+2)] = (a2)22

de modo que el coeficiente de correlación es


(a2)2/[1 + (a2)2 + (a2)4]1/2

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

ii) El valor esperado de y es la suma de cada posible resultado de y multiplicado por la


probabilidad de ese resultado. Como cada celda tiene una probabilidad de 1/6, la lectura a
través de las filas de la tabla da como resultado:
E(y) = (1/6)(3 + 5 + 3 + 6 + 5 + 6) = 14/3

iii) Cuando x = 1, y puede tomar valores de 3 o 5. Por lo tanto:


E(yx = 1) = 0.5(3) + 0.5(5) = 4.0

iv) Cuando y = 5, x puede tomar los valores 1 o 4. Por lo tanto:


E(xy =5) = 0,5(1 + 4) = 2,5

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

vi) El valor esperado de y2 es la suma de cada posible resultado cuadrado para y


multiplicado por la probabilidad de ese resultado. Por lo tanto:
E(y2) = (1/3)(32 + 52 + 62) = 70/3

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.

Observe que la respuesta a la Parte C no ha cambiado.

5. La solución general de una ecuación de diferencia de n-orden requiere n constantes arbitrarias.


Considere la ecuación de segundo orden: yt = a0 + 0.75yt-1 - 0.125yt-2 + t.
A. Encuentra las soluciones homogéneas y particulares. Discutir la forma de la respuesta del
impulso
función.

Responde: La ecuación homogénea es yt = 0.75yt-1 - 0.125yt-2. Pruebe la


solución del desafío yt = At y obtenga
A
- 0,75At-1 + 0,125At-2 = 0

de modo que la ecuación característica es 2 - 0,75 + 0,125 = 0.


Las dos raíces características son 0,5 y 0,25 y A puede ser cualquier constante
arbitraria. Dado que una combinación lineal de las dos soluciones homogéneas es
también una solución, la forma completa de la solución homogénea es yt = A1(0,5)t +
t
A2(0,25) donde A1 y A2 son constantes arbitrarias.
La solución particular tiene la forma yt = b0 + it-i. La constante b0 puede ser
fácilmente encontrada como b0 = a0(1 - 0.75 + 0.125) = 8a0/3. Para encontrar la i
sustituya yt = it-i por yt = 0.75yt-1 - 0.125yt-2 + t para obtener:

0t + 1t-1 + 2t-2 + 3t-3 + ... = 0,750t-1 + 1t-2 + 2t-3 + ...)


- 0,1250t-2 + 1t-3 + 2t-4 + ...) + t

Coeficientes de coincidencia en términos similares, se deduce que:

Página31 Modelos
estacionarios
0 = 1; 1 = 0,75; y todas las i posteriores son tales que i = 0,75i-1 - 0,125i-2

Por ejemplo, 2 = 0,4375, 3 = 0,2348, 4 = 0,1211, y 5 = 0,0615.


Las respuestas de impulso vienen dadas por los coeficientes de la solución
particular. Para
ejemplo, yt/t = 1; yt+1/t = yt/t-1 = 0,75; yt+2/t = yt/t-2 = 0,4375. Dado que ambas raíces
características son positivas y menos que la unidad, las respuestas de impulso convergen
directamente hacia el valor a largo plazo yt = 8a0/3.

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:

yt = A1(0,5)t + A2(0,25)t + 8a0/3 + t + 0,75t-1 + 0,4375t-2 + ...

de modo que para los períodos 0 y 1:

y0 = A1+ A2 + 8a0/3 + 0 + 0.75-1 + 0.4375-2 + ...


y1 = A1(0,5) + A2(0,25) + 8a0/3 + 1 + 0,750 + 0,4375-1 + ...

La cuestión es seleccionar y0 y y1 de tal manera que A1 = A2 = 0. Si y0 = 8a0/3 + 0


+ 0,75-1 + 0,4375-2 + ... y y1 = 8a0/3 + 1 + 0,750 + 0,4375-1 + ... ...entonces A1 = A2 = 0, de
modo que la solución general es:
yt = 8a0/3 + t + 0,75t-1 + 0,4375t-2 + ...

C. Dada su respuesta a la parte B, derive el correlograma para la secuencia {yt}.


Responde: Dadas las condiciones iniciales encontradas en la Parte A, las ecuaciones de
Yule-Walker pueden ser
utilizado para derivar el correlograma. Por simplicidad, abstraer de la constante a0 ya que
no afecta a las autocorrelaciones. Por lo tanto, establece a1 = 0,75 y a2 = -0,125, y usa
(2,28) y (2,29) para encontrar las autocorrelaciones. Dado que 0 = 1, se deduce que 1 =
0,75 - 0,1251 y
1 = 2/3 y s = 0.75s-1 -0.125s-2

Por ejemplo, 2 = 0,375; 3 = 0,1979; 4 = 0,1012; 5 = 0,0512.....

6. Considere la ecuación de diferencia estocástica de segundo orden: yt = 1.5yt-1 - 0.5yt-2 + t.


A. Encuentra las raíces características de la ecuación homogénea.

Responde: La ecuación homogénea es yt - 1.5yt-1 + 0.5yt-2 = 0. Si intentas la solución


de desafío yt = At, A y debes satisfacer: At - 1.5At-1 + 0.5At-2 = 0. Dividiendo por At-2, la
ecuación característica es 2 - 1.5 + 0.5 = 0. Así, A puede ser cualquier constante
Página32 Modelos
estacionarios
arbitraria y las raíces características, (es decir, ) pueden ser 1 o 0.5. La solución
homogénea es:

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:

y3 = 3 + 1.52 + 1.75y1 - 0.75y0.

De manera similar, y4 = 1.5y3 - 0.5y2 + 4. Sustituyendo los rendimientos de y3 y y2:

y4= 4 + 1.53 + 1.752 + 1.875y1 - 0.875y0

Continuar de esta manera rinde:

y5 = 5 + 1,54 + 1,753 + 1,8752 + 1,9375y1 - 0,9375y0


y6 = 6 + 1,55 + 1,754 + 1,8753 + 1,93752 + 1,96875y1 - 0,96875y0

La solución tiene la forma:


t -2
yt = i t-i + t -1 y1 + t y0
i=0

donde: 0 = 1, 1 = 1,5, t = 1- t-1, y los restantes coeficientes i resuelven la ecuación de


diferencia i = 1,5i-1 - 0,5i-2. Dado que los coeficientes crecerán progresivamente, la
solución particular de atrás no será convergente. Las condiciones iniciales son necesarias
para que yt sea finita para los valores finitos de t.

D. Encuentra la función de pronóstico para yt+s.


Responde: Primero escriba la respuesta de la Parte C en términos de s en lugar de t:
s-2
y s i s-i s-1 y1 s y 0

Luego actualizar por períodos t para obtener:

Página34 Modelos
estacionarios
s-2
yt+s = i t+s-i + s-1 yt +1 + s yt
i=0

Para s > 1, las previsiones condicionadas a la información en t+1 y t se pueden hacer


usando
Et+1yt+s = s-1yt+1 + syt.

E. Encuentra: Eyt, Eyt+1, Var(yt), Var(yt+1), y Cov(yt+1, yt).


Respuestas: El punto es ilustrar que la secuencia no es estacionaria. Considere:
i. Eyt = t-1y1 + ty0. Como t-1 y t son funciones del tiempo, la media no es constante.
ii. Eyt+1 = ty1 + t+1y0. Note que Eyt+1 Eyt.
iii. var(yt) = [1 +1)2 +2)2 + ... +t-2)22
iv. var(yt+1) = [1 +1)2 +2)2 + ... +t-1)22 para que var(yt+1) var(yt ).
v. cov(yt+1, yt) =01 + 12 + ... + t-3t-22.

7. El archivo titulado SIM_2.XLS contiene los conjuntos de datos simulados utilizados en


este capítulo. La primera columna contiene los 100 valores del proceso simulado AR(1)
utilizado en la sección 7. Este primer
se titula Y1. 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 presentadas
en el texto.

Programa de muestra para los usuarios de RATS

todas las 100;* Las primeras 3 líneas se leen en el conjunto de datos


datos abiertos a:\sim_2.xls ;* Modifique esto si sus datos no están en la
unidad a: data(format=xls,org=obs)

cor(partial=pacf,qstats,number=24,span=8) y1 ;*calcula el ACF, PACF, y Q-


estadístic
as Elgráfico 1;* representa la serie simulada
# y1

boxjenk(ar=1) y1 / resids;* estima un modelo AR(1) y guarda el


;* residuos en la serie llamada residuos

* Las siguientes 3 líneas calculan y muestran el AIC y el


SBC calculan aic = %nobs*log(%rss) + 2*%nreg
calcular sbc = %nobs*log(%rss) + %nreg*log(%nobs)
visualizar ' aic = ' AIC ' sbc = ' sbc

* Obtener las estadísticas ACF, PACF y Q de los residuos


Página35 Modelos
estacionarios
c eg) de los residuos
o
r
(
p
a
r
t
i
a
l
=
p
a
c
f
,
q
s
t
a
t
s
,
n
u
m
b
e
r
=
2
4
,
s
p
a
n
=
8
,
d
f
c Página36 Modelos
= estacionarios
%
n
r
* Ahora estimar el modelo con un término MA en el retraso
12 boxjenk(ar=1,ma=||12||) y1 / resids
cor(partial=pacf,qstats,number=24,span=8,dfc=%nreg) resids
computa aic = %nobs*log(%rss) + 2*%nreg
calcular sbc = %nobs*log(%rss) + %nreg*log(%nobs)
visualizar ' aic = ' AIC ' sbc = ' sbc

boxjenk(ar=2) y1 / resids;* Estima el modelo AR(2) boxjenk(ar=1,ma=1) y1 /


resids;* Estima un modelo ARMA(1, 1)

Programa de muestra para los usuarios de STATA

/*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

que se guarde el conjunto de datos*/ insheet usando sim_2.txt

tsset obs/*declarar que este es un conjunto de datos de series de tiempo*/

*A: trazar la secuencia contra la


línea de tiempo y1 obs

*B:verificar los primeros 12 coeficientes del ACF y


PACF corrigen y1, lag(24)

*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*/

arima y1,ar(1) noconstante


pantalla " AIC = " =-2*e(ll)+2*e(k)
pantalla " SBC = " =-
2*e(ll)+e(k)*ln(e(N)) predecir
residuos1,residuos
corrigiendo los residuos1, lag(24) /*verificar las estadísticas Q de los residuos del Modelo 1*/

/*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.*/

set matsize 800


arima y1,ar(1) ma(12) noconstant /*estimación Modelo
2*/ pantalla " AIC = " =-2*e(ll)+2*e(k)
pantalla " SBC = " =-2*e(ll)+e(k)*ln(e(N))

/*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*/

predecir los residuos2, los residuos


corrigiendo los residuos2, lag(24) /*verificar las estadísticas Q de los residuos del Modelo 2*/

*D: estimar la serie y1 como un AR(2) sin un reg y1 l. y1


l2.y1, noconstante

*E:estimar la serie y1 como un ARMA(1,1) sin una intercepción


arima y1,ar(1) ma(1) noconstante

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.

Programa de muestra para los usuarios de RATS


Página39 Modelos
estacionarios
todas las 100;* Las primeras 3 líneas se leen en el conjunto de datos
datos abiertos a:\sim_2.xls ;* Modifique esto si sus datos no están en la
unidad a: data(format=xls,org=obs)

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

*RATS contiene un procedimiento para trazar autocorrelaciones y autocorrelaciones parciales.


Para usar el
*procedimiento usar las siguientes dos líneas de programa:

source(noecho) c:\winrats\bjident.src ;* asumiendo que RATS está en un directorio llamado


C:\WINRATS
@bjident y2

boxjenk(ar=1) y2 / resids;* estima un modelo AR(1) y guarda los residuos


cor(number=24,partial=partial,qstats,span=8) resids / cors
calcular aic = %nobs*log(%rss) + 2*%nreg
calcular sbc = %nobs*log(%rss) + %nreg*log(%nobs)
visualizar ' aic = ' AIC ' sbc = ' sbc

boxjenk(ar=2) y2 / resids;* estima un modelo AR(2) y guarda los residuos


cor(number=24,partial=partial,qstats,span=8) resids / cors
calcular aic = %nobs*log(%rss) + 2*%nreg
calcular sbc = %nobs*log(%rss) + %nreg*log(%nobs)
visualizar ' aic = ' AIC ' sbc = ' sbc

*Continúe copiando las declaraciones utilizadas en la Pregunta 7. Para el

MA(2) use: boxjenk(ma=2) y2 / resids


cor(number=24,partial=partial,qstats,span=8) resids / cors

*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*/

*A: trazar la secuencia contra la


línea de tiempo y2 obs
/*verificar los primeros 12 coeficientes del ACF y
PACF*/ corrigiendo y2, lag(12)

*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)

predecir los residuos1, los residuos


residuo de corrimiento1, lag(24) /*Estadísticas de residuos del Modelo 1*/

arima y2,ar(1) ma(1) noconstante /*estimación


Modelo 2*/ pantalla " AIC = " =-2*e(ll)+2*e(k)
pantalla " SBC = " =-2*e(ll)+e(k)*ln(e(N))

predecir los residuos2, los residuos


corrigiendo los residuos2, lag(24) /*verificar las estadísticas Q de los residuos del Modelo 2*/

reg y2 l. y2 l2.y2, noconstante /*estimación Modelo


3*/ pantalla " AIC = " =e(N)*ln(e(rss))+2*e(df_m)
mostrar " SBC = "
=e(N)*ln(e(rss))+e(df_m)*ln(e(N)) predecir
residuos3, residuos
corrgrama resids3, lag(24)

*C: estimar el proceso usando un modelo puro de


MA(2) arima y2,ma(1 2) noconstante
predecir residsc, residuos
corrigir residsc, lag(24)

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:

cor(partial=pacf,qstats,number=24,span=8) y3;* calcula el ACF, PACF, y el gráfico de


estadísticas Q 1 ; # y3;* traza la serie simulada

boxjenk(ar=1) y3 / resids;* estima un modelo AR(1) y guarda los residuos

boxjenk(ar=1,ma=1) y3 / resids;* estima un modelo ARMA(1) y guarda los residuos


cor(partial=pacf,qstats,number=24,span=8,dfc=%nreg) resides

boxjenk(ar=2) y3 / resids;* estima un modelo AR(2) y guarda los residuos


cor(partial=pacf,qstats,number=24,span=8,dfc=%nreg) resids

*Para estimar el modelo AR(2) con el coeficiente único de MA en el lag 16


usa: boxjenk(ar=2,ma=||16||) y3 / resids

Programa de muestra para los usuarios de STATA

Use las primeras cuatro líneas de la pregunta 7 u 8 para leer el conjunto de datos.

Para graficar los datos use:


*A: trazar la secuencia contra la
línea de tiempo y3 obs
corrgrama y3, lag(12) /*verificar los primeros 12 coeficientes del ACF y PACF*/

*B:estimar la serie como un proceso


AR(1) reg y3 l. y3, noconstante
pantalla " AIC = " =e(N)*ln(e(rss))+2*e(df_m) /*computar AIC del modelo AR(1)*/
pantalla " SBC = " =e(N)*ln(e(rss))+e(df_m)*ln(e(N)) /*computar SBC del modelo
AR(1) 1*/ predecir residuosb, residuos
corrigiendo los residuos, lag(24) /*verificar las estadísticas Q de los residuos del modelo AR(1)*/

*C:estimar la serie como un proceso


ARMA(1,1) arima y3,ar(1) ma(1) noconstante
predecir los residuos, los residuos
corrigiendo los residuos del modelo ARMA(1,1), lag(24) /*verificar las estadísticas Q de los
residuos del modelo ARMA(1,1)*/

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)*/

set matsize 800


arima y3,ar(1 2) ma(16) noconstante

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:

AIC = -2ln(L)/T + 2n/T donde (como se puede ver en el Apéndice

2.1) lnL = -(T/2)ln(2) - (T/2)ln2 - (22)-1t)2

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 comot)2/T. Obsérvese que esto implica que2)-1t)2
= T (es decir, una constante). Por lo tanto, una transformación monótona de ln L es
-(T/2) ln(t)2/T)

Por lo tanto, una transformación monótona de AIC = -2ln(L)/T +

2n/T es ln(t)2/T) + 2n/T

o multiplicando por T y sumando ln(T)-dos transformaciones monótonas más, obtenemos

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).

11. Los usuarios de RATS pueden introducir el siguiente código:

cal 1960 1 4;* Las 4 líneas que se leen en el conjunto de datos


todo el 2002:1 El PPI es trimestral en el período 1960:1 - 2002:1 datos
abiertos a:\ trimestral. xls
Página36Modelos
estacionarios
data(format=xls,org=obs)

Página37Modelos
estacionarios
dif ppi / dy
log ppi / ly Estas dos líneas forman el cambio
logarítmico difuso.

*La figura 2.5 fue creada usando:


spg(hfi=1,vfi=3,hea=' Figura 2.5'
)
gra(hea=' Panel a: El índice de precios al productor: (1995 = 100)' )
1 ; # ppi gra(hea=' Panel b: Primera Diferencia del PPI' ) 1 ; # dy
gra(hea=' Panel c: Diferencia logarítmica del PPI' ) 1 ; # dly
spg(hecho)

/* 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

*Las estadísticas resumidas de las dos series están


dadas por: tabla 1989:4 * err11
tabla 1989:4 * err114

*Para la prueba de Diebold-Mariano, forma (2.62) usando los

valores absolutos establecidos d 1989:4 * = abs(err11) - abs(err114)

*El valor medio (es decir, d ) y la varianza (es decir, 0) pueden obtenerse

usando: sta d ; com dbar = %media ; dis dbar %varianza

/*Deberías encontrar que d es igual a -4.99789e-05 y que la variación de dt es 6.94794e-06. A


todos los efectos prácticos, las autocorrelaciones de dt son cero. Por lo tanto, la estadística
deseada es:
*/
DM = -4.99789e-05/[0.00000694794/49)0.5] = -0.13273.

* No hay una diferencia significativa entre los dos pronósticos.

*Para la prueba de Granger-Newbold, forma x y z


usando el conjunto x 1989:4 * = err11 + err114
set z 1989:4 * = err11 - err114

*Obtener el coeficiente de correlación


usando la cruz x z 1989:4 * 0 0 rxz

*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:

com den = (1-rxz(1)**2)/49


dis rxz(1)/(den**.5)

*El valor de -0,538 no es significativo en ningún nivel convencional.

Programa de muestra para los usuarios de STATA

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*/

*A:estimar la serie como un proceso


ARMA(1,1) arima dlppi, ar(1) ma(1)
predecir los residuos1, los residuos
corrigiendo los residuos1, lag(12) /*verificar las estadísticas Q de los residuos del Modelo
ARMA(1,1)*/

arima dlppi, ar(1) ma(1 4) /*estimar la serie como un proceso ARMA(1,1


4)*/ predecir residuos2, residuos
corrigiendo los residuos2, lag(12) /*verificar las estadísticas Q de los residuos del modelo
ARMA(1,1 4)

reg dlppi l.dlppi l2.dlppi /*estimar la serie como un proceso AR(2)*/


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) 1*/ predecir residuos3, residuos
corrigiendo los residuos3, lag(12) /*verificar las estadísticas Q de los residuos del Modelo
AR(2)*/

*B: Estimar el modelo ARMA(1,1) en el período 1960:Q1 a 1989:Q3


gen time = real(substr(descriptor,1,4) + substr(descriptor,6,1)) /*esta línea es para cambiar la
variable de cadena "descriptor" en el conjunto de datos original a una variable numérica
"tiempo" para facilitar la siguiente estimación sobre ciertos períodos*/

arima dlppi si el tiempo < = 19893, ar(1) ma(1)


predecir e1t si el tiempo > 19893, residuos /* obtener los cincuenta y un pasos por delante de
los errores de pronóstico del modelo ARMA(1,1) y guardarlo en la nueva variable e1t*/
summ e1t

*B:estimar el modelo ARMA(1,1 4) en el periodo 1960:Q1 a 1989:Q3


arima dlppi si el tiempo < = 19893, ar(1) ma(1 4)
predecir e2t si el tiempo > 19893, residuos /* obtener los cincuenta y un pasos adelante de los
errores de pronóstico del modelo ARMA(1,1 4)*/
summ e2t

*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

gen xt=e1t+e3t if time > 19893


gen zt=e1t-e3t if time > 19893
cor xt zt
muestra " GN Stat=" =r(rho)/sqrt((1-(r(rho))^2)/49)

*D:Prueba de Granger-Newbold para comparar el modelo ARMA(1,1) con el modelo


ARMA(1,(1,4)) gen xt1=e1t+e2t si el tiempo > 19893
gen zt1=e1t-e2t si el tiempo >
19893 cor xt1 zt1
muestra " GN Stat=" =r(rho)/sqrt((1-(r(rho))^2)/49)

12. Los usuarios de RATS pueden utilizar lo siguiente para obtener los resultados que se
indican en la sección 11.

*Las primeras 4 líneas se leen en el


conjunto de datos cal 1960 1 4
todo el 2002:1
datos abiertos
a:\\Ntrimestral. xls
data(format=xls,org=obs)

*Crea x como M1NSA, y haz un número de transformaciones

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})

* La figura 2.7 fue creada con


label growth x;* creó la leyenda para el gráfico
# 'Tasa de crecimiento' ' ' M1 en miles de millones'

gra(hea=' Figura 2.7: El nivel y la tasa de crecimiento de M1' ,overlay=line, $


patterns,key=below,nokbox,ovl=' miles de millones de $' ,vla=' tasa de crecimiento' ) 2
;# crecimiento ; # x;

*El modelo AR(1) con un coeficiente estacional MA(1) fue estimado


usando: box(ar=1,sma=1,constante) sdlx / resids

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

indicadas: conjunto x = ddnsa


log x / lx
dif lx / dlx dif(sdiffs=1) lx /
slx dif(sdiffs=1,dif=1) lx /
sdlx
crecimiento del conjunto = dlx ;* Equivalente a log(x/x{1})

*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

cor(number=24,partial=partial,qstats,span=4) dlx / cors

C. Las correlaciones del log(DDNSAt) - log(DDNSAt-4) vienen


dadas por cor(number=12,partial=partial,qstats,span=4) slx

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.

box(ar=1,sma=1,constante) sdlx 1962:3 * resids


cor(number=24,partial=partial,qstats,span=4) resids / cors
box(ar=1,sar=1,constant) sdlx 1962:3 * resids
cor(number=24,partial=partial,qstats,span=4) resids / cors
box(ma=1,sma=1,constant) sdlx 1962:3 * resids
cor(number=24,partial=partial,qstats,span=4) resids / cors

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

Preguntas y ejercicios 151

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.

Respuestas a las preguntas


1. Supongamos que la secuencia {εt } es el proceso
ARCH(q)

εt = vt . [α0 +α1(εt-1)2 +...+ αq (εt-q)2]1/2

Muestra E ε 2 tiene la misma forma que la variante condicional de (3.1).


que...
t-1 t

Responde: Independientemente de que se utilicen o no los residuos de la regresión real, el


valor esperado de E(εt)2 es:

Et-1(εt)2 = α0 + α1E(εt-1)2 + ... + αqE(εt-q)2

Ahora usando (3.8), εt = vt . [α0 +α1(εt-1)2 +...+ αq (εt-q)2]1/2 para que:


Et-1(εt) = Et-1[(vt)2 (α0 + α1 (εt-1)2 +...+ αq (εt-q)2)]
2

= Et-1(vt)2 . Et-1[α0 + α1 (εt-1)2 +...+ αq (εt-q)2]


= α0 + α1 (εt-1)2 +...+ αq (εt-q)2

Por lo tanto, utilizando ya sea (3.1) o (3.8):


Et-1(εt)2 = α0 + α1(εt-1)2 +...+ αq (εt-q)2

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.

A. Encuentra la media incondicional: Eyt. ¿Cómo afecta un cambio en δ a la media? Usando el


ejemplo de la sección 6, muestra que el cambio de β y δ de (-4, 4) a (-1, 1) preserva la media de la
secuencia {yt}.
Responde: Combine (3.23), (3.24) y (3.25) y tome la expectativa del resultado para
obtener:
q

Eyt = E (µt + εt) = E (β + δ.


ht + εt) = E [β + δ[α0 + ∑αi (εt-i)2] + εt]
i=1
Página43 de la volatilidad
Como E(εt)2 = E(εt-1)2 = ... = 1, y Eεt = 0 se deduce que:
q

Eyt = β + δ.
(α0 + ∑ αi)
i= 1

Aumentar β tiene un efecto 1:1 en la media; el efecto de un cambio de una unidad en δ en


Eyt es α0 +

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:

Eyt = -4 + 4 (α0 + Σαi) = -4 + 4.1 = 0.

De manera similar, si β = -1 y δ = 1, entonces Eyt = 0. Por lo tanto, cambiar β y δ de (-4, 4)


a (-1, 1) preserva la media de la secuencia {yt}.

B. Mostrar que la variación incondicional del yt cuando ht = α0 + α1 (εt-1)2 no depende de β, δ, y


α0.
Responde: De la ecuación (3.23), yt = µt + εt de modo que la varianza incondicional de yt
es:

Var(yt) = var(µt) + var(εt) + 2 Cov(µt,εt).

Fíjese en eso: Var(εt) = E(εt)2 - [E(εt)]2 = 1 - 02 = 1. A continuación,

forme cov(µt,εt) como: Cov(µt,εt) = E (µtεt) - E(µt) . E(εt)


= E [(β+δ. ht) . εt] - E (β+δ. ht) . 0
= E {[β+δ . (α0 +α1(εt-12)] . εt}
= E [β. εt+δ . (α0 +α1(εt-1)2) εt]
= β. E(εt)+δ . E[(α0 +α1(εt-1)2 )εt]
= β. 0+δ. 0 = 0

Ahora, encuentra Var(µt) como:

Var(µt) = var(β+δ. ht) = δ2var(ht) = δ2var[α0 +α1(εt-1)2]


= δ2(α1)2var[(εt-1)2].

Por lo tanto, la variación incondicional de yt no depende de β y α0 ya que var(yt) = var(µt +


εt) y cov(ut, εt) = 0. Por lo tanto:

Var(yt) = 1 + δ2(α1)2 . var[(εt-1)2]

Sin embargo, a diferencia de lo que se afirma en la pregunta, aumentar el valor absoluto de


δ
aumenta la var(yt).

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..:

ηt = (εt)2 - ht = (vt)2ht - ht = [(vt)2 - 1] ht.

Como la VT y la HT son independientes, se deduce que:

E(ηt) = E{[(vt)2 - 1] ht}= E [(vt)2-1]E(ht) = (1-1) . E(ht) = 0, ∀ t.

Como tal, cov(ηt,ηs) = E {[ηt-E(


.
ηt)][ηs-E(ηs)]}
2 . 2
= E (ηt ηs) = E {[(vt) -1]ht [(vs) -1]hs}

cov(ηt, ηs) = E[(vt)2-1]E(ht). E[(vs)2-1]E(hs) = 0

Por lo tanto, ηt no está correlacionada en serie. Para mostrar que la secuencia


{(εt)2} actúa como un proceso de ARMA(2,1) utiliza los resultados 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.

B. Considere el proceso GARCH(2, 1): ht = α0 + α1(εt-1)2 + β1 ht-1 + β2 ht-2. Demuestre que es


posible agregar ηt a cada lado para obtener:
2
(εt) = α0 + α1(εt-1)2 + β1 ht-1 + ηt + β2 ht-2.

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:

ht + [(εt)2 - ht] = α0 + α1(εt-1)2 + β1 ht-1 + β2ht-2 + (εt)2 - ht.

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).

C. Proporcionar una explicación intuitiva de la declaración:


"El multiplicador de Lagrange para la prueba de errores ARCH no puede ser usado para
probar el nulo de residuos cuadrados de ruido blanco contra una alternativa de un proceso
específico de GARCH(p,q)."

Responde: Cada proceso de GARCH(p,q) tiene una representación del proceso de


ARMA(m,p) para el ACF de los residuos cuadrados, donde m=max(p,q). De modo que el
Multiplicador de Lagrange para la prueba de errores ARCH no puede ser usado para probar
el nulo de los residuos cuadrados de ruido blanco contra una alternativa de un proceso
específico de GARCH(p,q).

D. Esboza la prueba de la declaración general de 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).
q p

Responde: Considerar el proceso GARCH(p,q): ht = α0 + αi ∑ (εt-i)


i= 1
2
+ ∑ βjht-j.
j=1

Añada la expresión (ε2t - ht) a cada lado para dar:


q p

(εt)
2
= α0 + ∑ αi(εt-i)2 + ∑ βjht-j + (εt)2 - ht
i= 1 j =1
q p p p

= α0 + ∑ αi(εt-i)2 + [ ∑ βj(εt-j)2 - ∑ βj(εt-j)2] + ∑ βjht-j + (εt)2 - ht


i= 1 j =1
q p

Página49 de la volatilidad
j =1 j =1
p

= α0 + [ ∑ αi (εt-i)2 + ∑ βj(εt-j)2] - ∑ βj[(εt-j)2 - ht-j] + (εt)2 - ht


i= 1 j =1 j =1

= α0 + (α + β1)(εt-1)2 + (α2 + β2) (εt-2)2 + ... + (αm + βm)(εt-m )2


-β1ηt-1 - β2ηt-2 -... -βp ηt-p + ηt,

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

donde m = max(p,q), αi ≡ 0 para i > q, βj ≡ 0 para j > p .

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}.

Responde: Para el Modelo 1, las realizaciones son: (1,-0.5,-2.25,-0.125, 0.9375). La media


de la muestra del Modelo 1 es: (1/5) (1 - 0,5 - 2,25 -0,125 + 0,9375) = -0,1875, y la varianza
de la muestra es: (1/5) [12 +(-0.5)2+(-2.25)2 +(-0.125)2+(0.9375)2] - (-0.1875)2 = 1.40625.

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.

Para el Modelo 3, las realizaciones son: (1,-1.5,-3.75,-4.875, -2.4375). La media de la


muestra es (1/5) (1-1,5-3,75-4,875-2,4375) = -2,3125 y la varianza de la muestra es: (1/5)
[12+ (-1.5)2 + (- 3.75)2 + (-4.875)2 + (-2.4375)2] - (-2.3125)2 = 4.05625.
Por lo tanto:

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.

Programa de muestra para los usuarios de RATS:


todos los 100;* asigna el espacio para 100 observaciones
datos abiertos a:\N-archivo. xls ;* abre el conjunto de datos que se supone que
están en la unidad a:\ data(format=xls,org=obs)

tabla / y;* produce las estadísticas resumidas de la serie ARCH(1)


; * La serie ARCH(1)
etiquetada y

* A continuación, estimar un modelo AR(1) sin interceptar y producir el ACF y el PACF.


boxjenk(ar=1) y / resids
cor(partial=pacf,qstats,number=24,span=4,dfc=1) resids

* 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}

calcular trsq= %nobs*%rsquared;* Calcular TR2 y su nivel de significación cdf


chisqr trsq 1

linreg sqresid ;* estimar un modelo AR(4) de los residuos


cuadrados.
# constante sqresid{1 a 4}

nonlin b1 a0 a1 ;* se prepara para una estimación no lineal b1 a0 y


a1 frml regresid = y - b1*y{1} ;* define el residuo
frml archvar = a0 + a1*regresid(t-1)**2 ;* define la variación
frml archlogl = (v=archvar(t)), -0.5*(log(v)+regresid(t)**2/v) ; * define la probabilidad
boxjenk(ar=1) y;* estima un AR(1) para obtener un cálculo inicial b1=%beta(1) ;*
adivina el valor de b1 y a0
calcular a0=%seesq, a1=.3;* las conjeturas iniciales de a0 y a1

* Dadas las conjeturas iniciales y la definición de archiconoce, la siguiente línea realiza el


no-
* estimación lineal de b1, a0 y a1.
maximize(method=bhhh,recursivo,iterations=75) archlogl 3 *

Programas de muestra para usuarios de STATA


claro
cd "a:\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
gen obs = _n /*obs es 1,2,...,_N, un nuevo vector de columna creado para actuar como
una variable de tiempo*/ tsset obs /*declarar que es un conjunto de datos de serie de
tiempo*/

/*A: estimar la serie usando OLS*/


reg y l. y,noconstante
predecir los residuos, residuos
corrgrama de residuos, lag(24) /*B: obtener el ACF y el PACF de los residuos*/

gen sqresid=residuos^2 /*C:obtener el ACF y PACF de los residuos


cuadrados*/ corrgrama sqresid,lag(24)

/*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)

/*E:estimar los residuos cuadrados como un proceso


ARCH(4)*/ reg cuadrado l.cuadrado l2.cuadrado
l3.cuadrado l4.cuadrado

/*F: estimar simultáneamente la secuencia y el proceso de error ARCH(1) utilizando la


estimación del ML*/ arch y l. y, arch(1) noconstante

6. El archivo QUARTERLY.XLS contiene los valores trimestrales del Índice de Precios al


Productor (IPP) de los Estados Unidos que se utilizaron en la Sección 4. El siguiente programa
estimará los diversos modelos de GARCH del cambio logarítmico en el PPI.

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)

* Las siguientes tres líneas forman la tasa de inflación como el cambio


logarítmico en el PPI dif ppi / dy
log ppi / ly
dif ly / dly

*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}

* Ahora usa ocho rezagos


lin(nopri) r2 ; # constante r2{1 a 8}

* Para excluir los desfases de 5 a 8


use: exc ; # r2{5 a 8}
Página56 de la volatilidad
* El siguiente bloque de instrucciones puede ser usado para estimar el modelo ARMA(1,(1,4)) con
* Errores del ARCH(4). Se pueden encontrar detalles adicionales en el capítulo 1 del Manual de
Programación.

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 *

* Para estimar el ARMA(1,(1,4)) con los errores de


GARCH(1,1), use el conjunto w = 0.0
set u = 0.0
nonlin b0 b1 b2 b3 a0 a1 a2
frml e = dly - b0 - b1*dly{1} - b2*u{1} - b3*u{4}
frml var = a0 + a1*e{1}**2 + a2*w{1}
frml L = (u = e), (w = var), -.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=.3 , a2 = .5
maximize(iterations=75) L 6 *

*Los residuos están contenidos en la serie u. Puede realizar los diagnósticos apropiados en esta
serie.

Los usuarios de STATA pueden usar el siguiente programa


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ágina58
variable dedetiempo*/
la volatilidad
tsset obs
gen piet=ln(ppi)-ln(l.ppi)

/*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*/

/*B: trazar el ACF y el PACF de los residuos


cuadrados*/ gen r2 = resids^2
corrgram r2,lag(12)
ac r2,lag(12)
pac r2,lag(12)

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*/

/*C:replicar los resultados de los distintos modelos de GARCH en la sección 4*/


/*debido a los diferentes métodos utilizados en STATA para maximizar la función de
verosimilitud y la posible diferencia en los valores iniciales de los coeficientes, los siguientes
resultados de regresión son ligeramente diferentes de los de RATS*/
arch piet,ar(1) ma(1 4) arch(1/4) /*estimar piet usando un modelo ARMA(1,(1,4))
asumiendo un proceso de error ARCH(4)*/

/* limitar los coeficientes en el proceso ARCH(4) a 0,4,0,3,0,2,0,1*/


limitar definir 1 (3/4)*[ARCH]l1.arch=[ARCH]l2.arch
constrain define 2 (2/4)*[ARCH]l1.arch=[ARCH]l3.arch
constrain define 3 (1/4)*[ARCH]l1.arch=[ARCH]l4.arch
arch piet,ar(1) ma(1 4) arch(1/4) constraint(1/3)
lincom [ARCH]l.arch/.4 /* recuperar el parámetro alfa de la especificación original. Cualquiera
de los cuatro parámetros del arco podría utilizarse para producir una estimación idéntica. Es
equivalente a A1 en RATS.*/

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.

* La siguiente instrucción produce el gráfico del proceso ARCH-M


(header=' Proceso ARCH-M simulado' ) 1 ; # y_m

* Para estimar el proceso de MA(||3,6|||) y guardar los residuos como


residuos, usa: boxjenk(constante,ma=||3,6|||) y_m / resids

*Las correlaciones de los residuos (y las estadísticas Q) están


dadas por los residuos
cor(partial=pacf,qstats,number=24,span=8)

* Ahora formen los residuos cuadrados y obtengan las autocorrelaciones usando


set ressq = resids*resids;* Forma los residuos cuadrados
cor(partial=pacf,qstats,number=24,span=4) ressq

* 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}

*Para obtener el uso de la


estadística F, excluya; #
ressq{1 a 4}

* Alternativamente, para obtener el uso de TR2


Calcular trsq = %nobs*%rsquared;* Calcular T*R2 y obtener la densidad acumulada cdf
chisqr trsq 4;* de trsq como chi-cuadrado con 4 grados de libertad.

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*/

línea y_m obs /*producir el gráfico del proceso ARCH-M*/


/* estimar el proceso de MA(3,6) y almacenar los residuos en los nuevos residuos variables*/
set matsize 800 /*matsize está inicialmente establecido en 40 pero aquí requiere al menos
max(ar,ma+1)^2 o 49(max(0,6+1)^2). ver [R]matsize para más detalles*/
arima y_m,ma(3 6)
predecir
residuos,residuos corr
corr corr
corrido,lag(24) gen
ressq = resids^2 corr
corr corrido
ressq,lag(24)

/*realizar la prueba del multiplicador de Lagrange para los


errores del ARCH(4)*/ reg ressq l.ressq l2.ressq l3.ressq
l4.ressq
prueba l.ressq l2.ressq l3.ressq l4.ressq /*obtener el F-stat de la hipótesis nula de no errores
ARCH*/
mostrar " LM stat =" =e(N)*e(r2) / * u t i l i z a r los resultados guardados después de la
estimación para calcular las estadísticas de las pruebas*/
pantalla " El valor probable es: " =chi2tail(e(df_m),e(N)*e(r2))

/*C,D:estimate y series como el proceso ARCH-


M*/ arch y_m,archm arch(1)
predecir los residuos1,
residuos corrigiendo los
residuos1, lag(12)

8. Considere el proceso ARCH(2): Et-1(εt)2 = α0 + α1(εt-1)2 + α2(εt-2)2.


A. Supongamos que los residuos provienen del modelo yt = a0+a1yt-1+εt. Encuentra el
condicional y
variación incondicional de {yt} en términos de los parámetros a1, α0, α1, y α2.
Responde: Para encontrar la varianza condicional de {yt}, primero note que la media
condicional de yt es:
.
Et-1yt = Et-1(a0+a1yt-1+εt) = 1a0+a
t-1 y . La varianza condicional de
t {y } es:

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:

Var(yt) = E [yt-E(yt)]2 = E[εt + a1εt-1 + (a1)2εt-2 + (a1)3εt-3 + ... ]2


= σ2/[1 - (a1)2]

Dado que εt = v . α + α ε2 + α ε2 se deduce que (ε )2 = v2 [α +α (ε )2 + α (ε


t
1 t-1 2 t-2 t t 0 1 t-1 2 t-
2
2) ). Ya que Eεt = Evt = 0:

E(εt)2 = E (vt)2E[α0 + α1(εt-1)2+α2(εt-2)2]


= α0+α1 E(εt-1)2 + α2 E(εt-2)2

Dado que la variación incondicional de εt es idéntica a la de εt-1 y εt-2, la variación


incondicional es

E(εt)2 = α0 /(1-α1-α2)

de modo que la variación incondicional de yt es:


Var(yt) = ∑(a1)2iVar(εt-i) = α0 /[(1-α1-α2)(1-(a1)2)].


i=0

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.

Responde: Iterar hacia adelante desde las condiciones iniciales:


. 2 . 2
y1 = α0 + α1(ε0)2 + α2(ε-1)2 + ε1 = α0 + α1 0 + α2 0 + 1 = α0+1

. 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.

Programa de muestra para los usuarios de RATS

En lugar de programar la estimación de máxima probabilidad, esta sección ilustra el


procedimiento de GARCH.SRC. Puede descargar el procedimiento en
www.estima.com.

* 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)

*Crea las estadísticas de resumen


con la pestaña

* Crear el cambio logarítmico en el Índice Compuesto de la Bolsa de Valores de Nueva York


usando las dos instrucciones siguientes.
* Las variables resultantes se denominan tasa.
set x = compuesto; set rate = log(x)-log(x{1})

cor(qstats,number=24,span=4) rate ;* Obtener las estadísticas de ACF y Q de la tasa

* Para obtener las dos ecuaciones en (3.41) utilice


caja(constante,ma=1) tasa ;* Estimación del MA(1)
Página67 de la volatilidad
caja(constante,ma=2) tasa / residuos;* Estimar el MA(2) y guardar los residuos

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}

* GARCH.SRC estimará la mayoría de los modelos del tipo GARCH. Compila el


procedimiento usando la fuente (noecho) c:\winrats\garch.src

* Respectivamente, estimar los modelos MA(2)-GARCH(1,1) y el MA(1)-GARCH(1,1) con


@garch(mod=garch,ma=2,p=1,q=1,nointeractivo) rate
@garch(mod=garch,ma=1,p=1,q=1,nointeractivo) rate

* Estimar los modelos IGARCH y ARCH-M con


@garch(mod=igarch,ma=1,p=1,q=1,nogra,nointeractive) rate
@garch(mod=garch,ma=1,p=1,q=1,nointeractivo,aim,term=none,iters=200) rate

* 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

cor(qstats,number=24,span=4) nres;* Comprueba la correlación serial restante en nres


set n2 = nres*nres;* Cuadrar los residuos normalizados
lin n2 ; # constante n2{1 a 4} ;* Prueba de LM para los efectos restantes de ARCH en los
residuos

* 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 realizar la prueba de Engle-Ng, cree la función indicadora


set d1 = %if(nres<0,1.,0.) ;* d1 es 1 si el residuo estandarizado es negativo
lin n2 ; # constante d1{1} ;* retroceder n2 en el valor rezagado del
indicador

* 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

* Estimación del modelo EGARCH


Página69 de la volatilidad
@garch(mod=egarch,ma=1,p=1,q=1,nointeractivo) rate / nres cvar

Programa de muestra para los usuarios de STATA


claro

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*/

línea y_m obs /*producir el gráfico del proceso ARCH-M*/


/* estimar el proceso de MA(3,6) y almacenar los residuos en los nuevos residuos variables*/
set matsize 800 /*matsize está inicialmente establecido en 40 pero aquí requiere al menos
max(ar,ma+1)^2 o 49(max(0,6+1)^2). ver [R]matsize para más detalles*/
arima y_m,ma(3 6)
predecir
residuos,residuos corr
corr corr
corrido,lag(24) gen
ressq = resids^2 corr
corr corrido
ressq,lag(24)

/*realizar la prueba del multiplicador de Lagrange para los


errores del ARCH(4)*/ reg ressq l.ressq l2.ressq l3.ressq
l4.ressq
prueba l.ressq l2.ressq l3.ressq l4.ressq /*obtener el F-stat de la hipótesis nula de no errores
ARCH*/
mostrar " LM stat =" =e(N)*e(r2) / * u t i l i z a r los resultados guardados después de la
estimación para calcular las estadísticas de las pruebas*/
pantalla " El valor probable es: " =chi2tail(e(df_m),e(N)*e(r2))

/*C,D:estimate y series como el proceso ARCH-


M*/ arch y_m,archm arch(1)
predecir los residuos1,
residuos corrigiendo los
residuos1, lag(12)

10. Cada paso de la estimación se explica en el Manual de Programación.

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

Preguntas y ejercicios 230

Apéndice: El Bootstrap 234

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

Respuestas a las preguntas


1. Given an initial condition for y0, find the solution for yt. Also find the s-step-ahead forecast Etyt+s

A. yt = yt-1+ εt + 0.5 εt-1

Answer: Iterating from y0 forward:

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:

yt+s = yt + εt+s + 1.5(εt+s-1 + εt+s-2 +...+ εt+2 + εt+1) + 0.5 εt.


Página60 Modelos con
tendencia
The forecast function is: Et yt+s = yt + 0.5 εt

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

Answer: As in Part A, iterate forward to obtain:


y1 = 1.1 y0 + ε1,
y2 = 1.1 y1 + ε2 = 1.1 (1.1 y0+ε1) + ε2 = 1.12 y0 + ε2 + 1.1 ε1,
y3 = 1.1 y2 + ε3 = 1.1 (1.12 y0+ε2+1.1ε1) + ε3 = 1.13 y0 + ε3 + 1.1 ε2 + 1.12 ε1,
y4 = 1.1 y3 + ε4 = 1.1 (1.13 y0+ε3+1.1ε2+1.12ε1) + ε4 = 1.14 y0 + ε4
+ 1.1 ε3 + 1.12 ε2+1.13ε1,

yt = 1.1t y0 + εt + 1.1 εt-1 + 1.12εt-2 +...+ 1.1t-2ε2 + 1.1t-1 ε1.

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.

The forecast function is: Etyt+s = 1.1syt

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).

The solution for yt+s can be written as:

yt+s = yt+[(t+1)+(t+2)+...+(t+s)] + (εt+s+εt+s-1+...+εt+2+εt+1).

The forecast function is:


s(s +1)
Et yt+s = yt+(t+1)+(t+2)+...+(t+s) = yt + s.t +
2
Note that the change in yt is positively related to t. As such, the slope of the forecast
function is positively related to t.

E. yt = µt + ηt + 0.5ηt-1, where: µt = µt-1+εt


Answer: Given initial conditions for all stochastic terms:

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

yt+s = (yt-ηt-0.5ηt-1) + ∑ εt+i +ηt+s+0.5ηt+s-1.


i= 1

Hence, the forecast function is:


Etyt+1 = yt - 0.5ηt - 0.5ηt-1, s=1,
Etyt+s = yt - ηt - 0.5ηt-1, s > 1.
Página62 Modelos con
tendencia
Here yt is a random-walk plus a stationary component that is a MA(1) process.

F. yt = µt+ηt+0.5ηt-1, where µt = 0.5+µt-1+εt.


Answer:
y1 = µ1+η1+0.5η0 = 0.5+µ0+ε1 + η1+0.5η0,
y2 = µ2+η2+0.5η1 = (0.5+µ1+ε2) + η2+0.5η1 = µ0+0.5.2+ε2+ε1+η2+0.5η1,
y3 = µ3+η3+0.5η2 = (0.5+µ2+ε3) + η3+0.5η2 = µ0+0.5.3+ε3+ε2+ε1+η3+0.5η2,
y4 = µ4+η4+0.5η3 = (0.5+µ3+ε4) + η4+0.5η3
= µ0+0.5.4+ε4+ε3+ε2+ε1+η4+0.5η3,

t
.
yt = µ0+0.5 t + ∑ εi+ηt+0.5ηt-1.
i= 1

In period zero, the y0 is: y0 = µ 0+η0+0.5η-1. For given values of µ0,η0 and η-1:

yt = (y0-η0-0.5η-1) + 0.5 t + ∑ εi+ηt+0.5ηt-1.


.
i= 1
Updating by s periods, the solution for yt+s can be written as:
s
.
yt+s = (yt-ηt-0.5ηt-1) + 0.5 s + ∑ εt+i+ηt+s+0.5ηt+s-1.
i= 1

Taking the conditional expectation, the forecast function is:

Et yt+s = yt - 0.5ηt - 0.5ηt-1 +0.5, s=1


Et yt+s = yt - ηt - 0.5ηt-1 + 0.5.s , s > 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.

G. How can you make the models of Parts B and D stationary?


Answer: For Part B, it is possible to subtract yt-1 from each side of yt = 1.1 yt-1 + εt to obtain:
∆yt = 0.1yt-1 + εt. To examine the properties of the {∆yt} sequence, add and subtract 0.1yt-2 to
the right-hand side to obtain ∆yt = 0.1∆yt-1 + 0.1yt-2 + εt. Now add and subtract 0.1yt-3 to
obtain: ∆yt = 0.1∆yt-1 + 0.1∆yt-2 + 0.1yt-3 + εt. Continuing in this fashion yields ∆yt = 0.1(∆yt-1
+ ∆yt-2 + ∆yt-3 + ... ) + εt. Obviously, the first differences are not stationary.

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.

The {∆yt} sequence is stationary as:

E(∆yt) = 0, Var(∆yt) = σ2 + 1.5ση2, and all autocorrelations are constant.

The first order autocorrelation of ∆yt is:


2 2 2
ρ1 = Cov(∆yt,∆yt-1) / [ Var (∆ y t ) Var (∆ y t-1) ] = -0.25σ η / (σ +1.5ση )

The second order autocorrelation of ∆yt is:


2 2 2
ρ2 = Cov(∆yt,∆yt-2) /[ Var (∆ y t ) Var (∆ y t- 2) ] = -0.5ση / (σ +1.5ση )

The third order autocorrelation of ∆yt is:

ρ3 = Cov(∆yt,∆yt-3) /[ Var (∆ y t ) Var (∆ y t-3) ] = -0 / (σ2 +1.5σ2η) = 0


and: ρ4 = ρ5 = ... = 0.

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

Since y0 = µ0+v0 = µ0+η0+β1η-1, it follows that:


t
Página64 Modelos con
tendencia
yt = (y0-v0) + ∑ ε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

yt+s = yt-ηt-β1ηt-1 + ∑ εt+i+ηt+s+ β1ηt+s-1


i= 1
If we take the conditional expectation, the forecast function is:
Etyt+s = yt-ηt-β1ηt-1+β1ηt for s=1 and Etyt+s
= yt-ηt-β1ηt-1, s≥2.

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.

C. Find the ARIMA representation of each model.


Answer: The first difference of the model from Part A is:

∆yt = εt + [1+(β1-1)L-β1L2]ηt.

Given that Eεtηt = 0, it follows that E(∆yt) = 0 and:


Var(∆yt) = σ2 + 2(β2 -β +1)σ2 , where σ2 ≡ Var(ε ), σ2 ≡ Var(η ).
1 1 η t η t

The first order autocorrelation of ∆yt is:


.
ρ1 = Cov(∆yt,∆yt-1) / [ Var (∆ y t ) Var (∆ y t-1) ]

= -(1-β1)2σ2η / [σ2+2(β2 -β +1)σ2 ]


1 1 η

The second order autocorrelation of ∆yt is:


ρ2 = -β1σ2η / [σ2+2(β2 -β +1)σ2 ]
1 1 η

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.

Given that Eεtηt = σσηand E(∆yt) = 0,


Var(∆yt) = σ2+2(β2 -β +1)σ2 +2σσ , where σ2 ≡ Var(ε ), σ2 ≡ Var(η ).
1 1 η η t η t

The first order autocorrelation of ∆yt is:


ρ1 = [(β1-1)σση-(1-β1)2σ2η] /[σ2+2(β2 -β +1)σ2 +2σσ ]
1 1 η η

The second order autocorrelation of ∆yt is:


ρ2 = (-β1σση-β1σ2η) /[σ2+2(β2 -β +1)σ2 +2σσ ]
1 1 η η

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.

Programa de muestra para los


usuarios de STATA
claro
set seed 12 /*this is to make the results reproducible*/

/*A:an experiment of tossing a coin and a tetrahedron*/


set obs 100
/*the two functions generate random integers in the interval [1,2] and [1,4] respectively. So their
sum should be in [2,6]. The numbers are stored in the variable "num"*/
gen num = int(1+2*uniform()) + int(1+4*uniform())
table num

set obs 1000 /*do the experiment using 1000 replications*/

Página68 Modelos con


tendencia
gen num1=int(1+2*uniform())+int(1+4*uniform())
table num1

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*/

/*C:perform another Monte Carlo experiment*/


capture program drop mc2
program mc2,rclass
version 8.0
drop _all
set obs 100
gen a0=2
gen ep = invnorm(uniform())
gen time = _n
gen y = sum(a0) + sum(time) + sum(ep) /*y is generated using the equation y(t)=a0+y(t-
1)+a2*t+et where a0=2 and a2=1. To see the results using different values of a0 and a2, change
'gen a0=2' above to another value of a0 and change this line to gen y = sum(a0) + sum(a2*time) +
sum(ep)*/
tsset time
reg d.y l.y time
return scalar tdist2 = (_b[l.y]/_se[l.y])
end

simulate "mc2" tdist2 = r(tdist2), reps(2000)


summarize tdist2, detail
Página70 Modelos con
tendencia
/*D:replicate Dickey-Fuller Tau-statistic(no constant or time trend)*/
capture program drop mc3
program mc3,rclass
version 8.0
drop _all
set obs 100
gen ep = invnorm(uniform())
gen time = _n
gen y = sum(ep) /*y is generated using the equation y(t)=y(t-1)+ep*/
tsset time
reg d.y l.y,noconstant
return scalar tdist3 = (_b[l.y]/_se[l.y])
end

simulate "mc3" tdist3 = r(tdist3), reps(2000)


summarize tdist3, detail
sort tdist3
display tdist3[20] " " tdist3[50] " " tdist3[100] " " tdist3[200]

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.

Programa de muestra para los usuarios de RATS


calendar 1973 2 12;* Set the calendar for monthly data beginning allocate 1989:12
;* with 1973:2
open data a:\real.xls ;* It is assumed that the data is on drive a:\
data(format=xls,org=obs) /
table ;* Create the sample statistics of each series

;* The following steps can be repeated for each real exchange rate series.
dif rcan / drcan ;* Create the first-difference of the Canadian rate.

* Now find the ACF of rcan and drcan


cor rcan
cor drcan
* Notice the slow decay of the autocorrelations of rcan. This can be indicative of a unit root.

* Perform the Dickey-Fuller tests


lin drcan ; # constant rcan{1}
lin drcan ; ;* Now use 12 lags
# constant rcan{1} drcan{1 to 12}
* Since neither have a trend, use the τµ statistic

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

Programa de muestra para los


usuarios de STATA
claro
cd "x:\New_data" /*change this line to wherever the dataset is saved*/
insheet using real.txt
gen obs = _n
tsset obs /*declare this is a time series dataset*/

/*A:find the ACF and PACF*/


corrgram rcan,lag(12) /*ACF and PACF of the level of the real exchange rate*/
corrgram rger,lag(12)
corrgram rjap,lag(12)
corrgram ruk,lag(12)

/*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)

/*ACF and PACF of the detrended real exchange rate*/


reg rcan obs /*first regress the real exchange rate on trend*/
/*obtain the residual series, which is the detrended real exchange rate*/
predict residrcan,residuals
corrgram residrcan, lag(12)

reg rger obs


predict residrger,residuals
corrgram residrger, lag(12)

reg rjap obs


predict residrjap,residuals
corrgram residrjap, lag(12)

reg ruk obs


predict residruk,residuals
corrgram residruk, 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.

source(noecho) c:\winrats\myhegy.src;* Compile the procedure


* Now implement the procedure. The maximum number of lags in 8. The lag length is chosen by
* removing lags that are not significant that the 5% level.
@hegyqnew(signif=0.05,criterion=signlag,nlags=8) lm1

* Alternatively, you can make your own transformations as follows:


dif lm1 / dlm1 ;* Difference lm1
dif(sdiffs=1) lm1 / d4lm1 ;* Create the seasonal difference
set trend = t ;* Create a time trend
set y1 = lm1+lm1{1}+lm1{2}+lm1{3} ; Create y1t
set y2 = lm1-lm1{1}+lm1{2}-lm1{3} ;* Create y2t
set y3 = lm1 - lm1{2} ;* Create y3t

* 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.

Página74 Modelos con


tendencia
lin d4lm1
# constant trend y1{1} y2{1} y3{1} y3{2} d4lm1{1 to 2}

Program for STATA Users


claro
cd "x:\New_data" /*change this line to wherever the dataset is saved*/
insheet using quarterly.txt
gen time = q(1960q1)+_n-1 /*the dataset starts from 1960Q1*/
tsset time,format(%tq) /*declare this is a quarterly timeseries dataset*/

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.

RATS PROGRAM FOR PARTS A and B


The data set contains 100 simulated observations with a break occurring at t = 51. To
replicate the results in section 8, perform the following:

all 100;* These three lines read in the data set open data a:\break.xls
data(format=xls,org=obs)

set trend = t ;* Creates a time trend

* The graph of the series shown in Figure 4.10 was created using
graph 1 ; # y1

* The ACF is obtained using


cor(method=yule) 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

* Regress resids on its own first lag


linreg resids ; # resids{1}

Continuation for parts C through G


graph 1 ; # y2;* Create the graph of y2

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

* Regress resids on its first lag


lin resids ; # resids{1}

* 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)

* Regress y2 on a constant, a trend and d2 and save the residuals as resids


lin y2 / resids; # constant trend d2

* Regress resids on its first lag


lin resids ; # resids{1}

* 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

/*A:replicate the result of section 9*/


gen lgdp=ln(gdp)
/*estimate the logarithmic first difference of real gdp as an AR(2) process*/
reg d.lgdp l.(d.lgdp) l2.(d.lgdp)

dfuller lgdp,trend lags(2) regress /*replicate the result of (4.45)*/


dfuller lgdp,lags(2) regress/*replicate the result of (4.46)*/

/*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)

set time = t ; * Create a trend


set ly = log(gdp); * Create ly as the log of GDP
dif ly / dly ; * Create the first difference of ly

* You can estimate (4.42) using


Página77Modelos con
tendencia
lin dly; # constant time ly{1} dly{1 to 2}

Página78 Modelos con


tendencia
exc ; # time ly{1} ;* Test for the drift using the φ3 statistic
exc ; # constant time ly{1} ;* Test for the constant and trend using φ2

* Estimate the model without the trend


lin dly; # constant ly{1} dly{1 to 2}
exc ; # constant ly{1} ;* Test for the drift using the φ1 statistic

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

Programa de muestra para los usuarios de STATA


claro
cd "x:\New_data"
insheet using quarterly.txt
gen obs = _n
tsset obs

/*A:replicate the result of section 9*/


gen lgdp=ln(gdp)
/*estimate the logarithmic first difference of real gdp as an AR(2) process*/
reg d.lgdp l.(d.lgdp) l2.(d.lgdp)

dfuller lgdp,trend lags(2) regress /*replicate the result of (4.45)*/


dfuller lgdp,lags(2) regress/*replicate the result of (4.46)*/

/*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

*Now repeat for Canada


log canada / lx ; dif lx / dlx
do i = 8,1,-1
lin(noprint) dlx ; # dlx{1 to i} lx{1} constant
dis i %tstats(i) %beta(i+1) %tstats(i+1)
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

set aver = (australia+canada+france+germany+japan+netherlands+UK+US)/8

* 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

/*A:an experiment of tossing two tetrahedra*/


set obs 1000 /*there are 1000 trials of the experiment*/
gen num=int(1+4*uniform())+int(1+4*uniform())
table num

/*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

simulate "bias 0.2" discrep = r(discrep),reps(1000)


summarize discrep
simulate "bias 0.5" discrep = r(discrep),reps(1000)

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

/*C:Dickey-Fuller critical values(constant + time trend)*/


capture program drop dfcv
program dfcv,rclass
version 8.0
drop _all
set obs 100
gen ep = invnorm(uniform())
gen y = sum(ep)
gen time = _n
tsset time
reg d.y l.y time /*to obtain the DF critical values for a model with constant but no time
trend, just drop the time variable here*/
return scalar contime = (_b[l.y]/_se[l.y])
end

simulate "dfcv" contime = r(contime), reps(10000)


sort contime
/*show the critical values of the Tau(tau) statistic at 1%,2.5%,5%,10% significance levels*/
display contime[100] " " contime[250] " " contime[500] " " contime[1000]

/*D:power of the DF test(Constant but No Time Trend)*/


capture program drop power
program define power,rclass
version 8.0
args alpha1
drop _all
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())
scalar hits10=0
scalar hits5=0
scalar hits1=0
local i=1
while `i'<=100
Página82 Modelos{con
tendencia
replace y = `alpha1'*y[`i'] + sqrt(1-(`alpha1')^2)*ep[`i'+1] if (_n>`i')
local i=`i'+1
}
reg d.y l.y /*to obtain the power of the DF stat(Constant+Time Trend), just include
"time" variable in this regression*/
if abs( _b[l.y]/_se[l.y])>2.58 {
return scalar hits10 = hits10+1
}
if abs( _b[l.y]/_se[l.y])>2.89 {
return scalar hits5 = hits5+1
}
if abs( _b[l.y]/_se[l.y])>3.51 {
return scalar hits1 = hits1+1
}

end

simulate "power 0.8" hits10 = r(hits10) hits5 = r(hits5) hits1 = r(hits1),reps(1000)


summarize hits10
display " when alpha1=0.8,the power of the test(10% significance level) = "=r(N)
summarize hits5
display " when alpha1=0.8,the power of the test(5% significance level)= "=r(N)
summarize hits1
display " when alpha1=0.8,the power of the test(1% significance level)= "=r(N)

simulate "power 0.9" hits10 = r(hits10) hits5 = r(hits5) hits1 = r(hits1),reps(1000)


summarize hits10
display " when alpha1=0.9,the power of the test(10% significance level) = "=r(N)
summarize hits5
display " when alpha1=0.9,the power of the test(5% significance level)= "=r(N)
summarize hits1
display " when alpha1=0.9,the power of the test(1% significance level)= "=r(N)

simulate "power 0.95" hits10 = r(hits10) hits5 = r(hits5) hits1 = r(hits1),reps(1000)


summarize hits10
display " when alpha1=0.95,the power of the test(10% significance level) = "=r(N)
summarize hits5
display " when alpha1=0.95,the power of the test(5% significance level)= "=r(N)
summarize hits1
display " when alpha1=0.95,the power of the test(1% significance level)= "=r(N)

simulate "power 0.99" hits10 = r(hits10) hits5 = r(hits5) hits1 = r(hits1),reps(1000)


summarize hits10

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)

10. Section 7 of Chapter 4 of the Programming Manual contains a discussion of bootstrapping. In


particular, Program 4.14 provides an example of bootstrapping regression coefficients.
A. Use the data in MONEYDEM.XLS to estimate the logarithmic change in real GDP (dlrgdpt)
as an AR(2) process. You should obtain
dlrgdpt =0.005 + 0.0251dlrgdpt-1 + 0.136dlrgdpt-2 + εt
As shown in the program, construct the 95% confidence interval for the AR(2) coefficient
0.0136.
B. Follow the program to obtain the bootstrap 95% confidence interval for the coefficient.
C. How would you modify the program so as to obtain the bootstrap 95% confidence interval
for the AR(1) coefficient?
Programa de muestra para los usuarios de STATA
/*obtain the bootstrap 95% confidence interval for the AR(2) and AR(1) coefficients.*/
clear
cd "X:\New_data" /*Please change the directory to wherever the dataset is saved*/
insheet using money_dem.txt
gen obs = _n
tsset obs
gen lrgdp = ln(rgdp)
gen dlrgdp = d.lrgdp
reg dlrgdp l.dlrgdp l2.dlrgdp /*estimate dlrgdp as an AR(2) process*/
capture save moneydem,replace
predict resids, residuals
keep resids
/*"resids" is the series from which the bootstrapped residuals are drawn */
capture save resids,replace

scalar beta1hat = _b[L.dlrgdp]


scalar beta2hat = _b[L2.dlrgdp]
scalar beta0hat = _b[_cons]

capture program drop bsbeta


program define bsbeta,rclass
version 8.0
use resids,clear
Página84 Modelos con
tendencia
gen rn = 4 + int((_N-4+1)*uniform()) /*the first three observations of dlrgdp are missing
due to the first difference and the two lags of rgdp. Hence the sample is drawn in [4,_N] or
[4,169]*/
gen estar = resids[rn] /*obtain the bootstrapped residuals*/
merge using moneydem
tsset obs
scalar ii = 2 + int((_N-2)*uniform()) /*the first observation of dlrgdp is missing due to the
first difference of rgdp. Moreover, the upper bound should be _N-1 to ensure the second
initial value is not missing. Hence "ii" is drawn in [2,_N) or [2,169)*/
gen ystar = dlrgdp[ii]
replace ystar = dlrgdp[ii+1] if _n > 1
forvalues i = 1/167 {
replace ystar = beta1hat*ystar[`i'+1] + beta2hat*ystar[`i'] + beta0hat + estar[`i'] if _n>`i'+1
}
reg ystar l.ystar l2.ystar /*estimate the model using the bootstrapped sample*/
return scalar beta2star = _b[L2.ystar]
return scalar beta1star = _b[L.ystar]
end

set seed 2001


simulate "bsbeta" beta2star = r(beta2star) beta1star = r(beta1star),reps(1000)
summarize beta2star,detail
sort beta2star
display "90% confidence interval for beta2:" beta2star[50] " " beta2star[950]
display "95% confidence interval for beta2:" beta2star[25] " " beta2star[975]
display "95% confidence interval for beta2:" beta2star[5] " " beta2star[995]
/*obtain the bootstrap 95% confidence interval for the AR(1) coefficient*/
quietly summarize beta1star,detail
sort beta1star
display "95% confidence interval for beta2:" beta1star[25] " " beta1star[975]

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

Questions and Exercises 311

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.

Página81 Modelos de series temporales de


multiecuaciones
Figure 5.7: Two Impulse Response Functions
 yt   0.7 0.2   yt1   ut 
Model 1:         

 zt   0.2 0.7   zt1   vt 

Response to zt shock Response to yt shock

1 1

0.5 0.5

0 0
0 10 20 0 5 10 15 20
(a) (b)

 yt   0.7 0.2   yt1   ut 


Model 2:        

 zt   0.2 0.7   zt1   vt 

Response to zt shock Response to yt shock


1 1

0.25 0.25

Página82 Modelos de series temporales de


multiecuaciones
0.5
0 10 20 0.5 0 10 20
(c) (d)
Legend: Solid line = {yt} sequence Cross-hatch = {zt} sequence
Note: In all cases ut = 0.8vt + yt and vt = zt

Página83 Modelos de series temporales de


multiecuaciones
Respuestas a las preguntas
1. Consider three forms of the intervention variable:
pulse: z1 = 1 and all other zi = 0
pure jump: z1 = z2 = ... = 1 and all other zi = 0
prolonged impulse: z1 = 1; z2 = 0.75; z3 = 0.5; z4 = 0.25; and all other values of zi = 0

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:

yt = (zt + t)/(1 - 0.5L)


= (1 + 0.5L + 0.25L2 + 0.125L3 + ... )zt + t/(1 - 0.5L)

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

For the pure jump, z1 = z2 = ... = 1 and all other zi = 0 so that:


dy1/dz1 = 1; dy2/dz1 = 1 + 0.5; dy3/dz1 = 1 + 0.5 + 0.25; ... . Thus, for the pure jump:
dyt/dz1 = 1 + 0.5 + 0.52 + 0.53 + ... + 0.5t-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.

Explicitly solving for yt:

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)

For the pulse intervention: z1 = 1 and all other zi = 0. Hence:

Página84 Modelos de series temporales de


multiecuaciones
dy1/dz1 = 1, dy2/dz1 = -0.5, dy3/dz1 = (-0.5)2, ... . Thus, for t  1:
dyt/dz1 = (-0.5)t-1
For the pure jump: z1 = z2 = ... = 1. Hence:
dy1/dz1 = 1, dy2/dz1 = 1 + (-0.5), dy3/dz1 = 1 + (-0.5) + (-0.5)2, ... . Thus, for t  1:
dyt/dz1 = 1 + (-0.5) + (-0.5)2 + ... + (-0.5)t-1
For the prolonged impulse: z1 = 1; z2 = 0.75; z3 = 0.5; z4 = 0.25; and all other values of
zi = 0. Hence:

dy1/dz1 = 1, dy2/dz1 = 0.75 + (-0.5)  1, dy3/dz1 = 0.5 + 0.75  (-0.5)+ 1  (-0.5)2,


dy4/dz1 = 0.25 + 0.5  (-0.5) + 0.75 (-0.5)2 + 1 (-0.5)3,
dy5/dz1 = 0.25  (-0.5) + 0.5  (-0.5)2 + 0.75  (-0.5)3 + (-0.5)4, ... . So that, for all t  4:
dyt/dz1 = 0.25 (-0.5)t-4 + 0.5  (-0.5)t-3 + 0.75 (-0.5)t-2 + 1  (-0.5)t-1

iii) yt = 1.25yt-1 - 0.5yt-2 + zt + t


Answer:

iv) yt = yt-1 + zt + t
Answer: Write the solution for yt using (1-L)yt = zt + t, so that given y0:

yt = zt + zt-1 + zt-2 + zt-3 + ... + z1 + t + ... + 1 + y0

For the pulse, set z1 = 1 and all other zi = 0 so that:

dy1/dz1 = 1, dy2/dz1 = 1, dy3/dz1 = 1, ... so that for all t  1:


dyt/dz1 = 1
For the pure jump, set z1 = z2 = ... = 1 and all other zi = 0, so that:
dy1/dz1 = 1, dy2/dz1 = 2, dy3/dz1 = 3, ... . Hence, for all t  1:
dyt/dz1 = t
For the prolonged impulse set z1 = 1; z2 = 0.75; z3 = 0.5; z4 = 0.25; and all other values
of zi = 0 so that:

Página85 Modelos de series temporales de


multiecuaciones
dy1/dz1 = 1, dy2/dz1 = 0.75+1, dy3/dz1 = 0.5+0.75+1, dy4/dz1 = .25+0.5+0.75+1, ... and for all
t  4:
dyt/dz1 = 0.25+0.5+0.75+1
v) yt = 0.75yt-1 + 0.25yt-2 + zt + t
Answer: The time paths of the responses are given in the three figures below. The actual
coefficients are derived in Part B.

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:

yt = (zt + zt-1 + zt-2 + ... )/(1+0.25L)


= (1 - 0.25L + 0.252L2 - 0.253L3 + ... )zt + (1 - 0.25L + 0.252L2 - 0.253L3 + ... )zt-1
+ (1 - 0.25L + 0.252L2 - 0.253L3 + ... )zt-2 + ...
= zt + (1 - 0.25)zt-1 + (1 - 0.25 + 0.252)zt-2 + (1 - 0.25 + 0.252 - 0.253)zt-3 + ...

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.

Página86 Modelos de series temporales de


multiecuaciones
To sketch the proof, abstract from the {t} sequence and consider the particular solution for
yt. Since there is a single unit root, all characteristic roots of A(L) lie outside the unit circle
and the expression A(L)yt is stationary. Now consider zt/(1-L) = zt + zt-1 + zt-2 + ... ; by
assumption this sum is zero. Beginning from a given value of y0, the long-run effects of {zt}
on A(L)yt (and on yt itself) must converge toward zero.

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 z1 = 1 and all other values of zi = 0:

dy1/dz1 = c0, dy2/dz1 = c0a1, dy3/dz1 = c0a1 2, and in general:


dy1+i/dz1 = c0a1i
B. Use equation (5.12) to trace out the effects of the {zt} sequence on the time paths of yt and yt.

Página87 Modelos de series temporales de


multiecuaciones
Answer: Recall that: yt = a1yt-1 + c0zt + t To trace out the effects of the {zt} sequence
on the time path of yt, let wt  yt, then write (2.10) as: wt = a1wt-1 + c0zt + t.

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 - yt-1 = a1(yt-1-yt-2) + c0zt + t, or


yt - (1+a1)yt-1 + a1yt-2 = c0zt + t, or
[1-(1+a1)L + a1L2]yt = c0zt + t.

The improper form of the solution for yt is:

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-yt-1 = a1(yt-1-yt-2) + c0(zt-zt-1) + t, or


yt-(1+a1)yt-1+a1yt-2 = c0(zt-zt-1) + t, or
[1-(1+a1)L+a1L2]yt = c0  (1-L)zt + t.

Solving for yt:

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:

dy1/dz1 = c0, dy2/dz1 = c0a1, dy3/dz1 = c0a 12, ... .

Next, to find the effects of the {zt} sequence on the time path of yt, rewrite (2.11) as:
yt = a1yt-1 + c0(1-L)zt + t.

Again, let yt  wt so that:

(1-a1L)wt = c0(1-L)zt + t.

Solving for wt (i.e., yt):

wt = c0(1-L)zt/(1-a1L) + t/(1-a1L) 3 i-1 i


2

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 = dyt+i/dzt = c0a 1i-1 (a1-1). Thus:

dyt+i/dzt = c0 a1 (a1-1).

Given that z1 = 1 and all other values of zi = 0, it follows that:

dy1/dz1 = c0, dy2/dz1 = c0(a1-1), dy3/dz1 = c0i-1


a1(a1-1),..., and:
dy1+i/dz1 = c0a1 (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).

Form the Yule-Walker equations by multiplying yt by each zt-i:


Página89 Modelos de series temporales de
multiecuaciones
2 2 i
ytzt = c0zt + c0a1zt-1zt + c0a1 zt-2zt +...+ c0a1 zt-izt +...+ tzt/(1-a1L)
2
z z +...+ c a iz z +...+  z /(1-a L)
ytzt-1 = c0ztzt-1 + c0a1zt-12 + c0a1 t-2 t-1 0 1 t-i t-1 t t-1 1
... 2
z z +...+ c a z +...+  z /(1-a L )
i 2

ytzt-i = c0ztzt-i + c0a1zt-1zt-i + c0a1 t-2 t-i 0 1 t-i t t-i 1

Página90 Modelos de series temporales de


multiecuaciones
...
Since {zt} and {t} are independent white noise disturbances, it follows that:

Eytzt = c0
Eytzt-1 = c0a1
...
Eytzt-i = c0a1i.

The cross-correlation between zt-i and yt is: i i


yz(i) = cov(yt,zt-i2)/(y2z) = c02a11/2/y12 = c0a1 /y ,
where: y = [(c0 +  )/(1-a1 )] ,  = var(t).

ii) Use (5.12) to derive the cross-correlogram between {zt} and {yt}.
Answer: Again, let wt  yt, so that:

wt = a1wt-1 + c0zt + t, or


wt = (c0zt + t)/(1-a1L) 2 i
= c0zt + c0a1zt-1 + c0a1 zt-2 +...+ c0a1 zt-i +...+ t/(1-a1L)

Form the Yule-Walker by multiplying yt by each zt-i and take expectations.


Since {zt} and {t} are independent:

Ewtzt = c0, Ewtzt-1 = c0a1, and in general, Ewtzt-i = c0a 1i.

Hence, the cross-correlogram between {zt} and {yt} is given by:


i i
yz(i)  cov (yt, zt-i)/(  ) = c0a21 /(
2 y 2z 1/2y
1) = c0a1 /y,
where: y = w = [(c0 +  )/(1-a1 )]

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.

In part C it was shown that:

Página91 Modelos de series temporales de


multiecuaciones
wt = c0zt + c0(a1-1)zt-1 + c0a1(a1-1)zt-2 +...+ c0a 1i-1 (a1-1)zt-i +...+ t/(1-a1L).

Forming the Yule-Walker equations and noting that {zt} and {t} are

Página92 Modelos de series temporales de


multiecuaciones
independent white noise disturbances, it follows that:

Ewtzt = Eytzt = c0
Ewtzt-1 = Eytzt-1 = c0(a1-1)
Ewtzt-2 = Eytzt-2 = c0a1(a1-1)
...
Ewtzt-i = Eytzt-i = c0a 1i-1 (a1-1).

Hence, for i = 0, yz(0) = c0/y and for i > 0, thei-1cross-correlations are:


yz(i)  cov(yt, zt-i)/(yz) = c0a1 (a1-1)/y , for i ≥1
2 2 2 1/2
where: y = W = [2c0 /(1+a1) +  /(1-a1 )]

(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 = a1yt-1 + c0zt + t. Since (1-L)zt = zt, it follows that:

yt = a1yt-1 + c0zt/(1-L) + t or letting wt = yt:


(1-a1L)wt = c0zt/(1-L) + t. Solve for wt to obtain:
wt = c0zt /[(1-L)(1-a1L)] + t/(1-a1L)

The form of the impulse responses is identical to that in part B. Hence:


i
dyt+i/dzt = c0  a1j
j=0

Case (2): yt = a1yt-1 + c0zt + t. Define wt = yt and note that zt = zt. Hence:

wt = a1wt-1 + c0zt + t .

Notice the same pattern as in the part A, so that:

dwt/dzt = dyt/dzt = c0 and for i > 0: i


dyt+i/dzt = c0a1

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:

Página94 Modelos de series temporales de


multiecuaciones
yft = [D(L)/E(L)]yt = (1-0.5L)yt
= 0.5  (1-0.5L)yt-1 + (1-0.5L)zt + (1-0.5L)t, so that:
yft = 0.5yft-1 + zt + (1-0.5L)t.

A simple way to obtain the cross-covariances is to multiply yft by the successive


values of zt-i. Since Etzt-i = 0 for all t and i, it follows that:

Eyftzt = 2z
Eyftzt-1 = 0.52z
Eyftzt-2 = 0.52 2z
Eyftzt-3 = 0.53 2z, so that in compact form:
Eyftzt-i = 0.5i 2z.

The cross-correlation between yft and zt-i is defined as:yz(i) = Cov(yft, zt-i)/(yfz).
Since Eyft = 0, Ezt = 0, and var(yft) = (1+0.52+0.54+0.56+...)2z + 2, it follows that yf = (4/3
2z + 2)1/2 . Hence, the cross-correlations between the filtered {yt} sequence and the {zt}
sequence are:

yz(i) = 0.5i 2z/[(4/3 2z + 2)1/2  z] or:


yz(i) = 0.5i  z/(4/3 2z + 2)1/2
B. Now suppose yt = 0.5 yt-1 + zt + 0.5 zt-1 + t and zt = 0.5 zt-1 + zt .Derive the cross-autocovariances
between the filtered {yt} sequence and zt. Show that the first two cross-autocovariances are
proportional to the transfer function coefficients. Show that the cross-covariances decay at the rate
0.5.
Answer: Since zt = 0.5 zt-1 + zt, we can write (1-0.5L) zt = zt. The filtered values of yt
sequence (i.e., yft) are: yft = (1-0.5L) yt. Hence:

yft = 0.5yft-1 + (1 + 0.5L)zt + (1 - 0.5L) t.

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:

(1-0.5L) yft = (1+0.5L) zt + (1-0.5L) t so that:

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.

Now multiply by the successive values of zt-i to obtain:

yftzt = ztzt + zt-1zt + 0.5zt-2zt + 0.52zt-3zt +...+ tzt

Página95 Modelos de series temporales de


multiecuaciones
yftzt-1 = ztzt-1 + zt-1zt-1 + 0.5zt-2zt-1 + 0.52zt-3zt-1 + 0.53 zt-4zt-1 +...+ tzt-1
yftzt-2 = ztzt-2 + zt-1zt-2 + 0.5 zt-2zt-2 + 0.52zt-3zt-2 + 0.53 zt-4zt-2 +...+ tzt-2 yft
zt-3 = ztzt-3 + zt-1zt-3 + 0.5 zt-2zt-3 + 0.52zt-3zt-3 + 0.53 zt-4zt-3 +...+ tzt-3
...
Now take the expected value of each of the above equations and note that {t} and
{zt} are independent white noise disturbances. It follows that:

Eyftzt = 2z ,
Eyftzt-1 = 2z ,
Eyftzt-2 = 0.5 2z ,
Eyftzt-3 = 0.52 2z
...
Eyftzt-i = 0.5i-1 2z 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:

yt = [(1-0.8L)e1t + 0.2e2t-1] /[(1-0.8L)(1-0.8L) - 0.04 L2].

Similarly, the solution for zt is:

zt = [0.2 e1 t-1 + (1-0.8L)e2t] /[(1-0.8L)(1-0.8L) - 0.04 L2].

A. Determine whether the {yt} sequence is stationary.


Answer: The inverse characteristic equation is: (1-0.8L)(1-0.8L) - 0.04 L2 = 0. The two
roots of the inverse characteristic equation are 1 and 5/3. Although one root (5/3) is outside
the unit circle, the other root (1) is on the unit circle, the sequence is not stationary.

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.80.6L2 + 0.80.62L3 + 0.80.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

Página97 Modelos de series temporales de


multiecuaciones
dyt+2/de1t = dyt/de1t-2 = 0.80.6 = 0.48; dyt+2/de2t = dyt/de2t-2 = 0.32
dyt+3/de1t = dyt/de1t-3 = 0.80.62 = 0.288; dyt+3/de2t = dyt/de2t-3 = 0.392
3
dyt+4/de1t = dyt/de1t-4 = 0.80.6 = 0.1728; dyt+4/de2t = dyt/de2t-4 = 0.4352
...
C. Suppose e1t = yt + 0.5 zt and e2t = 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 yt shocks are identical to those given in part B above. However,
in response to a one-unit shock in zt, yt changes by 0.5 units. Hence, the response to an zt
shock is equal to that reported in part B plus 0.5 times the effect of an yt shock on yt+i, i.e.,
dyt+1/dzt = (0.8/2 + 0.2) = 0.6, dyt+2/dzt = (0.48/2 + 0.32) = 0.56,
dyt+3/dzt = (0.288/2 + 0.392) = 0.536,
dyt+4/dzt = (0.1728/2 + 0.4352) = 0.5216

D. Suppose e1t = yt and that e2t = 0.5yt + 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.,

dyt+1/dyt = (0.8 + 0.2/2) = 0.9, dyt+2/dyt = (0.48 + 0.32/2) = 0.64


dyt+3/dyt = (0.288 + 0.392/2) = 0.484,
dyt+4/dyt = (0.1728 + 0.4352/2) = 0.3904

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

Página98 Modelos de series temporales de


multiecuaciones
3 0.8 0.2 0.68 0.32 0.608 0.392
A1 =   = 


0.2 0.8 0.32 0.68 0.392 0.608

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:

yt = [(1-0.1L)e1t + 0.2Le2t ]/[(1-0.8L)(1-0.1L) - 0.08 L2]


zt = [0.4Le1t + (1-0.8L)e2t ]/[(1-0.8L)(1-0.1L) - 0.08 L2]

Notice that the inverse characteristic equation has a single root; i.e.,

(1-0.8L)(1-0.1L) - 0.08 L2 = 1 - 0.9L

Hence, the solutions for yt and zt are:


yt = [(1-0.1L)e1t + 0.2Le2t ]/(1 - 0.9L)
zt = [0.4Le1t + (1-0.8L)e2t ]/(1 - 0.9L)
Since the root of the inverse characteristic equation is 10/9, the sequence is stationary.

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.80.9L2 + 0.80.92L3 + 0.80.93L4 +...) e1t
+ (0.2L + 0.20.9L2 + 0.20.92L3 + 0.20.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.80.9 = 0.72,dyt+2/de2t = dyt/de2t-2 = 0.20.9 = 0.18 dyt+3/de1t
= dyt/de1t-3 = 0.80.92 = 0.648,dyt+3/de2t = dyt/de2t-3 = 0.20.92 = 0.162 dyt+4/de1t =
dyt/de1t-4 = 0.80.93 = 0.5832,dyt+4/de2t = dyt/e2t-4 = 0.20.93 = 0.1458
...

Página100 Modelos de series temporales de


multiecuaciones
Part C. Suppose e1t = yt + 0.5zt and e2t = 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 effects of an yt are unchanged from the answer in part B. Here, the zt shock
induces a 0.5 change in e1t. Hence, the response to an zt shock is equal to that reported in part B
plus 0.5 times the effect of an e1t shock on yt+i:

dyt+1/dzt = (0.8/2 + 0.2) = 0.6, dyt+2/dzt = (0.72/2 + 0.18) = 0.54


dyt+3/dzt = (0.648/2 + 0.162) = 0.486
dyt+4/dzt = (0.5832/2 + 0.1458) = 0.4374, ....

Part D. Suppose e1t = yt and e2t = 0.5yt + 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/dyt = 0.9, dyt+2/dyt = 0.81, and in general:
dyt+i/dyt = dyt/dyt-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

3 0.72 0.18 0.8 0.2 0.648 0.162

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.

Página102 Modelos de series temporales de


multiecuaciones
C. How would the solution for yt change if a10 = 0.2?
Answer: The new solution for yt is:

yt = [0.18 + (1-0.1L)e1t + 0.2Le2t] /(1-0.9L)


= 1.8 + [(1-0.1L) e1t + 0.2Le2t ]/(1-0.9L)

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:

 var( 1) 0.0   1 b12   0.75 0.25   1 b21 

 =   


 0.0 var( 2)  1   0.5   1 


 b 21 0.25 b12

Carry out the indicated multiplication to obtain:

Var(1) = 0.75 + 0.5b12 + 0.5b212.


0= 0.25 + 0.5b12 + 0.75b21 + 0.25b12b21.
0= 0.25 + 0.5b12 + 0.75b21 + 0.25b12b21.
Var(2) = 0.5 + 0.5b21 + 0.75b221.

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:

Página104 Modelos de series temporales de


multiecuaciones
Var(2) = 0.5.
0= 0.25 + 0.5b12, so that: b12 = -1/2.
Var(1) = 0.75 + 0.5b12 + 0.5b212 , so that Var(1) = 5/8.

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:

Var(1) = 0.75 + 0.50.5 + 0.5(0.5)2 = 1.125.


0= 0.25 + 0.50.5 + 0.75b21 + 0.250.5b21, so that: b21 = -6/7.
Var(2) = 0.5 + 0.5b21 + 0.75b221 , so that Var(2) = 61/98.

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:

Var(2) = 0.5 + 0.50.5 + 0.75(0.5)2 = 0.9375.


0= 0.25 + 0.5b12 + 0.750.5 + 0.250.5b12 , so that: b12 = -1.
Var(1) = 0.75 + 0.5b12 + 0.5b212 , so that Var(1) = 0.75 + 0.5(-1) + 0.5(-1)2 = 0.75.

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 

 var( 1) 0.0   1 b12   2/3 - 2/3   1 b21 

 =  
Página105 Modelos de series temporales de
multiecuaciones
 

 0.0 var( 2)  1   - 2/3   1 
 b 21 2/3 b12

Carry out the indicated multiplication to obtain:

Var(1) = 2/3 - 4/3 b12 + 2/3 b2 12.


0= -2/3 + 2/3 b12 + 2/3 b21 - 2/3 b12b21.

Página106 Modelos de series temporales de


multiecuaciones
0= -2/3 + 2/3 b12 + 2/3 b21 - 2/3 b12b21.
Var(2) = 2/3 -4/3 b21 + 2/3 b2 21.

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:

1t = e1t and


2t = e1t + e2t .

Thus, the identified structural shocks are:


t 1t 2t
1 1.00.0
2 0.00.0
3 -1.00.0
If b21 = 0, we find

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:

1t = e1t + e2t and:


2t = e2t .

Thus, the identified structural shocks are:

t 1t 2t
1 0.0-1.0
2 0.00.0
3 0.01.0

If b12 = 0.5, you can use the same logic to find:


Página107 Modelos de series temporales de
multiecuaciones
t 1t 2t
1 0.50.0
2 0.00.0
3 -0.50.0

If b21 = 0.5, you should find:


t 1t 2t
1 0.0-0.5
2 0.00.0
3 0.00.5

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

* First estimate the VAR with 12 lags


system 1 to 2
vars gm1 inf
lags 1 to 12
det constant seasons{-2 to 0}
end(system)
estimate(outsigma=v,noprint,sigma) / 1

* 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}

Página109 Modelos de series temporales de


multiecuaciones
end(system)
estimate(noprint) / 3
* Perform the likelihood ratio test
ratio(degrees=16,mcorr=28) 63:2 *;* There are 16 degrees of freedom in that 4 lags of each
# 1 2;* variable are eliminated from each equation. Each
# 3 4;*equation in the 12-lag system has 28 regressors

* The test for 8 to 4 lags can be conducted using


system 1 to 2
vars gm1 inf
lags 1 to 8
det constant seasons{-2 to 0}
end(system)
estimate(noprint) / 1

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

*** To estimate the VAR in levels use


set m1 = log(m1nsa)
seasonal seasons
set lp = log(ppi)

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

Program for STATA Users


claro
cd "x:\New_data" /*change this line if the dataset is saved elsewhere*/
insheet using quarterly.txt
gen obs = _n
tsset obs /*declare this is a time series dataset*/
gen lm1nsa = ln(m1nsa)
gen lppi = ln(ppi)
gen mt = d.lm1nsa /*this is the rate of growth of the money supply*/
gen piet = d.lppi /*this is the inflation rate*/

/*generate three seasonal dummy variables*/


gen d1=0
quietly replace d1= 1 if match(descriptor,"*Q1")
gen d2=0
quietly replace d2= 1 if match(descriptor,"*Q2")
gen d3=0
quietly replace d3= 1 if match(descriptor,"*Q3")

/*B:estimate the VARs*/


set matsize 800
quietly var mt piet,lags(1/12) exog(d1 d2 d3)
scalar ldet12 = ln(e(detsig))
display ldet12
scalar numpar12 = e(tparms)/e(neqs)
quietly var mt piet in 14/169,lags(1/8) exog(d1 d2 d3)
scalar ldet8 = ln(e(detsig))
display ldet8 /*ii:estimate the VARs over the same period (1963Q2 - 2002Q1)using 12 and 8
lags respectively*/

/*iii:perform the likelihood ratio test for the null hypothesis of 8 lags*/
scalar lr8 = (e(T)-numpar12)*(ldet8-ldet12)
display "likelihood ratio = "= lr8

Página111 Modelos de series temporales de


multiecuaciones
display "the significance level of the likelihood ratio stat = "= chi2tail(e(neqs)*numpar12-
e(tparms), 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)

/*v:determine whether the seasonal dummy variables belong in the model*/


quietly var mt piet,lags(1/8)
scalar ldet80 = ln(e(detsig))
display ldet80
scalar lr80 = (e(T)-numpar8)*(ldet80-ldet88)
display "likelihood ratio = "= lr80
display "the significance level of the likelihood ratio stat = "= chi2tail(e(neqs)*numpar8-
e(tparms), lr80)

8. The results of the Granger causality tests are


F-Tests, Dependent Variable GM1
Variable F-Statistic Signif
GM1 13.5880 0.0000000
INF 2.7003 0.0085625

F-Tests, Dependent Variable INF


Variable F-Statistic Signif
GM1 1.5226 0.1544934
INF 13.8415 0.0000000

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.

Program for STATA Users


claro
cd "x:\New_data" /*change this line if the dataset is saved elsewhere*/
insheet using money_dem.txt
gen obs = _n
tsset obs
gen lrgdp = ln(rgdp)
gen dlrgdp = d.lrgdp
gen price = gdp/rgdp
gen lrm2 = ln(m2/price)
gen dlrm2 = d.lrm2
gen drs = d.tb3mo

/*A:estimate a VAR with 12 lags of dlrgdp,dlrm2 and drs*/


set matsize 800
var dlrgdp dlrm2 drs, lags(1/12)
scalar ldet12 = ln(e(detsig))
scalar numpar12 = e(tparms)/e(neqs)
/*the results from the following formula for AIC and SBC are different from those reported in
Stata*/
display "AIC ="= e(T)*ldet12 + 2*e(tparms)
display "SBC ="= e(T)*ldet12 + e(tparms)*ln(e(T))

var dlrgdp dlrm2 drs in 14/169, lags(1/8)


scalar ldet8 = ln(e(detsig))
display "AIC ="= e(T)*ldet8 + 2*e(tparms)
display "SBC ="= e(T)*ldet8 + e(tparms)*ln(e(T))

/*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

/*F:impulse response functions*/


varirf set results1
varirf create var1, order(dlrgdp dlrm2 drs) step(13) replace set(results1)
varirf ctable (var1 dlrgdp dlrgdp oirf) (var1 dlrgdp dlrm2 oirf) (var1 dlrgdp drs oirf) (var1
dlrm2 dlrgdp oirf) (var1 dlrm2 dlrm2 oirf) (var1 dlrm2 drs oirf) (var1 drs dlrgdp oirf) (var1
drs dlrm2 oirf) (var1 drs drs oirf),step(11) noci
varirf cgraph (var1 dlrgdp dlrgdp oirf) (var1 dlrm2 dlrgdp oirf) (var1 drs dlrgdp oirf) (var1
dlrgdp dlrm2 oirf) (var1 dlrm2 dlrm2 oirf) (var1 drs dlrm2 oirf) (var1 dlrgdp drs oirf) (var1
dlrm2 drs oirf) (var1 drs drs oirf),lstep(0) ustep(11) cilines

/*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 

 ert   001   rt 

Página114 Modelos de series temporales de


multiecuaciones
where: ey, emt and ert are the regression residual from the dlrgdpt, dlrm2t and drst equations,
and yt, mt and rt are the pure shocks (i.e., the structural innovations) to dlrgdpt, dlrm2t and

Página115 Modelos de series temporales de


multiecuaciones
drst, respectively.
A. Provide a plausible economic interpretation of this set of restrictions.
Answer: The first restriction indicates that real GDP has a contemporaneous effect on the
real money supply. The second indicates that real GDP is contemporaneously affected by all
variables in the system. The third indicates that only the interest rate shocks have a
contemporaneous effect on the interest rate. As it stands, this makes little economic sense.
The programming manual actually uses
 e   100    yt 
e  yt g   mt
mt 21 1g 23
     
 ert   001   rt 

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.

Programa de muestra para los usuarios de STATA


claro
cd "x:\New_data"
insheet using money_dem.txt
gen obs = _n
tsset obs
gen lrgdp = ln(rgdp)
gen dlrgdp = d.lrgdp
gen price = gdp/rgdp
gen lrm2 = ln(m2/price)
gen dlrm2 = d.lrm2
gen drs = d.tb3mo

set matsize 800


matrix A = (1,0,0\.,1,.\0,0,1) /*define the matrix that shows the contemporaneous
relationships among the variables*/
svar dlrgdp dlrm2 drs, aeq(A) lags(1/12)
varirf set results1
varirf create var1,step(11) replace set(results1)
varirf ctable (var1 drs dlrgdp oirf) (var1 drs dlrm2 oirf) (var1 drs drs oirf),step(12) noci
varirf cgraph (var1 drs dlrgdp oirf) (var1 drs dlrm2 oirf) (var1 drs drs oirf),lstep(0)
ustep(11) cilines

Página116 Modelos de series temporales de


multiecuaciones
Página117 Modelos de series temporales de
multiecuaciones
CHAPTER 6
COINTEGRATION AND ERROR-CORRECTION
MODELS
1. Linear Combinations of Integrated Variables 319
2. Cointegration and Common Trends 325
3. Cointegration and Error Correction 328
4. Testing for Cointegration: The Engle–Granger Methodology335
5. Illustrating the Engle–Granger Methodology339
6. Cointegration and Purchasing Power Parity 344
7. Characteristic Roots, Rank, and Cointegration 347
8. Hypothesis Testing 354
9. Illustrating the Johansen Methodology362
10. General-to-Specific Modeling 366
11. Summary and Conclusions 372

Questions and Exercises 373

Appendix 6.1: Inference on a Cointegrating Vector 378


Appendix 6.2: Characteristic Roots, Stability, and Rank 381

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:

yt = 0.1 + yt-1 + yt


and:
zt = 0.2 + zt-1 + zt

where: yt and zt are independent white-noise disturbances.

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

Both sequences were simulated as independent unit root processes.


Each has a positive drift so that the two sequences tend to increase over time. The relationship is spurious.

Scatter Plot of the two Sequences The Spurious Relationship


15 20

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.

The non-stationary error


2

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.

The Stationary Error Process


1

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:

yt = yt-1 + t + yt - yt-1


zt = zt-1 + t + zt - zt-1

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.

Respuestas a las preguntas


1. Let equations (6.14) and (6.15) contain intercept terms such that:

yt = a10 + a11yt-1 + a12zt-1 + yt and zt = a20 + a21yt-1 + a22zt-1 + zt

A. Show that the solution for yt can be written as:

yt = [ (1 - a22L)yt + (1-a22)a10 + a12Lzt + a12a20] / [ (1 - a11L)(1 - a22L) - a12a21L2 ]

Answer: Use lag operators to rewrite the system as:

(1 - a11L)yt - a12Lzt = a10 + yt


-a21Lyt + (1-a22L)zt = a20 + zt

Now write the system in matrix form as:


(1 a11 L) a12 L   y t   a10 +  yt 

    =  

 a 21 L (1 a 22 L)  z t  a 20 +  zt 

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:

yt = -[a12a21/(1-a22)]yt-1 + a21zt-1 + yt + a10


zt = a21yt-1 - (1 - a22)zt-1 + zt + a20

Normalizing the cointegrating vector with respect to yt-1:

yt = y(yt-1 - zt-1) + yt + a10


zt = z(yt-1 - zt-1) + zt + a20

where: y = -a12a21/(1-a22); z = a21; and  = (1-a22)/a21.

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.

Programa de muestra para los usuarios de RATS


todos los 100
open data a:coint6.prn ;* The data disk is in drive a:\
data(format=prn,org=obs) / y z w
table ;* Produce summary statistics for y, z and w

set dy = y - y(t-1) ;* Take first-differences


set dz = z - z(t-1)
set dw = w - w(t-1)

linreg dy;* Perform Dickey-Fuller test


# constant y{1}
linreg dy;* Perform Augmented Dickey-Fuller test
# constant y{1} dy{1 to 4}

* 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

linreg y / residy ;* Estimate the long-run equilibrium relationship using y as


# constant z w;* the left-hand-side variable. Save the residuals as "residy"

set dresidy = residy - residy{1} ;* Obtain first-difference of the residuals


linreg dresidy ;* Perform the Dickey-Fuller test of the residuals
# residy{1}
linreg dresidy ;* Perform the Augmented Dickey-Fuller test
# residy{1} dresidy{1 to 4}
* Repeat the 7 lines above for z and w

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

errors(impulses) 3 24 vsigma ;* Perform innovation accounting using the error-correction


#1;#2;#3 ;* model

* 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:

lambda, lambda-max- and trace test


0.32496 0.13401 0.02536
38.51272 14.10061 2.51767
2.51767 16.61829 55.13101

Programa de muestra para los usuarios de STATA


claro
cd "x:\New_data" /*change this line if the dataset is saved elsewhere*/
insheet using coint6.txt
summarize y z w
gen obs = _n
tsset obs

/*A: reproduce the results in section 5*/


/*step 1: pretest the variables for their order of integration*/
reg d.y l.y /*D-F regression of unit root test(no lags)*/
reg d.z l.z
reg d.w l.w
reg d.y l.y l.(d.y) l2.(d.y) l3.(d.y) l4.(d.y) /*augmented D-F regression of unit root test(four
lags)*/
reg d.z l.z l.(d.z) l2.(d.z) l3.(d.z) l4.(d.z)
Página116Cointegración
reg d.w l.w l.(d.w) l2.(d.w) l3.(d.w) l4.(d.w)
/*Note:the command DFULLER is able to carry out all the estimations above as long as the
option 'regress' is included.*/

/*step 2: estimate the long-run equilibrium relationship*/


reg y z w
predict eyt,resid /*save the residuals to the series named eyt*/
reg z y w
predict ezt,resid
reg w y z
predict ewt,resid

/*check if eyt,ezt,ewt are stationary*/


reg d.eyt l.eyt
reg d.ezt l.ezt
reg d.ewt l.ewt
reg d.eyt l.eyt l.(d.eyt) l2.(d.eyt) l3.(d.eyt) l4.(d.eyt)
reg d.ezt l.ezt l.(d.ezt) l2.(d.ezt) l3.(d.ezt) l4.(d.ezt)
reg d.ewt l.ewt l.(d.ewt) l2.(d.ewt) l3.(d.ewt) l4.(d.ewt)

/*step 3: estimate the error-correction model*/


var d.y d.z d.w,lags(1) exog(l.ewt)

/*B: reproduce the results in section 9*/


/*Note: there are modules available to test for the number of cointegrating vectors in VARs
and estimate the vector error correction models after one or more cointegrating vectors have
been identified. They can be obtained by first searching "vector error correction model" in the
range "search all" and then installing the package called "VECECM"*/

johans y z w,lags(2) nonormal standard


johans y z w,lags(2) nonormal level(90)

/*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

log(ex_ca) = 4.12 + 0.937 log(p_ca) – 0.830log(p_us)

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.

C. A RATS program that can perform the indicated tests is

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)

* Next, take the log of each variable


log ex_g / lex_g ; log ex_ca / lex_ca ; log ex_j / lex_j
log p_g / lp_g ; log p_j / lp_j ; log p_ca / lp_ca ; log p_us / lp_us

* You should now test each for a unit root


* The long-run relationship for the Canadian-U.S. rate can be obtained using
lin lex_ca / resids ; # constant lp_ca lp_us

* Now, test the residuals for a unit root


dif resids / dr
lin dr ; # resids{1} dr{1 to 3}

* Similarly, PPP for the German-U.S. rate can be tested using


lin lex_g / resids ; # constant lp_g lp_us
dif resids / dr
lin dr ; # resids{1} dr{1 to 4}

Sample STATA Program


claro
cd "x:\New_data" /*change this line if the dataset is saved elsewhere*/

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)

/*test if long-run PPP theory holds between Canada and US*/


reg d.lex_ca l.lex_ca l.(d.lex_ca) l2.(d.lex_ca) l3.(d.lex_ca) /*check if lex_ca is stationary*/
reg d.lp_ca l.lp_ca l.(d.lp_ca) l2.(d.lp_ca) l3.(d.lp_ca) /*check if lp_ca is stationary*/
reg d.lp_us l.lp_us l.(d.lp_us) l2.(d.lp_us) l3.(d.lp_us) /*check if lp_us is stationary*/
reg lex_ca lp_ca lp_us
predict mu1,residuals
reg d.mu1 l.mu1 l.(d.mu1) l2.(d.mu1) l3.(d.mu1)

/* The other countries can be tested in the same way*/

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)

*To test each series for a unit root using dfunit.src


source(noecho) c:\winrats\dfunit.src
@dfunit(ttest,lags=12) tbill
@dfunit(ttest,lags=12) r3
@dfunit(ttest,lags=12) r10

* 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}

* Repeat using the 10-year rate as the ‘dependent’ variable


linreg r10 / resids10
# constant r3 tbill
dif resids10 / dresids10
lin dresids10 ; # resids10{1} dresids10{1 to 4} ; * Note the lag length of 4

* Note that some would use 12 lags


lin dresids10 ; # resids10{1} dresids10{1 to 12}

* To estimate the error-correction model you need to difference the variables


diff tbill / dtbill ; diff r3 / dr3 ; diff r10 / dr10

* 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

* The multivariate AIC and SBC are calculated using


compute aic = %nobs * %logdet + 2*(38*3)
compute sbc = %nobs * %logdet + 38*3*log(%nobs)
display 'aic = ' aic 'sbc = ' sbc

* Now use only 6 lags


system 1 to 3
variables dtbill dr3 dr10
lags 1 to 6
det constant resids{1} end(system)
estimate(noprint,noftests,outsigma=v) 1955:8 * 4

Programa de muestra para los usuarios de STATA


claro
cd "x:\New_data" /*change this line if the dataset is saved elsewhere*/
insheet using int_rates.txt

Página120Cointegración
gen obs = _n
tsset obs

/*A:examine whether the variables have unit roots*/


dfuller tbill,lags(12)
display "estimated alpha1 ="=_b[l.tbill]
display "AIC ="=e(N)*ln(e(rss))+2*e(df_m)
dfuller tbill,lags(11)
display "AIC ="=e(N)*ln(e(rss))+2*e(df_m)
dfuller tbill,lags(10)
display "AIC ="=e(N)*ln(e(rss))+2*e(df_m)
dfuller tbill,lags(9)
display "AIC ="=e(N)*ln(e(rss))+2*e(df_m) /*AIC is increasing as the lag length decreases*/
dfuller r3,lags(12)
display "estimated alpha1 ="=_b[l.r3]
dfuller r10,lags(12)
display "estimated alpha1 ="=_b[l.r10]

/*B:estimate the cointegrating relationships using the Engle-Granger procedure*/


reg tbill r3 r10
predict resid1,residuals
dfuller resid1,lags(9)
display "estimated coefficient: "=_b[l.resid1]

/*C:use r10 as the dependent variable to redo Part B*/


reg r10 tbill r3
predict resid2,residuals
dfuller resid2,lags(4)
display "estimated coefficient: "=_b[l.resid2]
dfuller resid2,lags(12)
display "estimated coefficient: "=_b[l.resid2]

/*D:estimate an error-correction model using 12 lags of each variable*/


set matsize 800
var d.tbill d.r3 d.r10,lags(1/12) exog(l.resid1) noconstant
varlmar,mlag(12) /*check if the disturbances are not autocorrelated using LM test*/
/*obtain the three residual series and determine whether they appear to be white noise*/
predict residtb,equation(#1) residuals
wntestb residtb,table
wntestq residtb
predict residr3,equation(#2) residuals
wntestb residr3,table
wntestq residr3

Página121Cointegración
predict residr10,equation(#3) residuals
wntestb residr10,table
wntestq residr10

/*E:estimate the model using Johansen procedure*/


/*Note: please install the package named "johans" first. It can be obtained by searching
"johans" in the range "all"*/
johans tbill r3 r10,lags(12) nonormal standard /*Case 1* is the appropriate table for critical
values in this model*/

5. Suppose you estimate  to be:

 0.6 - 0.5 0.2


 
 =  0.3 - 0.25 0.1
 
 1.2 -1.0 0.4 

A. Show that the determinant of  is zero.


Answer: Each element in row 1 is twice the corresponding element in row 2 (i.e., 1i = 22i)
and half the corresponding element in row 3 (i.e., 1i = 0.53i). Since one row can be
expressed as is a linear multiple of the another, the determinant must be zero.

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,

1 = 11/3 = 12/(-2.5) = 13/1 so that:


1 = 0.6/3 = -0.5/(-2.5) = 0.2/1 = 0.2.

Repeating for 2 and 3 yields:


1 = 0.2; 2 = 0.3/3 = 0.1; 3 = 1.2/3 = 0.4
Página122Cointegración
How would  change if you normalized  with respect to x1?

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

D. Describe how you could test the restriction 1 + 2 = 0.


Answer: The appropriate method is discussed on page 395 of the text. Using the notation in
the text, for r = 1 the appropriate test statistic is:
* *
T [ ln(1-  1 ) - ln(1- ̂ 1 ) ]

Now suppose you estimate  to be:


 0.8 0.4 0.0
 
 = 
 0.2 0.1 0.0
 

 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

F. Select  such that:


 0.8 0.75
 
 = 0.4 0.25
0.0 0.5 
 
Find the (3 × 2) matrix  such that  = '.
Answer: Here  is not normalized with respect to x1, x2 or x3. Nevertheless, it is possible to
find . Consider:
 10 

 = 0.250
 
 0 1 
Página124Cointegración
It is straightforward to verify  = '.

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:

x1t = x1t-1 + 1t and x2t = x2t-1 + 2t

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

x1t =   1t-i + x10 and x 2t =   2t-i + x20


i=0 i=0

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 = 11t +
22t, 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 + 22t-1 + ... + 222 + 2(x21 - x20) + x2t-2

Continue to iterate backwards to obtain:

x2t = 2t + 22t-1 + ... + 222 + 2(x21 - x20) + [2t-2 + 2t-3 + ... + 22 + (x21 - x20) + x2t-3]

= 2t + 22t-1 + 3t-3 + ... + 322 + 3(x21 - x20) + x2t-4

The solution is:


x2t =  2t + 2  2t -1 + 3  2t-2 + 4  2t-3 + ...+ (t - 1)  22 + t x 21 - (t - 1) x 20

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

x2t =   2t -i +   2t -i-1 +   2t-i-2 + ...+  22 + t x21 - (t - 1) x 20

i=0 i=0 i=0

Even if 1t and 2t are perfectly correlated, the linear combination of the two must
contain the following expression:
t -2 t -2

 2t -i-1 +  2t-i-2 + ...+  22


i=0 i=0

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

set seed 2002


simulate "coint 0.1 0.1 1" success = r(success) betahat = r(betahat),reps(2000) /*Note: If you
want to try another set of parameters, just change the three numbers in the double quotes,
which are alpha1,alpha2,beta1 respectively */
summarize betahat,detail
quietly summarize success
display "The percentage of success is:"=r(N)/20

/*B: The DF critical values of Engle-Granger(1987)*/


clear
capture program drop cicv
program define cicv,rclass
version 8.0
drop _all
set obs 100
gen time = _n

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

set seed 2002


simulate "cicv" tphi = r(tphi),reps(10000)
sort tphi
display tphi[9900] " " tphi[9500] " " tphi[9000]

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

tb1yrt = 0.698 + 0.0916tb3mot

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?

Programa de muestra para los usuarios de STATA


claro
cd "x:\New_data" /*change this line if the dataset is saved elsewhere*/
insheet using money_dem.txt
gen obs = _n
tsset obs

/*A:estimate the error-correction model using five lags of each variable*/


gen tb1yr1 = real(tb1yr) /*Note:tb1yr has been treated as a string variable because the first
two observations have been denoted by "NA". To perform all kinds of estimation on it, it has

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)

/*B:obtain the impulse response functions*/


quietly var tb1yr1 tb3mo,lags(1/6)
capture varirf set results1,replace
varirf create ecm,order(tb1yr1 tb3mo) step(24)
varirf ctable (ecm tb1yr1 tb1yr1 oirf) (ecm tb1yr1 tb3mo oirf) (ecm tb3mo tb1yr1 oirf) (ecm
tb3mo tb3mo oirf),step(24) noci
varirf ctable (ecm tb1yr1 tb1yr1 fevd) (ecm tb3mo tb1yr1 fevd) (ecm tb1yr1 tb3mo fevd)
(ecm tb3mo tb3mo fevd),step(24) noci
varirf ograph (ecm tb1yr1 tb1yr1 oirf) (ecm tb1yr1 tb3mo oirf)
varirf ograph (ecm tb3mo tb1yr1 oirf) (ecm tb3mo tb3mo oirf)

Página127
Cointegración
CHAPTER 7
NONLINEAR TIME-SERIES MODELS

1. Linear versus Nonlinear Adjustment 387


2. Simple Extensions of the ARMA Model 390
3. Threshold Autoregressive Models393
4. Extensions and Other Nonlinear Models399
5. Testing for Nonlinearity 406
6. Estimates of Regime Switching Models414
7. Generalized Impulse Responses and Forecasting 423
8. Unit Roots and Nonlinearity 429
9. Summary and Conclusions 434

Questions and Exercises 435

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 gt1  0
gt   
  2 g t1 if gt1  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 t1 if g t1  0.10

gt   0 if | gt 1 | 0.10

  gif g 0.10
 1 t1 t1

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)

2. Draw the phase diagram for each of the following processes


A. The GAR model: yt = 1.5yt-1 – 0.5 y 3t1 + t

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 2t1 ) ] + 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)

* The correlations of {yt} can be obtained using


cor(num=12,span=4,qstats) y

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 )

;* RATS users can also use the RESET.SRC procedure

* Now do the test using only ( ŷ t )2 and ( ŷ )3


lin resids ; # constant y{1} f2 f3 t

exc ; # f2 f3;* Again, you reject the null of linearity

*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}

* Now, multiply yt-1 by the powers of delay parameter.


set y1d = y{1}*delay
set y1d2 = y{1}*delay**2
set y1d3 = y{1}*delay**3

* Regress resids on a constant, yt-1, (yt-1)2, (yt-1)3, and (yt-1)4


lin resids ; # constant y{1} y1d y1d2 y1d3

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

* Use nonlinear least squares to estimate gamma given that c = 4.4


com c = 4.4
nonlin a0 a1 b0 b1 gamma ;* Instruct RATS to estimate 0, 1, 0 1 and  given c
* Next, create the LSTAR formula
frml lstar y = a0 + a1*y{1} + (b0 + b1*y{1})/(1+exp(-gamma*(y{1}-c)))
* Next are the initial guesses
com a0 = 1.2, a1 = .5, b0 = 1. , b1 = -0.8, gamma = 20.
nlls(frml=lstar,iterations=100) y 2 250

* 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 .

*/ E. If you estimate the process as a GAR process, you should find


2
yt = 2.03 + 0.389yt-1 + 0.201yt-2 - 0.147 yt1 + t
(8.97) (6.97)(3.48)(-10.57)
2
To estimate the GAR model, form the variable yt1
*/
set y2 = y{1}**2

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)

set y = 100*((indprod/indprod{1})-1) ; *Create the growth rate

* Estimate the growth rate as an AR(3) and save the residuals as resids
lin y / resids; # constant y{1 to 3 }

* Obtain the ACF of the residuals and the squared residuals


cor(number=24,span=4,qstats) resids
set r2 = resids**2
cor(number=24,span=4,qstats) r2

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)

* Multiply yt-1, yt-2 and yt-3 by flag


set plus1 = flag*y{1}
set plus2 = flag*y{2}
set plus3 = flag*y{3}

* Multiply yt-1, yt-2 and yt-3 by (1 - flag)


set minus = 1 - flag
set minus1 = (1-flag)*y{1}
set minus2 = (1-flag)*y{2}
set minus3 = (1-flag)*y{3}

* 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}

* Perform the RESET test

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.
*/

compute rss_test = 1000000.0


set rss = 0.
compute thresh = thresh_test(22)
/* Next, we begin the loop. For each value of i running from 22 to 124, we take the associated
value of thresh_test and use it as a potential threshold. Inside the DO loop, the program creates
the series flag. Note that flag =0 if spreadt-1 - thresh_test(i) [i.e., the potential threshold] is
negative. Otherwise, flag = 1. Also created are the series minus, spread_plus and spread_minus.
Hence, for each potential threshold, the LINREG instruction estimates a TAR equation in the
form of (7.27) and (7.29). The residual sum of squares is compared to rss_test. If the resulting
residual sum of squares exceeds this value, two instructions in brackets are not executed, the
value of i is incremented by 1 and the loop is repeated. However, if %rss is lower than rss_test
(i.e., if the residual sum of squares from the current regression is lower than any from the prior
regressions) the bracketed instructions are executed. The value of rss_test is replaced by the
value of %rss and the value of thresh is equated to the thresh_test (i.e., current value of the test
threshold). Once the loop is completed, thresh will hold the value of the threshold that yields the
lowest residual sum of squares.
*/
do i = 22,124
set flag = %if(spread{1}-thresh_test(i).le.0.,0,1)
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á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

* Now use thresh = -0.27, to estimate the model


set flag = %if(spread{1}-thresh.le.0.,0,1)
set minus = 1 - flag
set spread_plus = flag*(spread{1}-thresh)
set spread_minus = minus*(spread{1}-thresh)
lin ds
# spread_plus spread_minus ds{1}

exc ; # spread_plus spread_minus ;* The F-test for the restriction 1 = 2 = 0


restrict 1;* The test for 1 = 2
#12
# 1 -1 0

* 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

* For the M-TAR model, the loop is written using

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}

com rss(i) = %rss


if %rss < rss_test { compute
rss_test = %rss compute thresh
= thresh_test(i)
}

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}

* The nonlinear error-correction model is estimated using spread_plus and spread_minus as


* the error correction terms.

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 t1
2
+ t. Given yt = 1, find Etyt+1. Can you

find Etyt+2 and Etyt+3? [Hint: (Etyt+1)2  Et( y 2t1 )].

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 t1
2
) and Etyt+3 =

2
0.75Etyt+2 - 0.25Et( y t2 ). As discussed in Section 7, it is necessary to use numerical

integration to find the various values of Et( y 2 ).


tk

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.

2. www.research.stlouisfed.org/fred2/ The St. Louis Fed Database. With over 1000


downloadable economic variables, this is probably the best site for economic time-series
data.

3. www.nyse.com/marketinfo/marketinfo The New York Stock Exchange: The Data Library


contains daily volumes and closing prices for the major indices

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:

1. A statement of the objective of the paper

2. A brief description of the relevant literature including the equation(s) to be estimated

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

where: mt = money supply ( =money demand), yt = measure of income or output; rt = vector


of interest rates; pt = price index; t is a time-subscript; et is an error-term; and all variables
are measured in logarithms. Note that these variables are included on the data set
MONEY_DEM.XLS.

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:

TBILLt = β0 + β1R3t + β2R10t + et

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.

2. Difference equation models


This portion of the project is designed to familiarize students with the application of
difference equations to economic time-series data. Moreover, the initial data manipulation and
creation of simple time-series plots introduces the student to the software at an early stage in the
project. In this second portion of the paper, students should:

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.

3. Univariate properties of the variables


This portion of the project introduces the student to the tools used in estimating the univariate
properties of stationary time-series. Chapter 2 and Sections 1 through 7 of Chapter 3 provide the
necessary background material. The student should select two or three of the key variables and for
each:

1. Estimate an ARIMA model using the Box-Jenkins technique.

2. Provide out-of-sample forecasts. There should be some mention of the forecasting


performance of the models.

3. Determine whether there are any GARCH and/or ARCH-M effects.

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.

4. Estimates of the trend


Most students will select one or more variables that exhibit evidence of non-stationary
behavior. In this portion of the project, students should:

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.

2. Decompose the variables into their temporary and permanent components.

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.

Página139: Proyecto del


semestre
4. Potentially important seasonal effects and/or evidence of structural change should be
noted. If warranted, seasonal unit root tests and/or Perron tests for unit roots in the presence
of structural breaks should be conducted.

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.

5. Vector Autoregression Methods


This portion of the project introduces multiple time-series methods. Chapter 5 of the text
provides the background material necessary for the student to estimate a VAR. The student should
complete the following tasks:

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:

1. Conduct Engle-Granger and Johansen tests for cointegration

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:

1. Discuss a possible reason why a nonlinear specification might be plausible.

2. Conduct a number of tests that are capable of detecting nonlinearity.

3. Compare the linear estimates to the estimates from a nonlinear model.

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.

Página141: Proyecto del


semestre

También podría gustarte