~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to contrib/mva/proc/pca.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)pca.prg   19.1 (ES0-DMD) 02/25/03 13:27:24
 
2
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!
 
4
!.IDENTIFICATION
 
5
!
 
6
!   PCA.PRG
 
7
!
 
8
!.AUTHOR
 
9
!
 
10
!   F. Murtagh, ST-ECF, Garching.      Version 1.0; 9 May 1986
 
11
!
 
12
!.PURPOSE
 
13
!
 
14
!   Execute PCARIF.EXE and PCACIF.EXE
 
15
!
 
16
!.KEYWORDS
 
17
!
 
18
!   Principal Components Analysis, Karhunen-Loeve expansion,
 
19
!   Multivariate statistics, Pattern recognition.
 
20
!
 
21
!.CALLING SEQUENCE
 
22
!
 
23
! @@ PCA  Input_table  Output_table  Analysis_option
 
24
!     Row_or_col._analysis  Ncols._Output_table  Outable_for_eigenvectors.
 
25
!
 
26
!.INPUT/OUTPUT
 
27
!
 
28
!   Input table name.
 
29
!   Output table name.
 
30
!   Analysis option (3 = PCA of correlation matrix, default; 2 = PCA of
 
31
!                  covariance matrix; 1 = PCA of sums of squares and
 
32
!                  cross-products matrix).
 
33
!   Row/column analysis (note that all results are detd., but that
 
34
!                  output is produced for either rows or columns
 
35
!                  (cf. so-called "Q-" or "R-mode" factor analysis).
 
36
!   Number of columns in output table (no. of principal components)
 
37
!                  Defaults to 3.
 
38
!   Eigenvectors output table name (defaults to none).
 
39
!
 
40
!-------------------------------------------------------------------
 
41
DEFINE/PARAM P1 ? TABLE "Enter input table"
 
42
DEFINE/PARAM P2 ? TABLE "Enter output table"
 
43
DEFINE/PARAM P3 3 NUMBER "analysis option" 1,3
 
44
DEFINE/PARAM P4 R CHAR   "analysis mode (R/C)"
 
45
DEFINE/PARAM P5 3 NUMBER "no. of PC (output table columns)"
 
46
DEFINE/PARAM P6 NO CHAR "output table with eigenvectors"
 
47
!
 
48
WRITE/KEYW INPUTI/I/1/1 'P3'
 
49
WRITE/KEYW RC/C/1/1     'P4'
 
50
WRITE/KEYW INPUTI/I/2/1 'P5'
 
51
WRITE/KEYW INPUTC/C/1/8 'P6'
 
52
!
 
53
IF P4(1:1) .EQ. "C" THEN
 
54
   RUN CON_EXE:PCACIF
 
55
ELSE
 
56
   RUN CON_EXE:PCARIF
 
57
ENDIF