cstep: Perform Concentration Step

View source: R/RcppExports.R

cstepR Documentation

Perform Concentration Step

Description

This function performs concentration steps by iteratively updating the neighborhoods of items based on Mahalanobis distances. The function computes the covariance matrix and updates the neighborhood list until convergence or a maximum number of iterations is reached.

Usage

cstep(init, maxcsteps, which_indices, lambda, weights, mT)

Arguments

init

A list of items where each item contains:

  • mX A matrix of observations (one column per observation).

  • hsets.init A matrix where each column specifies initial indices for neighbors.

  • rho A regularization parameter for covariance estimation.

  • scfac A scaling factor for consistency.

  • mS A covariance matrix of the observations in mX.

  • index (Initially not present; will be updated with indices of neighbors).

  • vdst (Initially not present; will be updated with Mahalanobis distances).

  • stop (Initially not present; used to indicate convergence).

  • ret (Initially not present; will be updated with results from RCOV).

maxcsteps

An integer specifying the maximum number of iterations for the optimization.

which_indices

An integer vector specifying which initial indices to use for each item.

lambda

A numeric value representing the weight for the covariance matrix in the optimization.

weights

A matrix of weights where each element weights(i, j) specifies the weight of the j-th item for the i-th item.

mT

A matrix used for regularization in the covariance matrix calculation.

Details

The function updates the neighborhoods of each item based on Mahalanobis distances, recalculates means and covariances, and checks for convergence. If the neighborhoods do not change between iterations, the optimization stops early.

Value

A list containing:

  • numit An integer representing the number of iterations performed.

  • out The updated list of items with updated neighborhoods and additional information.

  • obj_value A numeric vector of objective values at each iteration, including the initial value.


ssMRCD documentation built on Nov. 5, 2025, 7:44 p.m.