execute: echo: true warning: false—
The covariance matrix captures the relationship between random variables. For two variables:
\(\mathbf{K} = \begin{bmatrix} \text{Var}(X) & \text{Cov}(X,Y) \\ \text{Cov}(X,Y) & \text{Var}(Y) \end{bmatrix}\)
Consider this visualization:
Key observations:
The eigendecomposition reveals principal directions of variation:
Linear estimation finds the best linear approximation:
PCA finds orthogonal directions of maximum variance:
PCA allows optimal linear dimensionality reduction:
Eigenvalues (variance explained):
[0.0092613 0.01075296 0.9996092 ]
The design matrix structure affects numerical stability:
L2 regularization stabilizes the solution:
Model complexity affects both bias and variance: