A function to estimate principal components.

data_reduction(Data, variables = NULL, ncomp, standardize = TRUE)

Arguments

Data

data.frame: data frame of target variable, exogenous variables, and observed date (named 'date')

variables

string: vector of variables to standardize, default is all but 'date' column

ncomp

int: number of factors to create

standardize

boolean: normalize variables (mean zero, variance one) before estimating factors

Value

data.frame with a date column and one column per forecast method selected