R/pcweights.R

'pcweights' <- function(Y, weights.num = NULL, cutoff = 99) {
	if (is.null(weights.num)) {
		weights.num = numSingularValues(Y, cutoff = cutoff)
	}

	s = svd(Y)
	ans = NULL
	ans$UD = s$u %*% diag(s$d)[,1:weights.num]
	ans$Vprime = t(s$v)[1:weights.num,]
	return (ans)
}

Try the mlegp package in your browser

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

mlegp documentation built on March 18, 2022, 5:29 p.m.