Learn R Programming

nowcasting (version 0.0.90)

Bpanel: Balanced panel

Description

This function transforms the original time series to its stationary representation following the user specification. The monthly variables are agregated to represent quarterly quantities. The time series with more than 1/3 missings, i.e. NAs are deleted. The missings and outliers are corrected following the same method avaible in the replication files of Giannone et al. 2008. In the end the monthly series are aggregated to quarterly quantities following the Mariano and Murasawsa 2003.

We've made an important modifications on the outlier_correction function found in the above mentioned files: Here the median of an even-sized sample is calculated by the mean of the two most central values, rather than using the largest of those numbers. Because of this modification the results obtained with the original replication files are slightly different than those found here.

Usage

Bpanel(base = NULL, trans = NULL, k_ma = 3)

Arguments

base

A mts with the series to be transformed.

trans

data.frame or vector.

A data.frame with two columns, the first one is the name, and the second is the transformation to let the series become stationary.

A vector where each coordinate is the transformation of the correspondent coordinate in the mts of the previous argument. The transformation is specified as follow:

  • transf = 0: the original serie is preserved;

  • transf = 1: $$100*\frac{X_t - X_{t-1}}{X_{t-1}}$$

  • transf = 2: $$X_t - X_{t-1}$$

  • transf = 3: $$100*\frac{X_t - X_{t-12}}{X_{t-12}} - 100*\frac{X_{t-1} - X_{t-13}}{X_{t-13}}$$

k_ma

A numeric representing the degrre of the moving average correction.

References

Giannone, D., Reichlin, L., & Small, D. (2008). Nowcasting: The real-time informational content of macroeconomic data. Journal of Monetary Economics, 55(4), 665-676.<doi:10.1016/j.jmoneco.2008.05.010>

Mariano, R. S., & Murasawa, Y. (2003). A new coincident index of business cycles based on monthly and quarterly series. Journal of applied Econometrics, 18(4), 427-443.

Examples

Run this code
# NOT RUN {
# Example from database vintage:
Bpanel(vintage,rep(3,dim(vintage)[2]))
# }

Run the code above in your browser using DataLab