Generates function that samples LF from a flash fit object, with either L or F fixed at its posterior mean and the columns of F or L sampled independently from their marginal posteriors.
flash_lf_sampler(data, f, kset = NULL, ebnm_fn = ebnm_pn, fixed = c("factors", "loadings"))
| data | a flash data object |
|---|---|
| f | a flash fit object |
| kset | the indices of factor/loadings to include when sampling LF (defaults to all) |
| ebnm_fn | function used to solve the Empirical Bayes Normal Means problem |
| fixed | indicates whether to fix factors or loadings at their posterior mean |
A function that takes a single parameter nsamp, the number of samples of LF to be produced by the sampler. Care should be used when setting nsamp, because the sampler returns a list of matrices which are each of the same size as the data matrix.