eigen2hat: Calculate the hat matrix from an eigen decomposition

Description Usage Arguments Details Value

View source: R/eigen2hat.R

Description

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.

Usage

1
2
3
4
5

Arguments

eigen

a matrix with the eigenvectors.

val

an numeric vector with the eigenvalues.

lambda

a single numeric value for the hyperparameter lambda

Details

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.

Value

a numeric matrix representing either the hat matrix (eigen2hat), the map matrix (eigen2map) or the original matrix (eigen2matrix)


xnet documentation built on Feb. 4, 2020, 9:10 a.m.