Sets factor/loadings pairs to zero if doing so improves the variational lower bound (ELBO). See flash for examples of usage.

flash_nullcheck(flash, kset = NULL, remove = TRUE, tol = NULL, verbose = NULL)

Arguments

flash

A flash or flash_fit object.

kset

A vector of integers specifying which factors to nullcheck. If kset = NULL, then all existing factors will be checked.

remove

Whether to remove factors that have been set to zero from the flash object. Note that this might change the indices of existing factors.

tol

The "tolerance" parameter: if a factor does not improve the ELBO by at least tol, then it will be set to zero. Note that flash_nullcheck does not respect "global" tolerance parameters set by flash_set_conv_crit (which only affects the convergence tolerance for greedy fits and backfits). The default tolerance is \(np\sqrt{\epsilon}\), where \(n\) is the number of rows in the dataset, \(p\) is the number of columns, and \(\epsilon\) is equal to .Machine$double.eps.

verbose

When and how to display progress updates. For nullchecks, updates are only displayed when verbose > 0.

Value

The flash object from argument flash, with factors that do not improve the ELBO by at least tol either set to zero or removed (depending on the argument to parameter remove).