model_log_likelihood: Compute observation model log-likelihood

Description Usage Arguments Value Author(s) See Also

Description

These functions evaluate the model log-likelihood and gradient for different observation models. Available models are "bpr" (i.e. "bernoulli" or "binomial"), "beta" and "lr" (i.e. "gaussian"). There are also functions to compute the sum and weighted sum of the observation model likelihoods, e.g. required for the EM algorithm. These functions are written in C++ for efficiency.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
bpr_log_likelihood(w, X, H, lambda, is_nll)

bpr_gradient(w, X, H, lambda, is_nll)

betareg_log_likelihood(w, X, H, lambda, is_nll)

betareg_gradient(w, X, H, lambda, is_nll)

sum_weighted_bpr_lik(w, X_list, H_list, r_nk, lambda, is_nll)

sum_weighted_bpr_grad(w, X_list, H_list, r_nk, lambda, is_nll)

sum_weighted_betareg_lik(w, X_list, H_list, r_nk, lambda, is_nll)

sum_weighted_betareg_grad(w, X_list, H_list, r_nk, lambda, is_nll)

lr_log_likelihood(w, X, H, lambda = 0.5, is_nll = FALSE)

Arguments

w

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

X

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. Each row corresponds to each row of the design matrix H.

H

The L x M matrix design matrix, where L is the number of observations and M the number of basis functions.

lambda

The complexity penalty coefficient for penalized regression.

is_nll

Logical, indicating if the Negative Log Likelihood should be returned.

X_list

A list of elements of length N, where each element is an L x K matrix of observations X.

H_list

A list of elements of length N, where each element contains the L x M design matrices H.

r_nk

A vector of length N containing the posterior probabilities (i.e. responsibilities) for each element of X_list.

Value

Returns the log likelihood or gradient of the observation model.

Author(s)

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

See Also

eval_functions, infer_profiles_mle


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