1 Introduksi
1.1 Latar Belakang
Principal Component Analysis (PCA) adalah teknik unsupervised dimensionality reduction klasik (Pearson, 1901; Hotelling, 1933): cari kombinasi linear orthogonal dari variabel asli yang memaksimalkan varians. Komponen pertama (PC1) capture varians terbesar, PC2 capture varians terbesar yang orthogonal ke PC1, dan seterusnya. Hasil: representasi data di subspace dimensi rendah ($k \ll p$) dengan minimum information loss.
Aplikasi sains pangan: visualisasi multivariate sensory profile (panelis × deskriptor), eksplorasi NIR/HPLC spectra, deteksi outlier batch produksi, basis untuk PLS regression, SIMCA classification, MDPREF preference mapping. PCA tidak butuh assumption distribusi, tetapi sensitif terhadap skala variabel (wajib standarisasi bila satuan berbeda).
1.2 Tujuan Modul
Modul PCA Explorer di SQalytics ditujukan untuk:
- Menerima matriks fitur numerik (objek × variabel).
- Menjalankan PCA via SVD dengan opsi standarisasi otomatis.
- Menyediakan scree plot, biplot, loading plot, score plot.
- Menghitung varians explained per PC + cumulative + Kaiser criterion.
- Mendukung opsional varimax rotation untuk interpretasi lebih jelas.
- Audiens: peneliti R&D, sensory scientist, analis multivariate exploratory.
1.3 Posisi di Antara Alternatif
Pilih PCA Explorer untuk unsupervised dimensionality reduction + exploration. Untuk supervised regression, pakai PLSR Studio. Untuk clustering, pakai Cluster Analysis Explorer. Untuk classification, pakai Class Modelling (SIMCA). Untuk preference mapping internal, pakai Preference Mapping.
2 Metode
2.1 Dasar Teoretis
Data matrix $\mathbf{X}_{n \times p}$ (centered, optional standardized). PCA decomposition via Singular Value Decomposition (SVD):
dengan:
- $\mathbf{U}_{n \times r}$ left singular vectors (scaled scores).
- $\boldsymbol{\Sigma}_{r \times r}$ diagonal singular values $\sigma_1 \geq \sigma_2 \geq \ldots$
- $\mathbf{V}_{p \times r}$ right singular vectors = loadings.
Scores $\mathbf{T} = \mathbf{U} \boldsymbol{\Sigma} = \mathbf{X} \mathbf{V}$ (proyeksi ke PC axes).
Variance explained PC $k$:
$$\text{VE}_k = \frac{\sigma_k^2}{\sum_{j=1}^{r} \sigma_j^2} \times 100\%$$Cumulative variance $\text{CVE}_k = \sum_{j=1}^{k} \text{VE}_j$.
Kaiser criterion — retain PC dengan eigenvalue $\lambda_k = \sigma_k^2 / (n-1) > 1$ (standardized data).
Scree plot — eigenvalue vs PC number; pilih PC sebelum "elbow" (Cattell, 1966).
Biplot (Gabriel, 1971) — overlay scores + loadings pada single plot:
- Scores: $n$ titik di plot (objek).
- Loadings: $p$ arrow dari origin (variabel).
- Sudut antara arrow ≈ correlation; length arrow ≈ contribution.
Hotelling's $T^2$ untuk multivariate outlier detection:
$$T_i^2 = \sum_{k=1}^{K} \frac{t_{ik}^2}{\lambda_k}$$Threshold $T^2_{0.95} = K(n-1)/(n-K) \cdot F_{K, n-K, 0.95}$.
Q-residual — sum-of-squares unexplained:
$$Q_i = \| \mathbf{x}_i - \hat{\mathbf{x}}_i \|^2$$Varimax rotation (Kaiser, 1958) — orthogonal rotation untuk maksimasi variance of squared loadings (sparse + interpretable):
$$\max \sum_k \left[ \frac{1}{p} \sum_j (v_{jk}^2)^2 - \left( \frac{1}{p} \sum_j v_{jk}^2 \right)^2 \right]$$2.2 Persamaan Inti
- SVD: $\mathbf{X} = \mathbf{U} \boldsymbol{\Sigma} \mathbf{V}^T$
- Scores: $\mathbf{T} = \mathbf{X} \mathbf{V}$
- Variance explained: $\sigma_k^2 / \sum \sigma_j^2$
- $T^2$: $\sum t_{ik}^2 / \lambda_k$
- Q-residual: $\| \mathbf{x}_i - \hat{\mathbf{x}}_i \|^2$
2.3 Asumsi & Batas Validitas
| Asumsi | Konsekuensi jika dilanggar | Cara cek di SQalytics |
|---|---|---|
| Variabel di-standarisasi (skala beda) | Variabel besar dominate PC1 | Default z-score on |
| Linear relations dominate | PCA miss non-linear | Pakai kernel PCA atau t-SNE |
| Multivariate distribution kontinyu | Diskrit data bias | Variabel kontinyu preferred |
| $n > p$ atau $n > 5 \times$ PC retained | Unreliable loadings | Modul flag $n$ kecil |
| Outlier dikontrol | PC1 narik ke outlier | $T^2$ + Q-residual check |
| Variabel tidak collinear ekstrem | Loading ambiguous | Cek correlation matrix |
3 Cara Kerja
3.1 Step-by-Step di SQalytics
- Buka
PCA Explorerdari domain Mutu dan Analisis Lanjutan. - Muat matriks: rows = objek, columns = variabel numerik.
- Pilih preprocessing: center (default), center+scale (z-score, recommended).
- Pilih jumlah PC retained atau auto (cumulative ≥ 80% atau Kaiser eigenvalue > 1).
- (Opsional) aktifkan varimax rotation untuk loadings interpretasi mudah.
- Klik Run PCA.
- Tinjau:
- Tab
Scree Plot— eigenvalues + cumulative variance. - Tab
Score Plot (PC1 vs PC2)— objek scatter. - Tab
Loading Plot— variabel arrows. - Tab
Biplot— score + loadings overlay. - Tab
Diagnostics— $T^2$ + Q-residual outlier check.
- Tab
3.2 Template Tabel Input + Contoh Data Sintetis
Sensory descriptor profile 15 wine samples (panel mean, 10 descriptors):
| Wine | Floral | Fruity | Vegetal | Spicy | Buttery | Oaky | Acidic | Bitter | Astringent | Sweet |
|---|---|---|---|---|---|---|---|---|---|---|
| A | 6.5 | 7.2 | 2.0 | 3.5 | 5.2 | 6.0 | 5.8 | 3.0 | 4.5 | 4.0 |
| B | 7.0 | 7.5 | 1.8 | 3.2 | 5.5 | 6.2 | 5.5 | 2.8 | 4.2 | 4.5 |
| C | 2.5 | 3.0 | 6.5 | 5.8 | 2.0 | 3.2 | 7.5 | 5.5 | 6.8 | 1.5 |
| D | 2.8 | 3.2 | 6.8 | 6.0 | 2.2 | 3.0 | 7.8 | 5.8 | 7.0 | 1.2 |
| … (15 wines × 10 descriptors) | ||||||||||
docs/assets/example-data/id/quality-advanced/template_quality_pca.csv.
3.3 Contoh Luaran
Scree + variance:
| PC | Eigenvalue | VE (%) | Cumulative (%) |
|---|---|---|---|
| 1 | 5.2 | 52.0 | 52.0 |
| 2 | 2.8 | 28.0 | 80.0 ✓ |
| 3 | 0.9 | 9.0 | 89.0 |
| 4 | 0.5 | 5.0 | 94.0 |
| 5 | 0.3 | 3.0 | 97.0 |
PC1 + PC2 capture 80% — retain 2 PC (Kaiser: $\lambda_1, \lambda_2 > 1$).
Loadings PC1 + PC2:
| Descriptor | PC1 | PC2 |
|---|---|---|
| Floral | +0.42 | −0.12 |
| Fruity | +0.41 | −0.10 |
| Vegetal | −0.40 | +0.15 |
| Spicy | −0.35 | +0.25 |
| Buttery | +0.38 | +0.18 |
| Oaky | +0.32 | +0.30 |
| Acidic | −0.30 | +0.20 |
| Bitter | −0.28 | +0.45 |
| Astringent | −0.32 | +0.35 |
| Sweet | +0.20 | −0.40 |
Interpretasi PC1 (52%): floral-fruity-buttery (+) vs vegetal-spicy-acidic (−) → axis ripeness/sweetness vs greenness.
Interpretasi PC2 (28%): bitter-astringent-oaky (+) vs sweet (−) → axis tannin intensity.
Score plot: wines A, B di kuadran (+, −) — fruity sweet. Wines C, D di kuadran (−, +) — vegetal tannic.
Outlier diagnostics: Wine M $T^2 = 14.2$ (> threshold 8.5) — atypical multivariate; investigasi recipe outlier.
Preference Mapping overlay consumer preference vector pada PCA space ini, atau ke Cluster Analysis Explorer untuk formal grouping."4 Kesimpulan
4.1 Relevansi Real-World
- Sensory profile visualization product portfolio.
- NIR / HPLC spectra exploration — chemical fingerprinting.
- Process variable reduction sebelum modeling.
- Multivariate outlier detection ($T^2$ + Q).
- Pre-step untuk PLS, SIMCA, MDPREF.
4.2 Where to Go from Here
⚙ Troubleshooting Cepat
i Riwayat Revisi
| Tanggal | Revisi | Penulis |
|---|---|---|
| 2026-05-12 | Draft v2 publikasi (KaTeX SVD + variance + biplot + $T^2$/Q + varimax + APA Pearson/Hotelling/Gabriel/Jolliffe) | Claude |
| 2026-05-12 | Konversi MD → HTML (W5 quality-advanced batch) | Claude |
4 Referensi
- Pearson, K. (1901). On lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2(11), 559–572. https://doi.org/10.1080/14786440109462720
- Hotelling, H. (1933). Analysis of a complex of statistical variables into principal components. Journal of Educational Psychology, 24(6), 417–441. https://doi.org/10.1037/h0071325
- Gabriel, K. R. (1971). The biplot graphic display of matrices with application to principal component analysis. Biometrika, 58(3), 453–467. https://doi.org/10.1093/biomet/58.3.453
- Cattell, R. B. (1966). The scree test for the number of factors. Multivariate Behavioral Research, 1(2), 245–276. https://doi.org/10.1207/s15327906mbr0102_10
- Kaiser, H. F. (1958). The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23(3), 187–200. https://doi.org/10.1007/BF02289233
- Jolliffe, I. T. (2002). Principal component analysis (2nd ed.). Springer. https://doi.org/10.1007/b98835