deBias {softImpute} | R Documentation |
$d
component of a "softImpute"
object
through regression.
softImpute
uses shrinkage when completing a matrix with
missing values. This function debiases the singular values using
ordinary least squares.
deBias(x, svdObject)
x |
matrix with missing entries, or a matrix of class |
svdObject |
an SVD object, the output of |
Treating the "d"
values as parameters, this function recomputes
them by linear regression.
An svd object is returned, with components "u", "d", and "v".
Trevor Hastie
Maintainer: Trevor Hastie hastie@stanford.edu
set.seed(101) n=200 p=100 J=50 np=n*p missfrac=0.3 x=matrix(rnorm(n*J),n,J)%*%matrix(rnorm(J*p),J,p)+matrix(rnorm(np),n,p)/5 ix=seq(np) imiss=sample(ix,np*missfrac,replace=FALSE) xna=x xna[imiss]=NA fit1=softImpute(xna,rank=50,lambda=30) fit1d=deBias(xna,fit1)