A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/dhopp1/nowcastDFM below:

dhopp1/nowcastDFM: Dynamic factor models (DFM) in R. Easy estimation and new data contributions to changes in prediction.

Run dynamic factor models (DFM) in R. Adapted from Bok et al. 2017, MATLAB code. The package provides the ability to estimate a DFM model using the expectation–maximization method, obtain predictions from estimated models, and obtain the impact of new data releases on model predictions. On CRAN.

install.packages("nowcastDFM")`

If this does not work, you can install directly from Github with:

install.packages("devtools")
devtools::install_github("dhopp1/nowcastDFM")

Given data is a dataframe (not a tibble) with a date column and 4 columns for various seasonally adjusted growth rates of economic series with missing values of NA:

library(nowcastDFM)

# estimate a DFM with one block for all variables
output_dfm <- dfm(data) 

# estimate a DFM with two different blocks
blocks <- data.frame(block_1 = c(1,1,1,0), block_2 = c(0,0,1,1)) # defining two blocks
output_dfm <- dfm(data, blocks = blocks)

# get predictions from estimated DFM for the following 3 months
# new data is dataframe with same columns as data the model was trained on, but newer data
predictions <- predict_dfm(new_data, output_dfm, months_ahead = 3)

# get impact of new data on predictions for a particular variable and time period
# old_data and new_data are dataframes with same columns as the data the model was trained on, but with older and newer data
news <- gen_news(old_data, new_data, output_dfm, target_variable = "target_name", target_period = "2020-01-01")

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4