infer_profiles_mle: Infer methylation profiles using MLE

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

View source: R/infer_profiles_mle.R

Description

General purpose functions for inferring latent profiles for different observation models using maximum likelihood estimation (MLE). Current observation models are: 'bernoulli', 'binomial', 'beta' or 'gaussian'. For most models we cannot obtain an analytically tractable solution, hence an optimization procedure is used. The optim package is used for performing optimization.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
infer_profiles_mle(
  X,
  model = NULL,
  basis = NULL,
  H = NULL,
  lambda = 0.5,
  w = NULL,
  beta_dispersion = 5,
  opt_method = "CG",
  opt_itnmax = 100,
  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" or "gaussian" model, then C=2 containing the output y (e.g. methylation level). If "beta" model, then C=3, where 2nd column contains output y and 3rd column the dispersion parameter.

model

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

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.

lambda

The complexity penalty coefficient for ridge regression.

w

A vector of initial parameters (i.e. coefficients of the basis functions).

beta_dispersion

Dispersion parameter, only used for Beta distribution and will be the same for all observations.

opt_method

The optimization method to be used. See optim for possible methods. Default is "CG".

opt_itnmax

Optional argument giving the maximum number of iterations for the corresponding method. See optim for details.

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_mle_"obs_model" with the following elements:

Details

The beta regression model is based on alternative parameterization of the beta density in terms of the mean and dispersion parameter: https://cran.r-project.org/web/packages/betareg/ . For modelling details for Binomial/Bernoulli observation model check the paper for BPRMeth: https://academic.oup.com/bioinformatics/article/32/17/i405/2450762 .

Author(s)

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

See Also

create_basis, infer_profiles_vb, infer_profiles_gibbs, create_region_object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Example of optimizing parameters for synthetic data using 3 RBFs
basis <- create_rbf_object(M=3)
out <- infer_profiles_mle(X = binomial_data, model = "binomial",
   basis = basis, is_parallel = FALSE, opt_itnmax = 10)

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

basis <- create_rbf_object(M=3)
out <- infer_profiles_mle(X = beta_data, model = "beta",
   basis = basis, is_parallel = FALSE, opt_itnmax = 10)

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

basis <- create_rbf_object(M=3)
out <- infer_profiles_mle(X = gaussian_data[[1]], model = "gaussian",
   basis = basis, is_parallel = FALSE, opt_itnmax = 10)

andreaskapou/BPRMeth documentation built on June 11, 2020, 10:49 p.m.