Learn R Programming

nowcasting (version 0.0.82)

nowcast: Nowcasting of a quarterly time serie using a dynamic factor.

Description

Estimate nowcasting and foreacasting for a quarterly time serie. The method is based on Giannone, Domenico, Lucrezia Reichlin, and David Small. "Nowcasting: The real-time informational content of macroeconomic data." Journal of Monetary Economics 55.4 (2008): 665-676.

Usage

nowcast(y, vintage, legend, q = 2, r = 2, p = 1)

Arguments

y

Quarterly time-series

vintage

A time series matrix (mts) representing the vintage of interest.

legend

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: $$latex1$$

  • transf = 2: $$latex2$$

  • transf = 3:$$latex3$$

q

Dynamic rank. Number of error terms. If not specified q = 2.

r

Static rank (r>=q), i.e. number of factors. If not specified r = 2.

p

AR order of factors. If not specified p = 1.

Value

A list containing two data.frame: prev contains the original serie, the estimation in the sample, the estimation out of the sample; fatores contains the common factors of vintage data set.

See Also

base_extraction

Examples

Run this code
# NOT RUN {
# GDP index at market prices at quarterly frequency
pib<-mestri(lag(base_extraction(22099),-2))

# Estimate the nowcasting based on dynamic factors extracted from vintage:
# 1 dynamic factor
# 1 static factor
# 1 autoregressive lag
now<-nowcast(y = pib,vintage = vintage,legend = rep(3,7),q = 1,r = 1,p = 1)
# nowcasting results
now$prev
# factor estimation
now$fatores

# Estimate the nowcasting based on dynamic factors extracted from vintage:
# 1 dynamic factor
# 1 static factor
# 2 autoregressive lag
now<-nowcast(y = pib,vintage = vintage,legend = rep(3,7),q = 1,r = 1,p = 2)
# nowcasting results
now$prev
# factor estimation
now$fatores

# Estimate the nowcasting based on dynamic factors extracted from vintage:
# 1 dynamic factor
# 2 static factor
# 1 autoregressive lag
# induce stationarity in first diference (transf = 2)
now<-nowcast(y = pib,vintage = vintage,legend = rep(3,7),q = 1,r = 2,p = 1)
ts.plot(now$prev,col=1:3)
# nowcasting results
now$prev
# factor estimation
now$fatores

# Estimate the nowcasting based on dynamic factors extracted from vintage:
# 2 dynamic factor
# 2 static factor
# 1 autoregressive lag
# induce stationarity in first diference (transf = 2)
now<-nowcast(y = pib,vintage = vintage,legend = rep(3,7),q = 2,r = 2,p = 1)
ts.plot(now$prev,col=1:3)
# nowcasting results
now$prev
# factor estimation
now$fatores

# }
# NOT RUN {
# GDP index at market prices
pib<-mestri(lag(base_extraction(22099),-2))

# Creating real time data base with the series:
# Exchange rate - Free - United States dollar (1);
# Interest rate - CDI (12);
# Vehicles production (1373);
# Credit Sales Index (1453);
# Retail sales (1455);
# Current economic conditions index (4394);
# Industrial production, general index (21859).
mybase<-base_extraction(c(1453,1455,4394,21859))
# }

Run the code above in your browser using DataLab