PLSR Studio

Domain: Statistika Terapan · SQalytics · Partial Least Squares Regression (NIPALS) — multivariate latent variable untuk multicollinearity

1 Introduksi

1.1 Latar Belakang

Partial Least Squares Regression (PLSR) adalah teknik multivariate yang memodelkan hubungan antara matriks prediktor $X$ (banyak kolom) dan respons $y$ dengan memproyeksikan keduanya ke ruang laten yang memaksimumkan kovariansi $X$-$y$. Diperkenalkan oleh Herman Wold (1966) dan dipopulerkan oleh Geladi & Kowalski (1986) untuk chemometrics, PLSR telah menjadi standar di spektroskopi NIR/UV-Vis, sensoris-instrumental linkage, omics, dan process analytical technology (PAT) (Martens & Næs, 1989; Eriksson, Byrne, Johansson, Trygg, & Wikström, 2013).

Keunggulan PLSR atas OLS multiple regression: (i) menangani multicollinearity secara elegant, (ii) menangani $p \gg n$ (lebih banyak prediktor daripada observasi), (iii) interpretasi via VIP scores untuk identifikasi prediktor kunci, dan (iv) biplot loadings untuk visualisasi struktur hubungan $X$-$Y$ dalam 2D atau 3D.

PLSR Studio adalah desk expert yang mengintegrasikan semua aspek PLSR di satu workspace: pilihan jumlah komponen, cross-validation, VIP ranking, dan correlation loading biplot. Modul ini melengkapi Regression Studio (single-X) dan Predict One Result from Many Variables (multi-X OLS) untuk kasus dengan prediktor banyak + multicollinearity.

1.2 Tujuan Modul

1.3 Posisi di Antara Alternatif

Pilih PLSR Studio ketika prediktor $X$ banyak (≥ 5) + multicollinearity tinggi. Untuk satu prediktor, pakai Regression Studio. Untuk multi-prediktor tanpa multicollinearity, pakai Predict One Result from Many Variables. Untuk eksplorasi unsupervised, gunakan PCA Explorer (akan datang). Untuk uji statistik perbedaan kelompok, gunakan ANOVA Studio.

2 Metode

2.1 Dasar Teoretis

Setup PLSR — $X$ ukuran $n \times p$ (autoscaled) dan $y$ ukuran $n \times 1$. PLSR mendekomposisi:

$$ X = T P^T + E, \quad y = T q + f $$

$T$ = scores ($n \times A$, $A$ komponen), $P$ = X-loadings ($p \times A$), $q$ = Y-loadings, $E$ dan $f$ residual. Krusial: $T$ dipilih untuk memaksimumkan kovariansi $\text{cov}(X w, y)$, bukan hanya variansi $X$ (seperti PCR/PCA).

Algoritma NIPALS (Wold, 1966) — iterative deflation per komponen $a$:

  1. Initialize $u_a$ random.
  2. $w_a = X^T u_a / \|X^T u_a\|$ (weights).
  3. $t_a = X w_a$ (scores).
  4. $q_a = y^T t_a / (t_a^T t_a)$ (Y-loading).
  5. $u_a = y q_a / (q_a^T q_a)$.
  6. Iterasi 2–5 hingga konvergen.
  7. $p_a = X^T t_a / (t_a^T t_a)$ (X-loading).
  8. Deflasi: $X \leftarrow X - t_a p_a^T$, $y \leftarrow y - t_a q_a$.
  9. Ulangi untuk komponen $a+1$.

Predicted Y: $\hat{y} = X B_{\text{PLS}}$ dengan $B_{\text{PLS}} = W (P^T W)^{-1} q$.

Cross-validation metrik — k-fold CV (default 10-fold):

$$ Q^2 = 1 - \frac{\text{PRESS}}{\text{SS}_y} = 1 - \frac{\sum (y_i - \hat{y}_{i,-i})^2}{\sum (y_i - \bar{y})^2} $$

