Description Usage Arguments Details Value
These functions calculate either the hat matrix, the mapping matrix or the original (kernel) matrix for a two-step kernel ridge regression, based on the eigendecomposition of the kernel matrix.
1 2 3 4 5 |
eigen |
a matrix with the eigenvectors. |
val |
an numeric vector with the eigenvalues. |
lambda |
a single numeric value for the hyperparameter lambda |
For the hat matrix, this boils down to:
UΣ(Σ + λ I)^{-1} U^{T}
For the map matrix, this is :
U(Σ + λ I)^{-1} U^{T}
with U the matrix with eigenvectors, Σ a diagonal matrix with the eigenvalues on the diagonal, I the identity matrix and λ the hyperparameter linked to this kernel. The internal calculation is optimized to avoid having to invert a matrix. This is done using the fact that Σ is a diagonal matrix.
a numeric matrix representing either the hat matrix
(eigen2hat
), the map matrix (eigen2map
) or
the original matrix (eigen2matrix
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.