grad.rankinglogistic: Gradient of the ranking logistic regression risk.

Description Usage Arguments Value Examples

Description

Computes the gradient of the ranking logistic regression error:

f(x) = 1/|comp| sum_{(i,j)\in comp} ( log(1 + exp(- x' * (A_j - A_i) )

for a given design matrix A and a set of pairs (i,j)\in P where the j-th sample is larger than the i-th sample.

Usage

1

Arguments

x

A p-dimensional vector where the gradient is computed.

opts

List of parameters, which must include:

  • A, a n*p design matrix

  • comp, a list of length n, where the i-th entry is a vector containing the indices of the samples j which are larger than sample i.

Value

The gradient of the function f(x) = 1/|comp| sum_{(i,j)\in comp} ( log(1 + exp(- x' * (A_j - A_i) ), which is:

f'(x) = 1/|comp| sum_{(i,j)\in comp} (A_j - A_i) / (1 + exp( x' * ( A_i - A_j) )

Examples

1
grad.rankinglogistic(c(1,3,-2), list(A=diag(3), comp=list(as.integer(c(2,3)),as.integer(3),integer(length=0))))

jpvert/apg documentation built on May 19, 2019, 11:51 p.m.