infer_profiles_gibbs: Infer methylation profiles using Gibbs sampling

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

View source: R/infer_profiles_gibbs.R

Description

General purpose functions for inferring latent profiles for different observation models using Gibbs sampling. Currently implemented observation models are: 'bernoulli' and 'binomial' and the auxiliary variable approach is used.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
infer_profiles_gibbs(
  X,
  model = NULL,
  basis = NULL,
  H = NULL,
  w = NULL,
  mu_0 = NULL,
  cov_0 = NULL,
  gibbs_nsim = 500,
  gibbs_burn_in = 100,
  store_gibbs_draws = FALSE,
  is_parallel = FALSE,
  no_cores = NULL,
  ...
)

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. If "bernoulli" then C=2 containing the output y (e.g. methylation level).

model

Observation model name as character string. It can be either 'bernoulli' or 'binomial'.

basis

A 'basis' object. E.g. see create_basis. 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.

mu_0

The prior mean hyperparameter vector for w.

cov_0

The prior covariance hyperparameter matrix for w.

gibbs_nsim

Total number of simulations for the Gibbs sampler.

gibbs_burn_in

Burn in period of the Gibbs sampler.

store_gibbs_draws

Logical indicating if we should keep the whole MCMC chain for further analysis.

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.

...

Additional parameters.

Value

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

Details

The modelling and mathematical details for inferring profiles using Gibbs sampling are explained here: http://rpubs.com/cakapourani/ . More specifically:

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

See Also

create_basis, infer_profiles_mle, infer_profiles_vb, create_region_object

Examples

1
2
3
4
5
6
# Example of inferring parameters for synthetic data using 3 RBFs
basis <- create_rbf_object(M=3)
out <- infer_profiles_gibbs(X = binomial_data, model = "binomial",
   basis = basis, is_parallel = FALSE, gibbs_nsim = 10, gibbs_burn_in = 5)

#-------------------------------------

BPRMeth documentation built on Nov. 8, 2020, 5:54 p.m.