sparse_pca: Predict aggregate growth based on sparse PCA decomposition

Description Usage Arguments Value

View source: R/pca_functions.R

Description

A function that predicts an annual aggregate growth rate by using a PCA decomposition of individual growth rates, using a sparse PCA based on glmnet.

Usage

1
sparse_pca(X, W, pca = prcomp(X))

Arguments

X

A matrix of data

W

A matrix of weights

pca

The PCA decomposition of X

Value

A tbl of predictions of aggregate growth by year, using the number of common factors given by hatr


tweed1e/idiosyncratics documentation built on May 29, 2019, 10:51 a.m.