cluster_profiles_vb {BPRMeth} | R Documentation

## Cluster methylation profiles using VB

### Description

General purpose functions for clustering latent profiles for different observation models using Variational Bayes (VB) EM-like algorithm.

### Usage

    cluster_profiles_vb(
      X,
      K = 3,
      model = NULL,
      basis = NULL,
      H = NULL,
      delta_0 = NULL,
      w = NULL,
      gaussian_l = 50,
      alpha_0 = 0.5,
      beta_0 = 0.1,
      vb_max_iter = 100,
      epsilon_conv = 1e-04,
      is_verbose = FALSE,
      ...
    )

### Arguments

`X` | The input data, which has to be 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).
`K` | Integer denoting the total number of clusters K.
`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.
`delta_0` | Parameter vector of the Dirichlet prior on the mixing proportions pi.
`w` | Optional, an (M+1)xK matrix of the initial parameters, where each column consists of the basis function coefficients for each corresponding cluster k. If NULL, will be assigned with default values.
`gaussian_l` | Noise precision parameter, only used when having "gaussian" observation model.
`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_verbose` | Logical, print results during VB iterations.
`...` | Additional parameters.

### Value

An object of class `cluster_profiles_vb_`"obs_model" with the following elements:

- `W`: An (M+1) X K matrix with the optimized parameter values for each cluster, M are the number of basis functions. Each column of the matrix corresponds a different cluster k.

- `W_Sigma`: A list with the covariance matrices of the posterior parmateter W for each cluster k.

- `r_nk`: An (N X K) responsibility matrix of each observations being explained by a specific cluster.

- `delta`: Optimized Dirichlet paramter for the mixing proportions.

- `alpha`: Optimized shape parameter of Gamma distribution.

- `beta`: Optimized rate paramter of the Gamma distribution

- `basis`: The basis object.

- `lb`: The lower bound vector.

- `labels`: Cluster assignment labels.

- `pi_k`: Expected value of mixing proportions.

### Details

The modelling and mathematical details for clustering profiles using mean-field variational inference are explained here: http://rpubs.com/cakapourani/ . More specifically:

- For Binomial/Bernoulli observation model check: http://rpubs.com/cakapourani/vb-mixture-bpr

- For Gaussian observation model check: http://rpubs.com/cakapourani/vb-mixture-lr

### Author(s)

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

### See Also

`create_basis`, `cluster_profiles_mle` `infer_profiles_vb`, `infer_profiles_mle`, `infer_profiles_gibbs`, `create_region_object`

### Examples

    # Example of optimizing parameters for synthetic data using 3 RBFs
    basis <- create_rbf_object(M=3)
    out <- cluster_profiles_vb(X = binomial_data, model = "binomial",
      basis=basis, vb_max_iter = 10)

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

    basis <- create_rbf_object(M=3)
    out <- cluster_profiles_vb(X = gaussian_data, model = "gaussian",
      basis=basis, vb_max_iter = 10)

[Package BPRMeth version 1.14.1 Index]