filter_pca
returns the first k principle components as filter values.
filter_pca(dat, k = 1, ...)
dat | A numeric dataset matrix, rach row represents a data point and each column represents a predictive variable. |
---|---|
k | A scaler deciding the number of principle components to be returned |
... | Optional arguments to |
A matrix object of filter values.
The PCA filter function is defined as \(f(x_i) = x_i^T\phi_{(1:k)}\), where \(\phi_{(1:k)}\) is the matrix of \(k\) eigenvectors associated with the \(k\) largest eigenvalues of \(cov(X)\), \(x_i\) is some data point and \(X\) is the data matrix.
tp_data = chicken_generator(1) filter_pca(dat=tp_data[,-1])