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

 Original Source Signals


Figure 8.2: Observed Signal Mixtures

 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

The ICA Procedure

Model Information
Data SourceSAMPLE
Component Extraction MethodSymmetric Decorrelation
Negentropy Approximation FunctionLog-cosh
Eigenvalue Proportion Threshold0
Random Number Seed345

Dimensions
Number of Variables3
Number of Whitened Variables3
Number of Independent Components3
Number of Independent Components Extracted3

Number of Observations Read200
Number of Observations Used200

Centering and Scaling Information
VariableSubtracted offDivided by
x1-0.012310.32312
x2-0.046320.56436
x3-0.055670.89319


Figure 8.4 displays the "Eigenvalues" table.

Figure 8.4: Eigenvalues Table

Eigenvalues
 EigenvalueDifferenceProportionCumulative
12.6636282.3528350.88790.8879
20.3107930.2852150.10360.9915
30.025578 0.00851.0000


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

Whitening Transformation Matrix
VariableWhite1White2White3
x1-0.35446-1.016303.66902
x2-0.335411.440391.47348
x3-0.37052-0.33165-4.84386

Dewhitening Transformation Matrix
Whitened Variablex1x2x3
White1-0.94415-0.89341-0.98693
White2-0.315860.44766-0.10307
White30.093850.03769-0.12390


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

Demixing Matrix
VariableComp1Comp2Comp3
x12.514900.320782.86227
x2-0.434251.177231.66851
x3-2.44766-2.07527-3.66231

Mixing Matrix
Componentx1x2x3
Comp1-0.12351-0.69340-0.41244
Comp2-0.82569-0.32078-0.79147
Comp30.550430.645200.45108


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

 Estimated Source Signals


Last updated: December 21, 2018