The ICA Procedure
Getting Started: ICA Procedure
Note: Input data must be in a CAS table that is accessible in your CAS session. You must refer to this table by using a two-level name. The first level must be a CAS engine libref, and the second level must be the table name. For more information, see the sections Using CAS Sessions and CAS Engine Librefs and Loading a SAS Data Set onto a CAS Server in Chapter 3: Shared Concepts.
The following DATA step creates the mycas.sample data table, which provides simulated signal data, in your CAS session. The data for this example are the result of multiplying the source signal matrix and the mixing matrix ; that is, the data matrix . Figure 8.1 shows the original source signals. Figure 8.2 shows the observed mixtures of the source signals. The problem is to recover the original source signals (s1, s2, and s3) shown in Figure 8.1 only from the observed signal mixtures (x1, x2, and x3) shown in Figure 8.2.
data mycas.sample;
keep t x:;
array S[200,3]; /* S: source signals */
array A[3,3]; /* A: mixing matrix */
array x[3] x1-x3; /* X: mixed signals */
N = 200;
do i = 1 to 3;
do j = 1 to 3;
A[i,j] = 0.7*uniform(12345);
end;
end;
do i = 1 to N;
S[i,1] = cos(i/3);
S[i,2] = 0.4*((mod(i,23)-11)/7)**5;
S[i,3] = ((mod(i,29)-7)/11)-0.7;
end;
do i = 1 to N;
t = i;
do j = 1 to 3;
x[j] = 0;
do k = 1 to 3;
x[j] = x[j] + S[i,k]*A[k,j];
end;
end;
output;
end;
run;
Figure 8.1: Original Source Signals

Figure 8.2: Observed Signal Mixtures

These statements assume that your CAS engine libref is named mycas, but you can substitute any appropriately defined CAS engine libref.
The following statements invoke the ICA procedure, which requests the independent component analysis of the data, outputs the computed independent components to an output data table, and produces the tables in Figure 8.3 through Figure 8.6:
proc ica data=mycas.sample seed=345; var x1-x3; output out=mycas.scores component=c copyvar=t; run;
Figure 8.3 displays the "Model Information," "Dimensions," "Number of Observations," and "Centering and Scaling Information" tables.
The "Model Information" table identifies the data source and shows that the independent component extraction method is symmetric decorrelation, which is the default. The nonquadratic function is used in the approximation of negentropy, and the eigenvalue proportion threshold is set to 0; these are the defaults. The random number seed is set to 345. Random number generation is used to initialize the demixing matrix. Changing the random number seed value changes the initial demixing matrix, which yields a different estimated demixing matrix.
The "Dimensions" table indicates that there are three variables to be analyzed and three independent components to be computed. If you omit the N= option in the PROC ICA statement, the default is the number of numeric variables to be analyzed. The table also shows that there are three whitened variables and that three independent components are actually extracted.
The "Number of Observations" table shows that all 200 of the sample observations in the input data are used in the analysis; all the samples are used because they all contain complete data.
The "Centering and Scaling Information" table displays the centering and scaling information of the analysis variables.
Figure 8.3: Model Information, Dimensions, Number of Observations, and Centering and Scaling Information
Figure 8.4 displays the "Eigenvalues" table.
Figure 8.4: Eigenvalues Table
Figure 8.5 displays the "Whitening Transformation Matrix" and "Dewhitening Transformation Matrix" tables. In the whitening transformation matrix that is shown, the whitened variables are represented as a linear combination of the original variables that are centered and scaled. The dewhitening transformation matrix is the pseudoinverse of the whitening matrix.
Figure 8.5: Whitening and Dewhitening Transformation Matrices
Figure 8.6 displays the "Demixing Matrix" and "Mixing Matrix" tables. In the demixing matrix that is shown, the independent components are represented as a linear combination of the original variables that are standardized. The mixing matrix is the pseudoinverse of the demixing matrix.
Figure 8.6: Demixing and Mixing Matrices
Using the output data table mycas.scores and PROC SGPLOT or PROC SGRENDER (code not shown), you can plot the computed independent components. Figure 8.7 shows three independent components (c1, c2, and c3) that are the estimates of the three original source signals (s1, s2, and s3) in Figure 8.1. The original source signals are accurately estimated from the observed signal mixtures shown in Figure 8.2, up to multiplicative signed scalars. The order of the computed independent compontents cannot be determined in the independent component analysis model.
Figure 8.7: Estimated Source Signals
