3. 3
Pengamatan Peubah Ganda
- memerlukan
āsumberdayaā lebih,
dalam analisis
- informasi tumpang
tindih pada beberapa
peubah
4. 4
Apa itu Komponen Utama
ā¢ Merupakan kombinasi linear dari peubah yang
diamati ļ informasi yang terkandung pada KU
merupakan gabungan dari semua peubah
dengan bobot tertentu
ā¢ Kombinasi linear yang dipilih merupakan
kombinasi linear dengan ragam paling besar ļ
memuat informasi paling banyak
ā¢ Antar KU bersifat ortogonal ļ tidak berkorelasi
ļ informasi tidak tumpang tindih
5. 5
Analisis Komponen Utama
Gugus peubah asal
{X1, X2, ā¦, Xp}
Gugus KU
{KU1, KU2, ā¦, KUp}
Hanya dipilih k < p
KU saja, namun
mampu memuat
sebagian besar
informasi
6. 6
Ilustrasi Komponen Utama
Untuk menceritakan bagaimana wajah
pacar kita waktu SMA, tidak perlu
disebutkan hidungnya mancung, kulitnya
halus, rambutnya indah tergerai dan
sebagainya. Tapi cukup katakan āPacar
saya waktu SMA orangnya cantikā. Kata
ācantikā sudah mampu menggambarkan
uraian sebelumnya.
7. 7
Bentuk Komponen Utama
KU1 = a1x = a11x1 + ā¦ + a1pxp
Jika gugus peubah asal {X1, X2, ā¦, Xp}
memiliki matriks ragam peragam ļ maka
ragam dari komponen utama adalah
= a1āļa1 =
Tugas kita adalah bagaimana mendapatkan
vektor a1 sehingga ragam di atas
maksimum (vektor ini disebut vektor
ļ„ļ„ļ½ ļ½
p
i
p
j
ijjiaa
1 1
11 ļ³
2
1KUļ³
8. 8
Mendapatkan KU pertama
ā¢ Vektor a1 merupakan vektor ciri matriks ļ
yang berpadanan dengan akar ciri paling
besar.
ā¢ Kombinasi linear dari {X1, X2, ā¦, Xp} berupa
KU1 = a1x = a11x1 + ā¦ + a1pxp dikenal
sebagai KU pertama dan memiliki ragam
sebesar ļ¬1 = akar ciri terbesar
9. 9
KU kedua
ā¢ Bentuknya KU2 = a2x = a21x1 + ā¦ + a2pxp
ā¢ Mencari vektor a2 sehingga ragam dari
KU2 maksimum, dan KU2 tidak berorelasi
dengan KU1
ā¢ a2 tidak lain adalah vektor ciri yang
berpadanan dengan akar ciri terbesar
kedua dari matriks ļ.
10. 10
Komponen Utama
Misalkan ļ¬1 ļ³ ļ¬2 ļ³ ā¦ ļ³ ļ¬p > 0 adalah vektor ciri
yang berpadanan dengan vektor ciri a1, a2, ā¦, ap
dari matriks ļ, dan panjang dari setiap vektor itu
masing masing adalah 1, atau aiāai = 1 untuk i = 1,
2, ā¦, p. Maka KU1 = a1āx, KU2 = a2āx, ā¦, KUp = apāx
berturut-turut adalah komponen utama pertama,
kedua, ā¦, ke-p dari x. Lebih lanjut var(KU1) = ļ¬1,
var(KU2) = ļ¬2, ā¦, var(KUp) = ļ¬p, atau akar ciri dari
matriks ragam peragam ļ adalah ragam dari
komponen-komponen utama.
11. 11
Kontribusi setiap KU
ā¢ Ragam dari setiap KU sama dengan akar
ciri ļ, yaitu ļ¬i
ā¢ Total ragam peubah asal seluruhnya
adalah tr(ļ), dan ini sama dengan
penjumlahan dari seluruh akar ciri
ā¢ Jadi kontribusi setiap KU ke-j adalah
sebesar
ļ„ļ½
p
i i
j
1
ļ¬
ļ¬
12. 12
Interpretasi setiap KU
ā¢ Interpretasi setiap KU didasarkan pada
nilai pada vektor aj, karena nilai ini
berhubungan linear dengan korelasi
antara X dengan KU
ā¢ Informasi pada KU didominasi oleh
informasi X yang memiliki koefisien
besar.
13. 13
Permasalahan Umum dalam
AKU
ā¢ Penentuan KU
menggunakan
āmatriks ragam-
peragamā vs
āmatriks korelasiā
ā¢ Penentuan
banyaknya KU
14. 14
Menggunakan matriks korelasi atau
ragam peragam?
Secara umum ini adalah pertanyaan
yang sulit. Karena tidak ada hubungan
yang jelas antara akar ciri dan vektor
ciri matriks ragam peragam dengan
matriks korelasi, dan komponen utama
yang dihasilkan oleh keduanya bisa
sangat berbeda. Demikian juga dengan
berapa banyak komponen utama yang
digunakan.
15. 15
Menggunakan matriks korelasi atau
ragam peragam?
Perbedaan satuan pengukuran yang
umumnya berimplikasi pada perbedaan
keragaman peubah, menjadi salah satu
pertimbangan utama penggunaan matriks
korelasi. Meskipun ada juga beberapa
pendapat yang mengatakan gunakan selalu
matriks korelasi.
16. 16
Menggunakan matriks korelasi atau
ragam peragam?
Penggunaan matriks korelasi memang cukup
efektif kecuali pada dua hal.
Pertama, secara teori pengujian statistik terhadap
akar ciri dan vektor ciri matriks korelasi jauh
lebih rumit.
Kedua, dengan menggunakan matriks korelasi
kita memaksakan setiap peubah memiliki ragam
yang sama sehingga tujuan mendapatkan peubah
yang kontribusinya paling besar tidak tercapai.
17. 17
Penentuan Banyaknya KU
Metode 1
ā¢ didasarkan pada kumulatif proporsi keragaman
total yang mampu dijelaskan.
ā¢ Metode ini merupakan metode yang paling banyak
digunakan, dan bisa diterapkan pada penggunaan
matriks korelasi maupun matriks ragam peragam.
ā¢ Minimum persentase kergaman yang mampu
dijelaskan ditentukan terlebih dahulu, dan
selanjutnya banyaknya komponen yang paling
kecil hingga batas itu terpenuhi dijadikan sebagai
banyaknya komponen utama yang digunakan.
ā¢ Tidak ada patokan baku berapa batas minimum
tersebut, sebagian buku menyebutkan 70%, 80%,
bahkan ada yang 90%.
18. 18
Penentuan Banyaknya KU
Metode 2
ā¢ hanya bisa diterapkan pada penggunaan matriks
korelasi. Ketika menggunakan matriks ini, peubah
asal ditransformasi menjadi peubah yang memiliki
ragam sama yaitu satu.
ā¢ Pemilihan komponen utama didasarkan pada
ragam komponen utama, yang tidak lain adalah
akar ciri. Metode ini disarankan oleh Kaiser (1960)
yang berargumen bahwa jika peubah asal saling
bebas maka komponen utama tidak lain adalah
peubah asal, dan setiap komponen utama akan
memiliki ragam satu.
ā¢ Dengan cara ini, komponen yang berpadanan
dengan akar ciri kurang dari satu tidak digunakan.
19. 19
Penentuan Banyaknya KU
Metode 3
ā¢ penggunaan grafik yang disebut plot scree.
ā¢ Cara ini bisa digunakan ketika titik awalnya
matriks korelasi maupun ragam peragam.
ā¢ Plot scree merupakan plot antara akar ciri ļ¬k
dengan k.
ā¢ Dengan menggunakan metode ini, banyaknya
komponen utama yang dipilih, yaitu k, adalah jika
pada titik k tersebut plotnya curam ke kiri tapi
tidak curam di kanan. Ide yang ada di belakang
metode ini adalah bahwa banyaknya komponen
utama yang dipilih sedemikian rupa sehingga
selisih antara akar ciri yang berurutan sudah tidak
besar lagi. Interpretasi terhadap plot ini sangat
20. 20
Kegunaan Lain KU
ā¢ Plot skor KU dua
dimensi sebagai alat
awal diagnosis pada
analisis gerombol
ā¢ KU yang saling
bebas mengatasi
masalah
multikolinear dalam
analisis regresi
21. Data Reduction
ā¢ summarization of data with many (p)
variables by a smaller set of (k) derived
(synthetic, composite) variables.
n
p
A n
k
X
22. Data Reduction
ā¢ āResidualā variation is information in A
that is not retained in X
ā¢ balancing act between
ā clarity of representation, ease of
understanding
ā oversimplification: loss of important or
relevant information.
23. Principal Component Analysis
(PCA)
ā¢ probably the most widely-used and well-
known of the āstandardā multivariate
methods
ā¢ invented by Pearson (1901) and
Hotelling (1933)
ā¢ first applied in ecology by Goodall
(1954) under the name āfactor analysisā
(āprincipal factor analysisā is a synonym of PCA).
24. Principal Component Analysis
(PCA)
ā¢ takes a data matrix of n objects by p
variables, which may be correlated, and
summarizes it by uncorrelated axes
(principal components or principal axes)
that are linear combinations of the
original p variables
ā¢ the first k components display as much
as possible of the variation among
objects.
27. Geometric Rationale of PCA
ā¢ objective of PCA is to rigidly rotate the
axes of this p-dimensional space to new
positions (principal axes) that have the
following properties:
ā ordered such that principal axis 1 has the
highest variance, axis 2 has the next
highest variance, .... , and axis p has the
lowest variance
ā covariance among each pair of the principal
axes is zero (the principal axes are
uncorrelated).
28. 0
2
4
6
8
10
12
14
0 2 4 6 8 10 12 14 16 18 20
Variable X1
VariableX2
+
2D Example of PCA
ā¢ variables X1 and X2 have positive covariance & each
has a similar variance.
67.61 ļ½V 24.62 ļ½V 42.32,1 ļ½C
35.81 ļ½X
91.42 ļ½X
29. -6
-4
-2
0
2
4
6
8
-8 -6 -4 -2 0 2 4 6 8 10 12
Variable X1
VariableX2
Configuration is Centered
ā¢ each variable is adjusted to a mean of
zero (by subtracting the mean from each value).
30. -6
-4
-2
0
2
4
6
-8 -6 -4 -2 0 2 4 6 8 10 12
PC 1
PC2
Principal Components are Computed
ā¢ PC 1 has the highest possible variance (9.88)
ā¢ PC 2 has a variance of 3.03
ā¢ PC 1 and PC 2 have zero covariance.
31. The Dissimilarity Measure Used in PCA
is Euclidean Distance
ā¢ PCA uses Euclidean Distance calculated
from the p variables as the measure of
dissimilarity among the n objects
ā¢ PCA derives the best possible k
dimensional (k < p) representation of the
Euclidean distances among objects.
32. Generalization to p-dimensions
ā¢ In practice nobody uses PCA with only 2
variables
ā¢ The algebra for finding principal axes
readily generalizes to p variables
ā¢ PC 1 is the direction of maximum
variance in the p-dimensional cloud of
points
ā¢ PC 2 is in the direction of the next
highest variance, subject to the
constraint that it has zero covariance
with PC 1.
33. Generalization to p-dimensions
ā¢ PC 3 is in the direction of the next
highest variance, subject to the
constraint that it has zero covariance
with both PC 1 and PC 2
ā¢ and so on... up to PC p
34. -6
-4
-2
0
2
4
6
8
-8 -6 -4 -2 0 2 4 6 8 10 12
Variable X1
VariableX2
PC 1
PC 2
ā¢ each principal axis is a linear combination of the
original two variables
ā¢ PCj = ai1Y1 + ai2Y2 + ā¦ ainYn
ā¢ aijās are the coefficients for factor i, multiplied by
the measured value for variable j
35. -6
-4
-2
0
2
4
6
8
-8 -6 -4 -2 0 2 4 6 8 10 12
Variable X1
VariableX2
PC 1
PC 2
ā¢ PC axes are a rigid rotation of the original variables
ā¢ PC 1 is simultaneously the direction of maximum
variance and a least-squares āline of best fitā
(squared distances of points away from PC 1 are
minimized).
36. Generalization to p-dimensions
ā¢ if we take the first k principal components,
they define the k-dimensional āhyperplane of
best fitā to the point cloud
ā¢ of the total variance of all p variables:
ā PCs 1 to k represent the maximum possible proportion
of that variance that can be displayed in k
dimensions
ā i.e. the squared Euclidean distances among points
calculated from their coordinates on PCs 1 to k are
the best possible representation of their squared
Euclidean distances in the full p dimensions.
38. Covariance vs Correlation
ā¢ covariances between the standardized
variables are correlations
ā¢ after standardization, each variable has a
variance of 1.000
ā¢ correlations can be also calculated from
the variances and covariances:
ji
ij
ij
VV
C
r ļ½
Covariance of
variables i and j
Variance
of variable jVariance
of variable i
Correlation between
variables i and j
39. The Algebra of PCA
ā¢ first step is to calculate the cross-
products matrix of variances and
covariances (or correlations) among every
pair of the p variables
ā¢ square, symmetric matrix
ā¢ diagonals are the variances, off-diagonals
are the covariances.
X1 X2
X1
6.6707 3.4170
X2 3.4170 6.2384
X1 X2
X1
1.0000 0.5297
X2
0.5297 1.0000
Variance-covariance Matrix Correlation Matrix
40. The Algebra of PCA
ā¢ in matrix notation, this is computed as
ā¢ where X is the n x p data matrix, with
each variable centered (also standardized by SD
if using correlations).
X1 X2
X1
6.6707 3.4170
X2 3.4170 6.2384
X1 X2
X1
1.0000 0.5297
X2
0.5297 1.0000
Variance-covariance Matrix Correlation Matrix
XXS ļ¢ļ½
41. Manipulating Matrices
ā¢ transposing: could change the columns to
rows or the rows to columns
ā¢ multiplying matrices
ā must have the same number of columns in the
premultiplicand matrix as the number of rows
in the postmultiplicand matrix
X = 10 0 4
7 1 2
Xā = 10 7
0 1
4 2
42. The Algebra of PCA
ā¢ sum of the diagonals of the variance-
covariance matrix is called the trace
ā¢ it represents the total variance in the
data
ā¢ it is the mean squared Euclidean distance
between each object and the centroid in
p-dimensional space.
X1 X2
X1
6.6707 3.4170
X2 3.4170 6.2384
X1 X2
X1
1.0000 0.5297
X2
0.5297 1.0000
Trace = 12.9091 Trace = 2.0000
43. The Algebra of PCA
ā¢ finding the principal axes involves
eigenanalysis of the cross-products
matrix (S)
ā¢ the eigenvalues (latent roots) of S are
solutions (ļ¬) to the characteristic
equation
0IS ļ½ļļ¬
44. The Algebra of PCA
ā¢ the eigenvalues, ļ¬1, ļ¬2, ... ļ¬p are the
variances of the coordinates on each
principal component axis
ā¢ the sum of all p eigenvalues equals the
trace of S (the sum of the variances of
the original variables).
X1 X2
X1
6.6707 3.4170
X2
3.4170 6.2384
ļ¬1 = 9.8783
ļ¬2 = 3.0308
Note: ļ¬1+ļ¬2 =12.9091
Trace = 12.9091
45. The Algebra of PCA
ā¢ each eigenvector consists of p values
which represent the ācontributionā of
each variable to the principal component
axis
ā¢ eigenvectors are uncorrelated (orthogonal)
ā their cross-products are zero.
u1 u2
X1
0.7291 -0.6844
X2
0.6844 0.7291
Eigenvectors
0.7291*(-0.6844) + 0.6844*0.7291 = 0
46. The Algebra of PCA
ā¢ coordinates of each object i on the kth
principal axis, known as the scores on PC
k, are computed as
ā¢ where Z is the n x k matrix of PC scores,
X is the n x p centered data matrix and
U is the p x k matrix of eigenvectors.
pipkikikki xuxuxuz ļ«ļ«ļ«ļ½ ļ2211
47. The Algebra of PCA
ā¢ variance of the scores on each PC axis is
equal to the corresponding eigenvalue for
that axis
ā¢ the eigenvalue represents the variance
displayed (āexplainedā or āextractedā) by
the kth axis
ā¢ the sum of the first k eigenvalues is the
variance explained by the k-dimensional
ordination.
48. -6
-4
-2
0
2
4
6
-8 -6 -4 -2 0 2 4 6 8 10 12
PC 1
PC2ļ¬1 = 9.8783 ļ¬2 = 3.0308 Trace = 12.9091
PC 1 displays (āexplainsā)
9.8783/12.9091 = 76.5% of the total variance
49. The Algebra of PCA
ā¢ The cross-products matrix computed
among the p principal axes has a simple
form:
ā all off-diagonal values are zero (the principal
axes are uncorrelated)
ā the diagonal values are the eigenvalues.
PC1 PC2
PC1
9.8783 0.0000
PC2
0.0000 3.0308
Variance-covariance Matrix
of the PC axes
50. A more challenging example
ā¢ data from research on habitat definition
in the endangered Baw Baw frog
ā¢ 16 environmental and structural variables
measured at each of 124 sites
ā¢ correlation matrix used because variables
have different units
Philoria frosti
52. Interpreting Eigenvectors
ā¢ correlations
between variables
and the principal
axes are known
as loadings
ā¢ each element of
the eigenvectors
represents the
contribution of a
given variable to
a component
1 2 3
Altitude 0.3842 0.0659 -0.1177
pH -0.1159 0.1696 -0.5578
Cond -0.2729 -0.1200 0.3636
TempSurf 0.0538 -0.2800 0.2621
Relief -0.0765 0.3855 -0.1462
maxERht 0.0248 0.4879 0.2426
avERht 0.0599 0.4568 0.2497
%ER 0.0789 0.4223 0.2278
%VEG 0.3305 -0.2087 -0.0276
%LIT -0.3053 0.1226 0.1145
%LOG -0.3144 0.0402 -0.1067
%W -0.0886 -0.0654 -0.1171
H1Moss 0.1364 -0.1262 0.4761
DistSWH -0.3787 0.0101 0.0042
DistSW -0.3494 -0.1283 0.1166
DistMF 0.3899 0.0586 -0.0175
53. How many axes are needed?
ā¢ does the (k+1)th principal axis represent
more variance than would be expected
by chance?
ā¢ several tests and rules have been
proposed
ā¢ a common ārule of thumbā when PCA is
based on correlations is that axes with
eigenvalues > 1 are worth interpreting
55. What are the assumptions of PCA?
ā¢ assumes relationships among variables are
LINEAR
ā cloud of points in p-dimensional space has
linear dimensions that can be effectively
summarized by the principal axes
ā¢ if the structure in the data is
NONLINEAR (the cloud of points twists
and curves its way through p-dimensional
space), the principal axes will not be an
efficient and informative summary of the
data.
56. When should PCA be used?
ā¢ In community ecology, PCA is useful for
summarizing variables whose
relationships are approximately linear or
at least monotonic
ā e.g. A PCA of many soil properties might
be used to extract a few components that
summarize main dimensions of soil variation
ā¢ PCA is generally NOT useful for
ordinating community data
ā¢ Why? Because relationships among
species are highly nonlinear.
58. The āHorseshoeā or Arch Effect
ā¢ community trends along environmenal
gradients appear as āhorseshoesā in PCA
ordinations
ā¢ none of the PC axes effectively
summarizes the trend in species
composition along the gradient
ā¢ SUs at opposite extremes of the
gradient appear relatively close
together.
61. The āHorseshoeāEffect
ā¢ curvature of the gradient and the degree
of infolding of the extremes increase
with beta diversity
ā¢ PCA ordinations are not useful summaries
of community data except when beta
diversity is very low
ā¢ using correlation generally does better
than covariance
ā this is because standardization by species
improves the correlation between Euclidean
distance and environmental distance.
63. The āHorseshoeā Effect
ā¢ when two or more underlying gradients
with high beta diversity a āhorseshoeā is
usually not detectable
ā¢ the SUs fall on a curved hypersurface
that twists and turns through the p-
dimensional species space
ā¢ interpretation problems are more severe
ā¢ PCA should NOT be used with community
data (except maybe when beta diversity is very low).
64. Impact on Ordination History
ā¢ by 1970 PCA was the ordination method
of choice for community data
ā¢ simulation studies by Swan (1970) &
Austin & Noy-Meir (1971) demonstrated
the horseshoe effect and showed that
the linear assumption of PCA was not
compatible with the nonlinear structure
of community data
ā¢ stimulated the quest for more
appropriate ordination methods.