$\hat{y}_{i,-i}$ adalah prediksi $y_i$ tanpa observasi $i$. Komponen optimal dipilih untuk memaksimumkan $Q^2$ atau minimumkan RMSECV:

$$ \text{RMSECV} = \sqrt{\sum (y_i - \hat{y}_{i,-i})^2 / n} $$

Rule of thumb (Eriksson et al., 2013): $Q^2 > 0.5$ acceptable, $> 0.7$ good, $> 0.9$ excellent.

VIP score (Wold, Sjöström, & Eriksson, 2001):

$$ \text{VIP}_j = \sqrt{\frac{p \sum_{a=1}^{A} \text{SS}_a (w_{aj} / \|w_a\|)^2}{\sum_{a=1}^{A} \text{SS}_a}} $$

Threshold: VIP ≥ 1 signifikan; VIP < 1 kontribusi marginal.

Correlation loading biplot — plot $X$-loadings dan $y$-loading di ruang komponen 1 vs 2. Posisi loading pada inner circle (radius 0.5) berarti variabel poorly explained; outer circle (radius 1.0) berarti variabel well explained. Sudut antar loading menunjukkan korelasi: $0°$ positif kuat, $90°$ tidak berkorelasi, $180°$ negatif kuat.

Bahaya overfitting: terlalu banyak komponen menghasilkan $R^2$ tinggi tetapi $Q^2$ rendah. Decision rule (Eriksson et al., 2013): stop ketika $\Delta Q^2 < 0.05$ atau $Q^2$ mulai menurun.

2.2 Persamaan Inti

Dekomposisi: $X = T P^T + E$, $y = T q + f$

Koefisien PLS: $B_{\text{PLS}} = W (P^T W)^{-1} q$

$Q^2$ predictive: $1 - \text{PRESS} / \text{SS}_y$

RMSECV: $\sqrt{\sum (y_i - \hat{y}_{i,-i})^2 / n}$

VIP score: $\sqrt{p \cdot \sum_a \text{SS}_a (w_{aj}/\|w_a\|)^2 / \sum_a \text{SS}_a}$

Thresholds: $Q^2 \geq 0.5$ acceptable, VIP $\geq 1$ signifikan.

2.3 Asumsi & Batas Validitas

AsumsiKonsekuensi jika dilanggarCara cek di SQalytics
Hubungan linier $X$-$Y$ (ruang laten)Bias prediksiCek residual plot
Autoscaling sebelum NIPALSBias ke variabel skala besarModul auto-center dan scale
Tidak ada nilai konstan di $X$Variabel tidak kontribusiModul auto-drop konstan
$n \geq 3$ observasi lengkapAlgoritma failModul flag warning
Komponen optimal via CVOverfitModul default: pilih $A$ maks $Q^2$
Missing value minimalBiasImputation atau drop kolom
Y tidak konstan$Q^2$ undefinedModul flag varian Y
VIP threshold = 1 (standar)Tidak universalSesuaikan dengan domain

3 Cara Kerja

3.1 Step-by-Step di SQalytics

  1. Buka PLSR Studio dari domain Statistika Terapan.
  2. (Opsional) Muat seed stats_group_compare.
  3. Pada DJ Entry Panel, pilih preset: Screening view, Focus top features, atau Explore in 3D.
  4. Pada panel PLSR Correlation Analysis, sesuaikan: Response (Y), Predictor Variables (X) (minimal 2), Components (auto-pilih via $Q^2$).
  5. (Opsional) Buka Visualization Settings: Plot Dimensions (2D/3D), Top N Features (by VIP).
  6. Klik Run from DJ Entry Panel atau Run Analysis.
  7. Tinjau hasil: conclusion → Correlation Loading Biplot → Top Features → Detailed Feature Importance → Model Summary.
  8. Klik Download Report.

3.2 Template Tabel Input + Contoh Data Sintetis

KolomTipeWajibCatatan
<Y>numericResponse variable (1 kolom)
<X1>, <X2>, ...numeric✓ (≥2)Predictor variables

