SVDmiss: Missing Data SVD

Description Usage Arguments Value

View source: R/jive.r

Description

This function and description borrowed from R package SpatioTemporal (no longer on CRAN), from authors Paul D. Sampson and Johan Lindstrom. It completes a data matrix using iterative svd as described in Fuentes et. al. (2006). The function iterates between computing the singular value decomposition (svd) for the matrix and replacing the missing values by linear regression of the columns onto the first ncomp svd components. As initial replacement for the missing values regression on the column averages are used. The function will fail if entire rows and/or columns are missing from the data matrix.

Usage

1
SVDmiss(X, niter = 25, ncomp = min(4, dim(X)[2]), conv.reldiff = 0.001)

Arguments

X

Data matrix, with missing values marked by NA.

niter

Maximum number of iterations to run before exiting, Inf will run until the conv.reldiff criteria is met.

ncomp

Number of SVD components to use in the reconstruction (>0).

conv.reldiff

Assume the iterative procedure has converged when the relative difference between two consecutive iterations is less than conv.reldiff.

Value

A list with the following components:

Xfill

The completed data matrix with missing values replaced by fitting the data to the ncomp most important svd components

svd

The result of svd on the completed data matrix, i.e. svd(Xfill)

status

A vector of status variables: diff, the absolute difference between the two last iterations; rel.diff, the relative difference; n.iter, the number of iterations; and max.iter, the requested maximum number of iterations.


r.jive documentation built on Nov. 17, 2020, 9:07 a.m.