The ICA Procedure

Example 8.1 Extracting Independent Components with Dimension Reduction

This example demonstrates that applying dimension reduction in PROC ICA provides a better estimate of the independent components by using simulated data, compared to extracting the independent components without reducing the dimension of the data. The data that this example uses are from the Getting Started section, and an extra noise signal (x4) is added to the observed signal mixtures. The following DATA step generates the data:

data mycas.ex1data;
   keep t x:;
   array S[200,3];     /* S: source signals */
   array A[3,3];       /* A: mixing matrix */
   array x[4] x1-x4;   /* X: observed 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;
      x[4] = 0.1*uniform(67890);
      output;
   end;
run;

These statements assume that your CAS engine libref is named mycas, but you can substitute any appropriately defined CAS engine libref.

The following statements extract the independent components by using dimension reduction and output the computed independent components to an output data table:

proc ica data=mycas.ex1data eigthresh=0.004 noscale seed=345;
   var x1-x4;
   output out=mycas.scores1 component=c copyvar=t;
run;

Output 8.1.1 displays the PROC ICA output. The "Model Information" table shows that the eigenvalue proportion threshold is set to 0.004. The "Dimensions" table indicates that there are four variables to be analyzed and four independent components to be computed. It also shows that three whitened variables are generated by using whitening and three independent components are actually extracted, thanks to the use of dimension reduction.

Output 8.1.1: Results of Independent Component Analysis with Dimension Reduction

The ICA Procedure

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

Dimensions
Number of Variables4
Number of Whitened Variables3
Number of Independent Components4
Number of Independent Components Extracted3

Number of Observations Read200
Number of Observations Used200

Centering and Scaling Information
VariableSubtracted offDivided by
x1-0.012311.00000
x2-0.046321.00000
x3-0.055671.00000
x40.052241.00000

Eigenvalues
 EigenvalueDifferenceProportionCumulative
11.1299341.0450200.92510.9251
20.0849150.0790400.06950.9946
30.0058740.0051230.00480.9994
40.000752 0.00061.0000

Whitening Transformation Matrix
VariableWhite1White2White3
x1-0.266241.1265511.73306
x2-0.44684-2.965602.16685
x3-0.783871.30782-5.22151
x4-0.001240.047110.78387

Dewhitening Transformation Matrix
Whitened Variablex1x2x3x4
White1-0.30083-0.50490-0.88572-0.00140
White20.09566-0.251820.111050.00400
White30.068920.01273-0.030670.00460

Demixing Matrix
VariableComp1Comp2Comp3
x10.962857.753338.82969
x22.08133-0.767302.96125
x3-2.31137-2.73321-4.09587
x40.095400.508020.59118

Mixing Matrix
Componentx1x2x3x4
Comp1-0.26709-0.18133-0.70731-0.00299
Comp2-0.04024-0.39162-0.369220.00468
Comp30.177320.363670.401460.00289


You can produce a plot of the computed independent components by using the output data table mycas.scores1 and the SGRENDER procedure, as shown in the following statements:

proc template;
   define statgraph ScoresPanel;
      beginGraph;
         layout lattice / rows=3
                          columns=1
                          rowgutter=10
                          columndatarange=unionall
                          order=packed;

         columnaxes;
            columnaxis / label="t";
         endcolumnaxes;

         layout overlay / yaxisopts=
            (linearopts=(viewmin=-3 viewmax=3 tickvaluelist=(-3 0 3)));
            seriesplot x=t y=c1;
         endlayout;

         layout overlay / yaxisopts=
            (linearopts=(viewmin=-2 viewmax=2 tickvaluelist=(-2 0 2)));
            seriesplot x=t y=c2;
         endlayout;

         layout overlay / yaxisopts=
            (linearopts=(viewmin=-2 viewmax=2 tickvaluelist=(-2 0 2)));
            seriesplot x=t y=c3;
         endlayout;

         endlayout;
      endGraph;
   end;
run;

proc sgrender data=mycas.scores1 template=ScoresPanel;
run;

Output 8.1.2 displays the computed independent components. The original source signals (s1, s2, and s3) in Figure 8.1 are accurately estimated by the computed independent components (c1, c2, and c3) up to multiplicative signed scalars.

Output 8.1.2: Independent Components Computed with Dimension Reduction

 Independent Components Computed with Dimension Reduction


The following statements extract the independent components by using all dimensions of the input data (x1x4) and output the computed independent components to an output data table:

proc ica data=mycas.ex1data noscale seed=345;
   var x1-x4;
   output out=mycas.scores2 component=c copyvar=t;
run;

Output 8.1.3 displays the computed independent components by using the output data table mycas.scores2 and PROC SGRENDER (code not shown). The original source signals (s1, s2, and s3) in Figure 8.1 are closely estimated by the three computed independent components (c2, c3, and c4) up to multiplicative signed scalars. However, you can clearly see that the estimates are affected by the addition of the noise signal (x4) compared to the independent components that are computed using dimension reduction in Output 8.1.2. Because there are fewer independent components than analysis variables in the input data, the computed component c1 is the projection pursuit direction.

Output 8.1.3: Independent Components Computed with Full Dimensions

 Independent Components Computed with Full Dimensions


Last updated: December 21, 2018