MAV · Laboratorios· Labs

Unidad A1 · Hechos estilizadosUnit A1 · Stylized facts

¿Cuánto del ciclo lo pone el filtro?How much of the cycle comes from the filter?

El ciclo económico no se observa: se estima separando una tendencia. Compara Hodrick–Prescott con la regresión de Hamilton (2018), cambia los parámetros y mira qué pasa en el último dato, justo donde se toman las decisiones de política. The business cycle is not observed; it is estimated by removing a trend. Compare Hodrick–Prescott with Hamilton's (2018) regression, change the parameters, and watch what happens at the latest observation, exactly where policy decisions are made.

Qué probarThings to try

  1. Sube λ de 1,600 a 129,600. La tendencia se vuelve más rígida y el «ciclo» absorbe movimientos de más largo plazo: la volatilidad del ciclo HP sube sin que cambie un solo dato.Raise λ from 1,600 to 129,600. The trend stiffens and the "cycle" absorbs longer swings: the volatility of the HP cycle rises without a single data point changing.
  2. Lleva la fecha de corte a 2008T3, antes de Lehman. Compara el ciclo HP que se veía entonces con el que se estima hoy para ese mismo trimestre. Esa diferencia es el sesgo de extremo.Move the cutoff to 2008Q3, before Lehman. Compare the HP cycle you would have seen then with today's estimate for the same quarter. That gap is the end-point bias.
  3. Cambia a México y busca 1995, 2009 y 2020. ¿Coinciden los dos filtros en el signo? ¿Y en la amplitud?Switch to Mexico and look at 1995, 2009 and 2020. Do the two filters agree on the sign? On the amplitude?
  4. Con Hamilton, cambia el horizonte h de 8 a 4 trimestres. Hamilton recomienda h = 8 para datos trimestrales: dos años, más que la mayoría de las recesiones.With Hamilton, change the horizon h from 8 to 4 quarters. Hamilton recommends h = 8 for quarterly data: two years, longer than most recessions.

La matemáticaThe math

Hodrick–Prescott

La tendencia \(\tau_t\) resuelveThe trend \(\tau_t\) solves

$$\min_{\{\tau_t\}} \sum_{t=1}^{T}(y_t-\tau_t)^2+\lambda\sum_{t=2}^{T-1}\big[(\tau_{t+1}-\tau_t)-(\tau_t-\tau_{t-1})\big]^2$$

La solución es lineal, \((I+\lambda K^\top K)\,\tau=y\), y usa datos futuros: al final de la muestra solo hay datos de un lado, y la estimación se revisa conforme llegan nuevos trimestres.The solution is linear, \((I+\lambda K^\top K)\,\tau=y\), and uses future data: at the end of the sample there is data on one side only, and the estimate is revised as new quarters arrive.

Hamilton (2018)

Regresión por MCO de \(y_{t+h}\) sobre una constante y los últimos \(p\) valores observados en \(t\):OLS regression of \(y_{t+h}\) on a constant and the last \(p\) values observed at \(t\):

$$y_{t+h}=\beta_0+\beta_1 y_t+\beta_2 y_{t-1}+\dots+\beta_p y_{t-p+1}+v_{t+h}$$

El ciclo es el residuo \(\hat v_{t+h}\): lo que no se podía prever con \(h\) trimestres de anticipación. No usa datos futuros, pero pierde las primeras \(h+p-1\) observaciones.The cycle is the residual \(\hat v_{t+h}\): what could not be forecast \(h\) quarters ahead. It uses no future data, but loses the first \(h+p-1\) observations.

Ciclo en tiempo realReal-time cycle

Para cada trimestre \(s\), el ciclo «en tiempo real» es el último valor del filtro aplicado solo a \(y_1,\dots,y_s\). El ciclo «final» usa toda la muestra. Aquí se usan los datos de hoy para todas las fechas, así que la diferencia mide solo el problema del extremo, no las revisiones de los datos.For each quarter \(s\), the "real-time" cycle is the last value of the filter applied to \(y_1,\dots,y_s\) only. The "final" cycle uses the whole sample. Today's data are used for every date, so the gap measures only the end-point problem, not data revisions.

Llévalo más lejosTake it further