A function to estimate principal components.
data_reduction(Data, variables = NULL, ncomp, standardize = TRUE)data.frame: data frame of target variable, exogenous variables, and observed date (named 'date')
string: vector of variables to standardize, default is all but 'date' column
int: number of factors to create
boolean: normalize variables (mean zero, variance one) before estimating factors
data.frame with a date column and one column per forecast method selected