Skip to contents

theta = X^+ y = V Sigma^+ U^T y; minimum-norm solution when rank deficient.

Usage

morie_geron_svd_pseudoinverse(X, y, rcond = NULL, fit_intercept = FALSE)

Arguments

X

Design matrix (n, d).

y

Targets, length n.

rcond

Optional relative singular-value cutoff; default max(n,d)*eps.

fit_intercept

Prepend a column of ones.

Value

list with theta, singular_values, rank, condition_number, residuals, rss, deficient, estimate, n, method.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_svd_pseudoinverse(V, V)
#> $theta
#> [1] 1
#> 
#> $singular_values
#> [1] 14.28286
#> 
#> $rank
#> [1] 1
#> 
#> $condition_number
#> [1] 1
#> 
#> $residuals
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $rss
#> [1] 0
#> 
#> $deficient
#> [1] FALSE
#> 
#> $estimate
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Minimum-norm least squares theta = V Sigma^+ U^T y"
#>