soft_impute_cpp: Fast Matrix Completion using Soft-Impute Algorithm

View source: R/RcppExports.R

soft_impute_cppR Documentation

Fast Matrix Completion using Soft-Impute Algorithm

Description

Solves: min_L (1/2) ||O o (Y - L)||F^2 + lambda * ||L||* via iterative SVD soft-thresholding (Mazumder, Hastie, Tibshirani 2010). Note: lambda is NOT normalized by |O|.

Usage

soft_impute_cpp(Y, O, lambda, max_iter = 1000L, tol = 1e-05)

Arguments

Y

Observed outcome matrix (T x N). Unobserved entries should be 0.

O

Binary mask matrix (T x N): 1 = observed, 0 = missing (treated post).

lambda

Nuclear norm penalty (soft-threshold on singular values).

max_iter

Maximum iterations.

tol

Convergence tolerance (relative Frobenius norm change).

Details

This is soft_impute_fe_cpp() with the fixed effects switched off.

Value

A numeric matrix of the same dimension as Y (T x N): the completed low-rank matrix L that minimises the soft-thresholded nuclear-norm objective.


coresynth documentation built on Oct. 11, 2026, 5:07 p.m.