filter_pca returns the first k principle components as filter values.

filter_pca(dat, k = 1, ...)

Arguments

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 cov.

Value

A matrix object of filter values.

Details

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.

Examples

tp_data = chicken_generator(1)
filter_pca(dat=tp_data[,-1])