Performs functional PCA training. The fPca action implements the Functional Principal Component Analysis (FPCA) method. It is used to reduce the dimensionality of functional data (curves or time series) by transforming them into a set of principal component scores, while generating eigenvalues and eigenvectors that describe the variation in the data.
| Parameter | Description |
|---|---|
| display | Specifies a list of results tables to send to the client for display. Used to control the output appearing in the client. |
| eigenVal | Specifies the output data table in which to save the eigenvalue matrix. |
| eigenVec | Specifies the output data table in which to save the eigenvector matrix. |
| id | Specifies the variable(s) to use as the record identifier for the functional curves. |
| inputs | Specifies the variables to use in the analysis. These represent the measurements of the function across the domain. |
| nBins | Specifies the number of bins to use in binning functional curves. Default is -1. |
| output | Specifies the output data table in which to save the score values of the training data. Sub-parameters include 'casout' (table) and 'npc' (number of principal components). |
| outputTables | Lists the names of results tables to save as CAS tables on the server. |
| rankThreshold | Specifies the eigenvalue threshold to use in determining the covariance matrix rank. Default is 1E-08. |
| saveState | Specifies the output data table in which to save the state of eigenvector matrix for future scoring (Analytic Store). |
| table | Specifies the settings for the input table containing the functional data. |
Generates a dataset with 100 observations, each containing 50 measurement points (y1-y50) representing a curve.
| 1 | |
| 2 | DATA mycas.functional_data; |
| 3 | DO id = 1 to 100; |
| 4 | array y[50]; |
| 5 | DO i = 1 to 50; |
| 6 | y[i] = sin(i/5) + (id/50) + rannor(1)*0.1; |
| 7 | END; |
| 8 | OUTPUT; |
| 9 | END; |
| 10 | drop i; |
| 11 | |
| 12 | RUN; |
| 13 |
Performs FPCA on the variables y1 through y50, using 'id' as the identifier, and saves the scores to 'fpca_scores'.
| 1 | |
| 2 | PROC CAS; |
| 3 | fpca.fPca / TABLE={name="functional_data"} inputs={ "y1-y50" } id={"id"} OUTPUT={casout={name="fpca_scores", replace=true}, npc=3}; |
| 4 | |
| 5 | RUN; |
| 6 |
Performs FPCA with binning options, saves eigenvalues and eigenvectors tables, and exports the model state for future scoring.
| 1 | |
| 2 | PROC CAS; |
| 3 | fpca.fPca / TABLE={name="functional_data"} inputs="y1-y50" id={"id"} nBins=20 rankThreshold=1E-6 eigenVal={name="evals", replace=true} eigenVec={name="evecs", replace=true} saveState={name="fpca_store", replace=true} OUTPUT={casout={name="scores_detail", replace=true}, npc=5}; |
| 4 | |
| 5 | RUN; |
| 6 |