flash_sampler: Generate posterior sampling function

View source: R/sampler.R

flash_samplerR Documentation

Generate posterior sampling function

Description

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.

Usage

flash_sampler(data, f, kset = NULL, fixed = c("factors", "loadings",
  "none"))

Arguments

data

An n by p matrix or a flash data object created using flash_set_data.

f

A fitted flash object.

kset

The indices of factors to be optimized (NULL indicates all factors).

fixed

Indicates whether to fix factors or loadings at their posterior mean. If "none", then both factors and loadings are sampled from their respective posterior means.

Value

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.


stephenslab/flashr2 documentation built on Feb. 6, 2024, 5:21 a.m.