# Potential Output and the Irish Output Gap

May 14, 2011
By

(This article was first published on TimeSeriesIreland » R, and kindly contributed to R-bloggers)

One prominent feature of early degree-level macroeconomics courses is the concept of ‘potential output’, which one could roughly define as the level of output (GDP) at which inflation is not ‘accelerating’. Potential output is of interest to macroeconomists when analysing the question of output gaps and macroeconomic stabilisation policies by governments, whether that be in a ‘boom’ or a recession. If a country has a positive output gap, we can say that the economy is operating above potential and inflationary pressures will build up, as factors of production begin to demand ever higher prices to be brought into use; and vice versa.

How one actually measures ‘the’ output gap is not quite as straightforward as the Principles of Economics texbooks let on, and there’s little agreement among economists as to what constitutes the ‘best’ measure of the output gap. Usually, output gap series provided by government statistical agencies arise from one of two estimation procedures: first, one could use a production function, e.g., $Y_t = A_t K_t^{\alpha} L_t^{\beta}$, to estimate the corresponding $Y^{*}$ from $A^{*}$, $(K^{*})^{\alpha}$, and $(L^{*})^{\beta}$. Second, one could use the estimated trend of the output series as implied by a filter or the residuals from a regression on time. In practice, the first method often utilises the second to build potential series for the labour component of the production function. I will focus on the second of these approaches, for now. I define the output gap as the log deviation from potential output; log deviations are more intuitive, as they roughly correspond to a percentage deviation from potential output.

The most commonly used method to estimate the trend in ouput is the Hodrick-Prescott (H-P) filter; here, we want to minimise the trend component, $\tau$, of a series Y: $\forall t \in [1,T]$,

$\min_{\{\tau_t\} } \sum_{t=1}^T (y_t - \tau_t)^2 + \lambda \sum_{t=3}^{T} (\Delta^2 \tau_{t} )^2$.

where $\Delta$ is the difference operator and $\lambda$ is a smoothing parameter; as $\lambda \to \infty$, the H-P corresponds to a linear trend model. For quarterly data, $\lambda = 1600$ is a commonly used value.

Another way to estimate the trend is with a regression of Y on a polynomial of time, e.g., $y_t = \alpha_0 + \alpha_1 t + \alpha_2 t^2 + \ldots + \alpha_p t^p + \epsilon_t$, $\epsilon_t \sim IID(0, \sigma_{\epsilon}^2)$. A linear trend model is simply a regression of the form $y_t = \alpha_0 + \alpha_1 t + \epsilon_t$; a quadratic trend model is $y_t = \alpha_0 + \alpha_1 t + \alpha_2 t^2 +\epsilon_t$; and so on.

To illustrate these techniques, I show what they imply for real and nominal gross domestic product (GDP) and gross national product (GNP). The two images below graph Irish nominal (first) and real (second) GDP and GNP from 1997 to 2010 (click to make them larger).

The two graphs below show output gaps for nominal and real GDP based on a H-P filter ($\lambda = 1600$), linear trend, quadratic trend, and cubic trend.

The final two graphs show output gaps for nominal and real GNP.

The gap implied by a simple linear trend is far greater in every case, while the gaps implied by quadratic trend, cubic trend, and the H-P filter are very similar.

Below is some R code for a function that will produce output gaps (as measured by a H-P filter, and linear, quadratic, and cubic time trends).

function(data,l=1600){
#h-p filter code from Farnsworth
hpfilterq <- function(x=data,lambda=l){
eye <- diag(length(x))
result <- solve(eye+lambda*crossprod(diff(eye,lag=1,d=2)),x)
return(result)
}
hpfiltered<-hpfilterq(data)
hpgap <- data - hpfiltered
#
t1<-1:length(data)
t2<-t1^2
t3<-t1^3
t1<-ts(t1)
t2<-ts(t2)
t3<-ts(t3)
#
datats<-ts(data)
myseries<-ts.union(datats,t1,t2,t3)
#
polynomial1 <- lm(datats ~ t1,data=myseries)
polynomial2 <- lm(datats ~ t1 + t2,data=myseries)
polynomial3 <- lm(datats ~ t1 + t2 + t3,data=myseries)
#
returndata<-data.frame(hpgap,polynomial1$residuals,polynomial2$residuals,polynomial3\$residuals)
colnames(returndata) <- c("H-P Gap", "Poly1","Poly2","Poly3")
return(returndata)
}


R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

Tags: , , ,