PCA Interactive Playground

Dataset Controls

Noise Control

0%
Current dataset: 8 points | Selected: DEFAULT | Noise: 0%

Key Concepts

Augmented Vector

An augmented vector is simply a vector with additional components. In our context, when we represent 2D data points as [x, y], we're using 2D vectors. The "augmented" aspect comes when we stack all data points into a matrix for processing.

Eigenvector & Eigenvalue

For a matrix A, if Av = λv (where v ≠ 0), then v is an eigenvector and λ is its eigenvalue. Eigenvectors show directions of maximum variance in data, while eigenvalues show how much variance exists in those directions.

Step 1: Original Data Points

Data Matrix (Augmented Vectors):

Mean: [0.00, 0.00]

Data Points: 8

Step 2: Centered Data (Mean Subtraction)

Centered Data:

Process: Each point - mean = centered point

This centers the data around the origin (0,0)

Step 3: Covariance Matrix

Covariance Matrix:

Interpretation:
  • Diagonal: Variance in X and Y
  • Off-diagonal: Covariance between X and Y
  • Positive covariance = variables tend to increase together

Formula:

Cov(X,Y) = Σ(xi - x̄)(yi - ȳ) / (n-1)

Where:

  • xi, yi are data points
  • xÌ„, ȳ are means
  • n is number of points

Step 4: Principal Components (Eigenvectors & Eigenvalues)

🔴 PC1 (Maximum Variance) | 🔵 PC2 (Orthogonal)

Eigenvalues (Variance along each PC):

λ1 = 0.000000 (PC1)
Variance explained: 0.00%
λ2 = 0.000000 (PC2)
Variance explained: 0.00%

Eigenvectors (PC Directions):

PC1: [0.000000, 0.000000]
Angle: 0.0°
PC2: [0.000000, 0.000000]
Angle: 0.0°
Key Properties:
  • PC1 has the highest eigenvalue (most variance)
  • PCs are orthogonal (perpendicular) to each other
  • Eigenvectors are unit vectors (normalized)
  • Red line shows direction of maximum variance
  • Blue line shows direction of minimum variance

Step 5: Data in PC Space

Transformed Coordinates:

Transformation Process:

New coordinates = Original_centered × Eigenvector_matrix

X-axis = PC1 (most variance)

Y-axis = PC2 (remaining variance)

Complete Mathematical Process

1. Data Matrix (X):

Each row is a data point (augmented vector):

2. Centering:

X_centered = X - mean(X)

Mean: [0.000, 0.000]

3. Covariance Matrix:

4. Eigendecomposition:

Characteristic equation:

det(C - λI) = 0

λ² - 0.0000λ + 0.0000 = 0

5. Exact Solutions:

PC1 (λ=0.000000):

Eigenvector: [0.000000, 0.000000]

PC2 (λ=0.000000):

Eigenvector: [0.000000, 0.000000]

6. Verification:

C × v1 = λ1 × v1 ✓

C × v2 = λ2 × v2 ✓

v1 · v2 = 0.000000 (≈0, orthogonal)

Understanding the Results

Augmented Vectors: Our data points [x, y] are 2D vectors. When we arrange them in a matrix where each row is one observation, we create an "augmented" data matrix. This allows us to process multiple data points simultaneously.

Eigenvectors (Principal Components): These are special directions in the data space. The red line (PC1) points in the direction where data varies the most. The blue line (PC2) is perpendicular and shows the direction of remaining variance.

Eigenvalues: These numbers (λ1, λ2) tell us exactly how much variance exists along each eigenvector direction. Larger eigenvalue = more important direction. The ratio λ1/(λ1+λ2) shows the percentage of total variance captured by PC1.

PCA Transformation: We project each centered data point onto the principal component axes using the exact eigenvector coordinates. This rotates our coordinate system to align with the data's natural variation patterns.

Dataset Characteristics

Data Range:

X: [0.00, 0.00]

Y: [0.00, 0.00]

Correlation:

Cov(X,Y) = 0.0000

Correlation = 0.0000

Noise Effect:

Current Noise: 0%

Add noise to see how PCA handles real-world data

4 style="font-weight: 600; margin-bottom: 8px;">Current Dataset:

DEFAULT

8 points

Try different shapes to see how PCA adapts!