sum_weighted_bpr_grad: Sum of weighted gradients of the BPR log likelihood

Description Usage Arguments Value See Also

Description

sum_weighted_bpr_grad computes the sum of the gradients of BPR log likelihood for each elements of x, and then weights them by the corresponding posterior probabilities. This function is mainly used for the M-Step of the EM algorithm bpr_EM.

Usage

1
sum_weighted_bpr_grad(w, x, des_mat, post_prob, is_NLL = TRUE)

Arguments

w

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

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.

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.

post_prob

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

is_NLL

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

Value

A vector with weighted sum of the gradients of BPR log likelihood.

See Also

bpr_gradient, bpr_EM


andreaskapou/mpgex documentation built on May 12, 2019, 3:33 a.m.