bpr_model: Compute the BPR functions

Description Usage Arguments Value Mathematical formula Author(s) See Also

Description

These functions evaluate the BPR model likelihood and gradient using both the Bernoulli and Binomial likelihoods. There are also functions to compute the sum of BPR likelihoods and weighted sum of BPR likelihoods. They are written in C++ for efficiency.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bpr_likelihood(w, H, data, lambda, is_NLL)

bpr_gradient(w, H, data, lambda, is_NLL)

bpr_lik_region(w, x, des_mat, lambda, is_NLL)

bpr_lik_resp(w, x, des_mat, pi_k, lambda, is_NLL)

sum_weighted_bpr_lik(w, x, des_mat, post_prob, lambda, is_NLL)

sum_weighted_bpr_grad(w, x, des_mat, post_prob, lambda, is_NLL)

Arguments

w

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

H

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

data

Either an L x 3 matrix containing in the 1st column are the observations, in the 2nd column the total number of trials and in the 3rd the number of successes or an L x 2 matrix containing the Bernoulli observations in the 2nd column. Each row corresponds to each row of the design matrix.

lambda

The complexity penalty coefficient for penalized regression.

is_NLL

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

x

A list of elements of length N, where each element is an L x 3 matrix of observations, where 1st column contains the locations. The 2nd and 3rd columns contain the total trials and number of successes at the corresponding locations, repsectively. If we have Bernoulli data, then the matrix is L x 2, where the 2nd column contiains the Bernoulli observations.

des_mat

A list of length N, where each element contains the L x M design matrices, where L is the number of observations and M the number of basis functions.

pi_k

Mixing proportions in log scale.

post_prob

A vector of length N containing the posterior probabilities for each element of list x, respectively.

Value

Either the BPR log likelihood or the gradient.

Mathematical formula

The Binomial distributed Probit Regression log likelihood function is computed by the following formula:

log p(y | f, w) = ∑_{l=1}^{L} log Binom(m_{l} | t_{l}, Φ(w^{t}h(x_{l})))

where h(x_l) are the basis functions.

Author(s)

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

See Also

eval_functions, bpr_optimize


andreaskapou/BPRMeth-devel documentation built on May 12, 2019, 3:32 a.m.