brybos: Bry-Boshan or Harding and Pagan

Description Usage Arguments Details Value References

View source: R/brybos.R

Description

Compute Bry-Boschan or Harding and Pagan turning points dating rules.

Usage

1
brybos(x, ilog, imcd, nma)

Arguments

x

A time series (seasonally adjusted).

ilog

1 for logs of data (multiplicative model)

imcd

Short-term MA for step IV: 0 = Let program decide based on MCD 3 = MA(3), 4 = MA(4), 5 = MA(5), 6 = MA(6)

nma

number of terms in MA filter for initial TP (BB use 12-term asymmetric)

ioutput

1 for full output, 0 otherwise

Details

Purpose: compute BB or HP turning points dating rules

Value

Dates for 'peaks' and 'troughs' in the yearmon format.

cal_ind_p = zeros(rows(cal),1); cal_ind_t = zeros(rows(cal),1); tmp_p = zeros(rows(cal),1); tmp_t = zeros(rows(cal),1); if sumc(bcp5) .> 0; cal_ind_p[bcp5]=ones(rows(bcp5),1); tmp_p[bcp5+1]=ones(rows(bcp5),1); endif; if sumc(bct5) .> 0; cal_ind_t[bct5]=ones(rows(bct5),1); tmp_t[bct5+1]=ones(rows(bct5),1); endif; rec_ind=zeros(rows(cal),1);

rec_ind=cumsumc(tmp_p-tmp_t); if bct5[1] .< bcp5[1]; rec_ind=1+cumsumc(tmp_p-tmp_t); endif;

References

D. Harding & A. Pagan (2002), "Dissecting the Cycle: a Methodological Investigation", Journal of Monetary Economics, n 49, pp. 365-381 G. Bry & C. Boschan (1971), "Cyclical Analysis of Time Series: Selected Procedures and Computer Programs", NBER Technical Paper 20


pgg1309/bcycle documentation built on Feb. 22, 2020, 12:23 a.m.