hbfm.fit: Hierarchical Bayesian factor model MCMC sampler

Description Usage Arguments Value Examples

View source: R/hbfm_functions.R

Description

Function used to implement the MCMC sampler for the hierarchical Bayesian factor model (HBFM) defined in the "A sparse Bayesian factor model for the construction of gene co-expression networks from single-cell RNA sequencing count data" manuscript.

Usage

1
2
3
hbfm.fit(stoc.em.param, M = 4000, M.save = 1000, M.ll.seq = 10,
  H = 50, phi.scale = 0.25, par.samp = FALSE, seed = 123,
  verbose = FALSE)

Arguments

stoc.em.param

object of hbfm.par-class created by the stoc.em function

M

total number of MCMC iterations

M.save

number of iterations to be used for correlation estimation; the final M.save iterations from the M number of MCMC iterations will be saved for further analysis

M.ll.seq

intervals for calculating marginal log-likelihood before final M.save iterations; used to reduce computational time

H

number of lambda draws for marginal log-likelihood calculation

phi.scale

lognormal scale parameter used when drawing candidate values of phi in Metropolis-Hastings step; can be used to adjust acceptance rate of phi samples

par.samp

if TRUE, samples of each parameter in hbfm.fit for each MCMC iteration are saved; if FALSE only the calculated parameters of correlation and marginal log-likelihood are saved

seed

seed for random number generation

verbose

if TRUE, hbfm.fit status is displayed at every 100th iteration

Value

hbfm.fit-class object containing:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
## Load dataset
data(gene.mat)

## Run stochastic EM first
## Consider F=5 factors
fit1 <- stoc.em(Y=gene.mat, Fac = 5)

## Run MCMC sampler with initial parameter values from stoc.em
fit.res1 <- hbfm.fit(fit1)

## End(Not run)

mnsekula/hbfm documentation built on June 29, 2020, 5:12 a.m.