Contoh data sintetis (15 baris — Yield target vs 5 prediktor proses biskuit):

BatchMoistureProteinTextureColorScoreSugarYield
B0112.511.27.48.518.085.2
B0212.811.47.68.618.386.1
B0312.411.17.28.417.884.8
B0412.711.37.58.718.285.9
B0512.611.57.38.518.085.5
B0612.911.67.88.818.586.4
B0712.311.07.18.317.784.5
… (15 batch total)
SYNTHETIC Yield (%) target vs 5 prediktor proses biskuit (Moisture %, Protein %, Texture N, ColorScore 1–10, Sugar %), 15 batch. Lima prediktor saling berkorelasi tinggi ($r$ = 0.79–0.92) — multicollinearity klasik di mana PLSR lebih cocok dari OLS multi-X. Ekspektasi: 1 komponen laten dominan, $R^2 \approx 0.95$, $Q^2 \approx 0.85$ — semua prediktor VIP > 1. CSV setara: docs/assets/example-data/id/statistics/template_stats_groups.csv.

3.3 Contoh Luaran

Tabel Model Summary (PLSR untuk Yield):

Komponen$R^2_X$ cum.$R^2_Y$ cum.$Q^2$ cum.RMSECRMSECV
10.8920.9460.8710.1480.231
20.9650.9720.8820.1070.222
30.9910.9780.876 (↓)0.0940.227

Decision: Komponen optimal = 1 komponen ($\Delta Q^2 < 0.05$ untuk komponen 2; komponen 3 menurunkan $Q^2$ → overfit).

Tabel Top Features (by VIP) dengan 1 komponen:

VariableVIPCoefficient $B_{\text{PLS}}$DirectionRank
Texture1.082+0.282Positive1
Protein1.071+0.279Positive2
Moisture1.053+0.275Positive3
Sugar1.039+0.271Positive4
ColorScore1.025+0.267Positive5

Semua VIP > 1 — semua prediktor signifikan. Koefisien hampir identik (0.27–0.28) — konsisten dengan multicollinearity ekstrem, PLS mendistribusikan kontribusi merata.

Kesimpulan ringkas: "Model PLSR untuk Yield memberikan fit excellent dengan 1 komponen laten: $R^2_Y$ = 0.946, $Q^2$ = 0.871 (excellent per Eriksson et al. 2013 threshold $Q^2 > 0.7$). Komponen tambahan tidak memberi improvement ($\Delta Q^2 < 0.05$); komponen 3 bahkan menurunkan $Q^2$ — 1 komponen sudah optimal. RMSECV = 0.231% (Yield). Semua 5 prediktor signifikan (VIP > 1, range 1.025–1.082): urutan Texture > Protein > Moisture > Sugar > ColorScore. Koefisien PLS hampir identik (+0.27 hingga +0.28) — konsisten dengan multicollinearity ekstrem (Pearson $r$ antar prediktor = 0.79–0.92). Interpretasi: lima atribut proses adalah proxy quality batch yang co-vary. Rekomendasi: monitor Texture sebagai proxy primer (highest VIP); 1-component PLSR cukup untuk prediksi; OLS multi-X akan tidak stabil. Lanjut ke Regression Studio untuk uji single-predictor cross-check."

Grafik utama: dua panel — (a) correlation loading biplot 2D: 5 X-loadings + 1 Y-loading dalam ruang LV1 vs LV2; (b) bar chart VIP score 5 prediktor dengan garis ambang VIP = 1.

