*! version 1.0.1 21aug2026

Title

gvar tcdecomp -- Beveridge-Nelson trend/cycle decomposition

Syntax

gvar tcdecomp [, options]

options

variables(spec) which series to report. Default *:y.

restrict(varlist) variables whose deterministic trend is restricted to zero.

notrend no trend in the deterministic component for any variable.

residuals(string) eta (default) or zeta.

periods(#) reserved.

graph plot the cycles.

name(name) graph name.

nosummary suppress the table.

saving(name) save the cycles.

Description

gvar tcdecomp splits every series into a permanent component - the
long-run multiplier times the cumulated innovations, plus a deterministic
term - and a cyclical remainder.

Options

variables(spec) restricts which series are decomposed.

restrict(spec) and notrend control the deterministic treatment of
the permanent component. notrend omits the trend from the trend/cycle
split, which changes what "permanent" means and should be a deliberate choice.

residuals(eta|zeta) which residual is cumulated into the permanent
component. Default eta, the reduced-form residual.

This is source defect 1 and the option exists to reproduce it.
TCdecomp.m documents its third argument as the reduced-form residual and
builds its multiplier from H0\H(:,:,j), but gvar.m:3106 calls it with
zeta, the structural one. Cumulating zeta against a reduced-form
long-run multiplier leaves an I(1) term in the "cycle". Measured on the demo, ADF
over all 136 cycle series finds 136 of 136 stationary using eta against 103
of 136 using zeta. residuals(zeta) reproduces the Toolbox.

Note what cannot settle this: comparing the size of the two candidate cycles. In
TCdecomp the cycle is the OLS residual on [1, trend] and is therefore
orthogonal to the trend by construction under either residual. Only a
stationarity test discriminates.

periods(numlist) restricts the window shown.

graph, name(), saving() and nosummary as elsewhere.

Remarks

On residuals(). The Toolbox's own routine documents its input as the
reduced-form residual and builds its multiplier from the reduced-form lag
matrices, but the calling code passes the structural residual. Cumulating the
structural residual against a reduced-form multiplier leaves a unit root in
the "cycle": across all 136 series of the demo, ADF finds 136 of 136
stationary using eta and 103 of 136 using zeta. The default is
eta; zeta reproduces the Toolbox.

On restrict(). The Toolbox's own guidance for its demo is to restrict the
trend for inflation and for the short and long interest rates in every
country, which is restrict(Dp r lr).

Comparing the two residual choices by the size of the cycle will not
separate them. The cycle is the OLS residual on a constant and a trend, hence
orthogonal to the trend by construction under either. Only a stationarity test
discriminates.

Examples

. gvar tcdecomp, variables(usa:y euro:y china:y)
. gvar tcdecomp, variables(usa:Dp usa:r) restrict(Dp r lr)
. gvar tcdecomp, residuals(zeta)
. gvar tcdecomp, variables(*:y) graph

Stored results

gvar tcdecomp stores the following in r():

r(cycle) the cyclical component

r(permanent) the permanent component

r(permst) its stochastic part

r(permdt) its deterministic part

r(deviation) the check that cycle equals data minus permanent

r(residuals) which residual was cumulated

Source

Toolbox TCdecomp.m, TC_trend_restr.m.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane