Skip to contents

Perform independent component analysis after processing missing values

Usage

performICA(
  data,
  n.comp = min(5, ncol(data)),
  center = TRUE,
  scale. = FALSE,
  missingValues = round(0.05 * nrow(data)),
  alg.typ = c("parallel", "defaltion"),
  fun = c("logcosh", "exp"),
  alpha = 1,
  ...
)

Arguments

data

an optional data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).

n.comp

number of components to be extracted

center

a logical value indicating whether the variables should be shifted to be zero centered. Alternately, a vector of length equal the number of columns of x can be supplied. The value is passed to scale.

scale.

a logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. The default is FALSE for consistency with S, but in general scaling is advisable. Alternatively, a vector of length equal the number of columns of x can be supplied. The value is passed to scale.

missingValues

Integer: number of tolerated missing values per column to be replaced with the mean of the values of that same column

alg.typ

if alg.typ == "parallel" the components are extracted simultaneously (the default). if alg.typ == "deflation" the components are extracted one at a time.

fun

the functional form of the \(G\) function used in the approximation to neg-entropy (see ‘details’).

alpha

constant in range [1, 2] used in approximation to neg-entropy when fun == "logcosh"

...

Arguments passed on to fastICA::fastICA

Value

ICA result in a prcomp object

See also

Other functions to analyse independent components: plotICA()

Examples

performICA(USArrests)
#> $X
#>                Murder Assault UrbanPop    Rape
#> Alabama         5.412   65.24    -7.54  -0.032
#> Alaska          2.212   92.24   -17.54  23.268
#> Arizona         0.312  123.24    14.46   9.768
#> Arkansas        1.012   19.24   -15.54  -1.732
#> California      1.212  105.24    25.46  19.368
#> Colorado        0.112   33.24    12.46  17.468
#> Connecticut    -4.488  -60.76    11.46 -10.132
#> Delaware       -1.888   67.24     6.46  -5.432
#> Florida         7.612  164.24    14.46  10.668
#> Georgia         9.612   40.24    -5.54   4.568
#> Hawaii         -2.488 -124.76    17.46  -1.032
#> Idaho          -5.188  -50.76   -11.54  -7.032
#> Illinois        2.612   78.24    17.46   2.768
#> Indiana        -0.588  -57.76    -0.54  -0.232
#> Iowa           -5.588 -114.76    -8.54  -9.932
#> Kansas         -1.788  -55.76     0.46  -3.232
#> Kentucky        1.912  -61.76   -13.54  -4.932
#> Louisiana       7.612   78.24     0.46   0.968
#> Maine          -5.688  -87.76   -14.54 -13.432
#> Maryland        3.512  129.24     1.46   6.568
#> Massachusetts  -3.388  -21.76    19.46  -4.932
#> Michigan        4.312   84.24     8.46  13.868
#> Minnesota      -5.088  -98.76     0.46  -6.332
#> Mississippi     8.312   88.24   -21.54  -4.132
#> Missouri        1.212    7.24     4.46   6.968
#> Montana        -1.788  -61.76   -12.54  -4.832
#> Nebraska       -3.488  -68.76    -3.54  -4.732
#> Nevada          4.412   81.24    15.46  24.768
#> New Hampshire  -5.688 -113.76    -9.54 -11.732
#> New Jersey     -0.388  -11.76    23.46  -2.432
#> New Mexico      3.612  114.24     4.46  10.868
#> New York        3.312   83.24    20.46   4.868
#> North Carolina  5.212  166.24   -20.54  -5.132
#> North Dakota   -6.988 -125.76   -21.54 -13.932
#> Ohio           -0.488  -50.76     9.46   0.168
#> Oklahoma       -1.188  -19.76     2.46  -1.232
#> Oregon         -2.888  -11.76     1.46   8.068
#> Pennsylvania   -1.488  -64.76     6.46  -6.332
#> Rhode Island   -4.388    3.24    21.46 -12.932
#> South Carolina  6.612  108.24   -17.54   1.268
#> South Dakota   -3.988  -84.76   -20.54  -8.432
#> Tennessee       5.412   17.24    -6.54   5.668
#> Texas           4.912   30.24    14.46   4.268
#> Utah           -4.588  -50.76    14.46   1.668
#> Vermont        -5.588 -122.76   -33.54 -10.032
#> Virginia        0.712  -14.76    -2.54  -0.532
#> Washington     -3.788  -25.76     7.46   4.968
#> West Virginia  -2.088  -89.76   -26.54 -11.932
#> Wisconsin      -5.188 -117.76     0.46 -10.432
#> Wyoming        -0.988   -9.76    -5.54  -5.632
#> attr(,"scaled:center")
#>        Murder       Assault      UrbanPop          Rape 
#> -2.842171e-16  9.094947e-15 -6.252776e-15  8.526513e-16 
#> 
#> $K
#>               [,1]         [,2]        [,3]        [,4]
#> [1,] -0.0005031233  0.003185718 -0.01243588 -0.40479570
#> [2,] -0.0120064074  0.004176394  0.01051799  0.01584251
#> [3,] -0.0005589971 -0.069430563  0.03121730 -0.02366681
#> [4,] -0.0009066803 -0.014266122 -0.15162666  0.02942629
#> 
#> $W
#>            [,1]        [,2]       [,3]        [,4]
#> [1,] -0.3642480  0.89690329 -0.1500031 -0.20096505
#> [2,]  0.2721558 -0.07515846  0.1575265 -0.94629162
#> [3,]  0.4469809  0.02701642 -0.8938551 -0.02239052
#> [4,]  0.7703653  0.43495495  0.3920556  0.25227741
#> 
#> $A
#>            [,1]      [,2]      [,3]      [,4]
#> [1,] -0.6824242  30.54129 -1.875761 -1.159542
#> [2,] -4.2253924 -73.99858 -2.439239 -5.466934
#> [3,]  0.1179279  12.15422 -2.796555  6.152781
#> [4,] -0.5074502  15.81066 13.712743  4.109253
#> 
#> $S
#>                        IC1          IC2         IC3         IC4
#> Alabama        -0.07491605 -1.177958532 -0.48578785 -0.86870872
#> Alaska          0.63861420 -0.460614729  3.82276260 -0.49407303
#> Arizona         1.85637643 -0.517730021  0.58532986  1.33570352
#> Arkansas        0.55237711 -0.196361001  0.33256085 -1.02480003
#> California      0.44838576 -0.572817431  1.32938981  2.08722194
#> Colorado       -0.42649740 -0.052159744  1.89281490  1.22704287
#> Connecticut     0.28754224  0.887174437 -1.31497621  0.76468932
#> Delaware        2.22042127 -0.007648265 -0.86935558  0.59616984
#> Florida         0.42228547 -1.962663927 -0.38736819  0.68413769
#> Georgia        -2.23374300 -1.792310578 -0.51420452 -1.13324108
#> Hawaii         -2.36037590  0.836217521 -0.53127633  0.99079298
#> Idaho           1.11063593  1.108721313  0.33480608 -0.42412904
#> Illinois        0.39175338 -0.826141182 -0.87868392  1.00070369
#> Indiana        -1.08503064  0.330308291  0.12100349 -0.10436750
#> Iowa           -0.12524135  1.389451779 -0.12405716 -0.41805281
#> Kansas         -0.53757851  0.503387833 -0.18695736  0.01142570
#> Kentucky       -1.43825421 -0.077380069 -0.30043002 -1.25917472
#> Louisiana      -0.71190273 -1.647272366 -1.05804627 -0.57263051
#> Maine           0.81974686  1.298693711 -0.34824494 -0.78820208
#> Maryland        1.43288027 -1.075017412  0.27111119  0.16653811
#> Massachusetts   0.37698834  0.548707731 -1.13572177  1.33667360
#> Michigan       -0.34490622 -1.008568938  0.90836352  0.57560958
#> Minnesota      -0.30666807  1.228042835 -0.11974016  0.18562252
#> Mississippi     0.04432376 -1.751877628 -0.85076588 -2.04986860
#> Missouri       -0.66262052 -0.201596199  0.61235445  0.32362771
#> Montana        -0.29559991  0.574032260  0.20996417 -0.80998360
#> Nebraska       -0.12632095  0.860738787  0.04717460 -0.11270349
#> Nevada         -1.13495215 -0.950008857  2.13964598  1.23953608
#> New Hampshire   0.03936384  1.391856288 -0.32297589 -0.50860085
#> New Jersey     -0.56142776 -0.018181798 -1.41381345  1.34245492
#> New Mexico      0.78686820 -1.009779414  0.74659407  0.40551879
#> New York        0.11129464 -0.965026532 -0.82494407  1.16736898
#> North Carolina  2.79912446 -1.521368190 -0.64508974 -1.51716695
#> North Dakota    0.56432488  1.706058168  0.13443643 -1.16271553
#> Ohio           -1.20892663  0.241493865 -0.32119250  0.50195436
#> Oklahoma       -0.06367592  0.264915653 -0.10765391  0.19585372
#> Oregon          0.22389902  0.622793710  1.53255203  0.56042687
#> Pennsylvania   -0.82121210  0.429243904 -0.96205978  0.23891483
#> Rhode Island    1.59705110  0.546952627 -2.26273385  1.41926205
#> South Carolina  0.67579851 -1.499509202 -0.02485206 -1.45846276
#> South Dakota    0.24373846  1.059121049  0.41264781 -1.19198351
#> Tennessee      -1.45119350 -0.944048419  0.32754860 -0.77656562
#> Texas          -1.41588125 -1.018253006 -0.82014811  0.51242799
#> Utah           -0.09973685  0.957355673  0.25880319  1.26392614
#> Vermont         0.27456968  1.538158101  1.06819295 -1.91688694
#> Virginia       -0.47186579 -0.061160072 -0.04897995 -0.27064365
#> Washington      0.20780511  0.780700954  0.93751832  0.90251312
#> West Virginia  -0.16127673  0.739215218 -0.08214961 -1.84274805
#> Wisconsin      -0.50143733  1.283252548 -0.68546685  0.05342747
#> Wyoming         0.49507257  0.188859260 -0.39789896 -0.38383535
#>