R/pca.ridge.R

Defines functions pca.ridge

Documented in pca.ridge

## transform a ridge object to PCA space, given by the SVD of X

pca.ridge <- function(x, ...) {
	if (is.null(x$svd.V)) stop("ridge object must contain svd.V")
	
	# transform a variance covariance matrix S by L
	rot <- function(S,L) L %*% S %*% t(L)
	
	result <- x	
	result$coef <- result$coef %*% result$svd.V
	result$cov <- lapply(result$cov, rot,  t(result$svd.V))
	class(result) <- c("pcaridge", class(x))
	result
}

Try the genridge package in your browser

Any scripts or data that you put into this service are public.

genridge documentation built on May 2, 2019, 5:46 p.m.