converged = TRUE. Rescale such
inputs before fitting; genuine zero and constant centered inputs retain
their existing results.robspca()'s objective to use the complete residual
X - X %*% B %*% t(A) - S. Previously the sparse error matrix was
charged a penalty while omitted from the reconstruction loss, which
could increase the recorded objective and terminate a fit prematurely.
Thanks to Maria A. Sans-Fuentes for the report and correction. Robust fits
with nonzero sparse residuals can now run longer and produce different
fitted values; the intended optimization model is unchanged.q argument to rspca(); previous versions always used two
power iterations. Calls with the default q = 2 retain that setting.eigenvalues and sdev to report sequentially adjusted score
energy and its square root. The previous values came from an auxiliary
Procrustes SVD and were not the variances of the returned sparse scores.
These field names and the summary matrix layout are retained; their
numerical values can change for penalized fits. score_variance records
marginal score energy separately. With centered data these quantities
are adjusted and marginal sample variances, respectively.var as the total squared energy of the processed data divided
by n - 1. This is total sample variance when centering is enabled.
For center = FALSE, it now consistently includes the column means,
matching the uncentered score-energy convention.penalty = "l0" for hard thresholding, with the existing ridge
penalty providing the ZeroNet variant when beta > 0. The default
remains elastic net. The new arguments follow all existing arguments.B_init to initialize a fit from a finite loading matrix, and
spca_path() to fit a sequence of penalties using a shared matrix
factorization or randomized sketch. Paths retain the supplied order and
report per-component nonzero counts and the union of selected variables.
Penalty paths do not impose an exact requested cardinality.spca_target() to search for an approximate requested number of
distinct variables across components. The bounded search shares one
factorization or randomized sketch and uses warm starts. It selects the
closest converged fit found, reports the achieved count and full search
diagnostics, and returns no recommendation when every candidate fails
to converge. Count tolerance is separate from objective tolerance;
support need not change monotonically or attain the requested count.predict() methods for all three fitted classes. Predictions use
stored centering and scaling, accept numeric data frames and Matrix
inputs, and align a complete set of named variables with the training
columns. Empty dimension names are normalized across supported Matrix
versions. Calling predict() without new data returns the training scores.rspca() with implicit centering and
scaling. Dense sketches, loadings, and scores are still needed;
spca() and robspca() explicitly use dense working matrices.Clarify that ordinary-PCA recovery at zero penalties assumes the default SVD initialization, and distinguish objective convergence from coefficient accuracy or first-order optimality of every returned factor.
Avoid computing unused left singular vectors during deterministic initialization. Reuse thin matrix products during optimization instead of constructing a full reconstruction residual on every iteration. Near an exact fit, evaluate the residual directly in bounded blocks to avoid cancellation in differences of large squared norms.
spca_target().Require rsvd 2.0.0 or later, with R 4.4.0 or later and Matrix 1.7-0 or later to match its dependency requirements. Earlier versions of R and these dependencies are no longer supported. The minimum-version CI job tests exact R 4.4.0, Matrix 1.7-0, rsvd 2.0.0, and testthat 3.3.2. Matrix does not need to be attached by the user. Suggest testthat 3.3.2 or later for running the tests; it is not a runtime dependency.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.