infer_profiles_vb: Infer methylation profiles using VB

Description Usage Arguments Value Details Author(s) See Also Examples

View source: R/infer_profiles.R

Description

General purpose functions for inferring latent profiles for different observation models using Variational Bayes (VB). Current observation models are: 'bernoulli', 'binomial'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
infer_profiles_vb(
  X,
  basis = NULL,
  H = NULL,
  w = NULL,
  alpha_0 = 0.5,
  beta_0 = 0.1,
  vb_max_iter = 100,
  epsilon_conv = 1e-05,
  is_parallel = TRUE,
  no_cores = NULL,
  is_verbose = FALSE,
  ...
)

Arguments

X

The input data, either a matrix or a list of elements of length N, where each element is an L X C matrix, where L are the total number of observations. The first column contains the input observations x (i.e. CpG locations). If "binomial" model then C=3, and 2nd and 3rd columns contain total number of trials and number of successes respectively.

basis

A 'basis' object. E.g. see create_rbf_object. If NULL, will an RBF object will be created.

H

Optional, design matrix of the input data X. If NULL, H will be computed inside the function.

w

A vector of initial parameters (i.e. coefficients of the basis functions). If NULL, it will be initialized inside the function.

alpha_0

Hyperparameter: shape parameter for Gamma distribution. A Gamma distribution is used as prior for the precision parameter tau.

beta_0

Hyperparameter: rate parameter for Gamma distribution. A Gamma distribution is used as prior for the precision parameter tau.

vb_max_iter

Integer denoting the maximum number of VB iterations.

epsilon_conv

Numeric denoting the convergence threshold for VB.

is_parallel

Logical, indicating if code should be run in parallel.

no_cores

Number of cores to be used, default is max_no_cores - 1.

is_verbose

Logical, print results during VB iterations.

...

Additional parameters.

Value

An object of class infer_profiles_vb_"obs_model" with the following elements:

Details

The modelling and mathematical details for inferring profiles using mean-field variational inference are explained here: http://rpubs.com/cakapourani/variational-bayes-bpr

Author(s)

Hongen Kang geneprophet@163.com

See Also

create_rbf_object, create_region_object

Examples

1
2
3
4
5
6
7
# Example of inferring parameters for synthetic data using 8 RBFs
## Not run: 
basis_profile <- create_rbf_object(M=8)
human_fit_profiles <- infer_profiles_vb(X = human_obj$met, basis = basis_profile,
                                        is_parallel = TRUE, vb_max_iter = 100)

## End(Not run)

geneprophet/BSDMR documentation built on March 3, 2021, 5:50 a.m.