PLSR Studio correlation biplot dan VIP bar chart untuk Yield model
Gambar 1. Model PLSR untuk Yield biskuit (n = 15 batch, 5 prediktor proses, autoscaled). (a) Correlation loading biplot LV1 (89.2% variansi X, 94.6% Y) vs LV2 (residual): lima X-loadings (panah biru) — Moisture, Protein, Texture, ColorScore, Sugar — semua mengelompok di kuadran kanan dengan arah hampir sejajar, mencerminkan multicollinearity ekstrem (semua co-vary di LV1). Y-loading Yield (panah merah) sejajar dengan X-loadings dan terletak di outer circle ($r$ ≈ 1.0) — well explained oleh LV1. Inner circle ($r$ = 0.5) dan outer circle ($r$ = 1.0) garis putus-putus abu-abu sebagai referensi correlation strength. Kotak hijau menampilkan metrik: $R^2_Y$ = 0.946, $Q^2$ = 0.871 (excellent), RMSECV = 0.231, 1 komponen optimal. (b) Bar chart VIP score: semua 5 prediktor di atas threshold VIP = 1.0 (garis merah putus-putus). Urutan: Texture (1.082) > Protein (1.071) > Moisture (1.053) > Sugar (1.039) > ColorScore (1.025) — gap kecil mengkonfirmasi distribusi kontribusi merata akibat multicollinearity. Pola ini lebih informatif dari OLS multi-X yang akan tidak stabil (coefficient inflation) pada matriks $X^T X$ near-singular.

4 Kesimpulan

4.1 Relevansi Real-World

Pada Rencana Publikasi Singkil v5, modul ini dipakai pada T3 Tahap 3 untuk hubungan profil HPLC fingerprint → activity antimikroba, dan T5 Tahap 3 untuk preference mapping (instrumental → sensoris).

4.2 Where to Go from Here

Pembacaan lanjutan:

Troubleshooting Cepat

Run tetap nonaktif. Pastikan satu target $Y$ dan minimal dua prediktor $X$ dipilih.
Hasil terasa kosong atau lemah. Cek nilai kosong atau baris lengkap setelah cleaning. PLSR butuh minimal 3 baris.
3D biplot tidak muncul. Pastikan Components ≥ 3 di setting.
$Q^2$ jauh lebih rendah dari $R^2$. Indikasi overfitting — kurangi komponen.
VIP semua di bawah 1. Prediktor tidak diskriminatif untuk $Y$ — coba prediktor lain.
Koefisien PLS bertolak belakang dengan domain knowledge. Cek autoscaling (default: ya) dan sign biplot loadings.
Komponen optimal "0" atau 1 saja. Bukan masalah — bila $Q^2$ tertinggi tercapai pada 1 komponen, itulah optimal.

i Riwayat Revisi

TanggalRevisiPenulis
2026-05-12Migrasi MD v2 → HTML final dengan figure dual-panel biplot + VIP barplot + caption Elsevier-styleClaude
2026-05-12Migrasi v1 → v2 (template publikasi + KaTeX NIPALS/PLS coefficient/VIP/Q² + biplot interpretation + APA Wold/Geladi/Martens/Eriksson)Claude
2026-05-09Draft awal v1Tim docs

4 Referensi

  • Wold, H. (1966). Estimation of principal components and related models by iterative least squares. In P. R. Krishnaiah (Ed.), Multivariate analysis (pp. 391–420). Academic Press.
  • Geladi, P., & Kowalski, B. R. (1986). Partial least-squares regression: A tutorial. Analytica Chimica Acta, 185, 1–17. https://doi.org/10.1016/0003-2670(86)80028-9
  • Martens, H., & Næs, T. (1989). Multivariate calibration. John Wiley & Sons.
  • Wold, S., Sjöström, M., & Eriksson, L. (2001). PLS-regression: A basic tool of chemometrics. Chemometrics and Intelligent Laboratory Systems, 58(2), 109–130. https://doi.org/10.1016/S0169-7439(01)00155-1
  • Eriksson, L., Byrne, T., Johansson, E., Trygg, J., & Wikström, C. (2013). Multi- and megavariate data analysis: Basic principles and applications (3rd ed.). Umetrics Academy.
  • Mevik, B.-H., & Wehrens, R. (2007). The pls package: Principal component and partial least squares regression in R. Journal of Statistical Software, 18(2), 1–23. https://doi.org/10.18637/jss.v018.i02
  • Tenenhaus, M. (1998). La régression PLS: Théorie et pratique. Editions Technip.