NNS.nowcast | R Documentation |
Wrapper function for NNS nowcasting method using the nonparametric vector autoregression NNS.VAR, and Federal Reserve Nowcasting variables.
NNS.nowcast(
h = 1,
additional.regressors = NULL,
additional.sources = NULL,
naive.weights = FALSE,
specific.regressors = NULL,
start.date = "2000-01-03",
keep.data = FALSE,
status = TRUE,
ncores = NULL
)
h |
integer; |
additional.regressors |
character; |
additional.sources |
character; |
naive.weights |
logical; |
specific.regressors |
integer; |
start.date |
character; |
keep.data |
logical; |
status |
logical; |
ncores |
integer; value specifying the number of cores to be used in the parallelized subroutine NNS.ARMA.optim. If NULL (default), the number of cores to be used is equal to the number of cores of the machine - 1. |
Returns the following matrices of forecasted variables:
"interpolated_and_extrapolated"
Returns a data.frame
of the linear interpolated and NNS.ARMA extrapolated values to replace NA
values in the original variables
argument. This is required for working with variables containing different frequencies, e.g. where NA
would be reported for intra-quarterly data when indexed with monthly periods.
"relevant_variables"
Returns the relevant variables from the dimension reduction step.
"univariate"
Returns the univariate NNS.ARMA forecasts.
"multivariate"
Returns the multi-variate NNS.reg forecasts.
"ensemble"
Returns the ensemble of both "univariate"
and "multivariate"
forecasts.
Specific regressors include:
PAYEMS
– Payroll Employment
JTSJOL
– Job Openings
CPIAUCSL
– Consumer Price Index
DGORDER
– Durable Goods Orders
RSAFS
– Retail Sales
UNRATE
– Unemployment Rate
HOUST
– Housing Starts
INDPRO
– Industrial Production
DSPIC96
– Personal Income
BOPTEXP
– Exports
BOPTIMP
– Imports
TTLCONS
– Construction Spending
IR
– Import Price Index
CPILFESL
– Core Consumer Price Index
PCEPILFE
– Core PCE Price Index
PCEPI
– PCE Price Index
PERMIT
– Building Permits
TCU
– Capacity Utilization Rate
BUSINV
– Business Inventories
ULCNFB
– Unit Labor Cost
IQ
– Export Price Index
GACDISA066MSFRBNY
– Empire State Mfg Index
GACDFSA066MSFRBPHI
– Philadelphia Fed Mfg Index
PCEC96
– Real Consumption Spending
GDPC1
– Real Gross Domestic Product
ICSA
– Weekly Unemployment Claims
DGS10
– 10-year Treasury rates
T10Y2Y
– 2-10 year Treasury rate spread
WALCL
– Total Assets
PALLFNFINDEXM
– Global Price Index of All Commodities
FEDFUNDS
– Federal Funds Effective Rate
PPIACO
– Producer Price Index All Commodities
CIVPART
– Labor Force Participation Rate
Fred Viole, OVVO Financial Systems
Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" (ISBN: 1490523995)
Viole, F. (2019) "Multi-variate Time-Series Forecasting: Nonparametric Vector Autoregression Using NNS" \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2139/ssrn.3489550")}
Viole, F. (2020) "NOWCASTING with NNS" \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2139/ssrn.3589816")}
## Not run:
## Interpolates / Extrapolates all variables to current month
NNS.nowcast(h = 0)
## Additional regressors and sources specified
NNS.nowcast(h = 0, additional.regressors = c("SPY", "USO"),
additional.sources = c("yahoo", "yahoo"))
### PREDICTION INTERVALS
## Store NNS.nowcast output
nns_estimates <- NNS.nowcast(h = 12)
# Create bootstrap replicates using NNS.meboot (GDP Variable)
gdp_replicates <- NNS.meboot(nns_estimates$ensemble$GDPC1,
rho = seq(0,1,.25),
reps = 100)["replicates",]
replicates <- do.call(cbind, gdp_replicates)
# Apply UPM.VaR and LPM.VaR for desired prediction interval...95 percent illustrated
# Tail percentage used in first argument per {LPM.VaR} and {UPM.VaR} functions
lower_GDP_CIs <- apply(replicates, 1, function(z) LPM.VaR(0.025, 0, z))
upper_GDP_CIs <- apply(replicates, 1, function(z) UPM.VaR(0.025, 0, z))
# View results
cbind(nns_estimates$ensemble$GDPC1, lower_GDP_CIs, upper_GDP_CIs)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.