sgdMPM: Calculate MAP estimators for Multinomial Preference Model

Description Usage Arguments Details Value References Examples

View source: R/sgdMPM.R

Description

This function calculates MAP estimators for the score, uncertainty and adherence parameters of Multinomial Preference Model (Volkovs and Richard, 2012). The prior on scores is a multivariate normal distribution, and the priors on uncertainty and adherence are both improper, flat priors (on the whole real line).

Usage

1
sgdMPM(data, mu, sigma, rate, maxiter = 1000, tol = 1e-09, start, decay = 1.1)

Arguments

data

a n * m matrix, where n is the number of observers and m is the number of items to rank; each row vector is a partial or complete ranking, with i-th element being the rank assined to item i; the entry where that item is not ranked in the partial ranking is replaced by 0

mu

the mean vector of the normal prior on scores

sigma

the covariance matrix of the normal prior on scores

rate

the learning rate/stepsize

maxiter

the maximal number of iterations

tol

if the L-2 norm of the change of target function values is less than tol, we assert convergence

start

a length 2 * m + n vector of the starting value of parameters; the first m elements are the starting values for scores, the next m elements are the starting values for uncertainty, and the next n elements are the starting values for adherences of observers

decay

the learning rate is divided by decay if the target function value doesn't decrease; this number is set to be 1.1 by default

Details

The score parameter measures the "competence" of each item, the uncertainty parameter measures the "variance" of the "competence" of each item, and the adherence parameter measures each observer's degree of disagreement with the real ranking. We assign a normal prior on the score parameter in order to incorporate the information from the additive relationship matrix. The MAP estimators for scores, uncertainties and adherences are calculated using stochastic gradient descent algorithm.

Value

Return a list with 5 components

value

a vector which stores the value of the target function to optimize over all iterations

niter

number of iterations to reach convergence

score

the MAP estimator for scores

uncertainty

the MAP estimator for uncertainties

adherence

the MAP estimator for adherences

References

Volkovs, Maksims N., and Richard S. Zemel. "A flexible generative model for preference aggregation." Proceedings of the 21st international conference on World Wide Web. ACM, 2012.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#synthetic data with 3 items to rank and 2 observers
#the first observer ranks item 1 \succ item 2
#the second observer ranks item 1 \succ item 3 \succ item 2
data = rbind(c(1, 2, 0), c(1, 3, 2))

#set up the prior
mu = c(1, 1, 1)
sigma = diag(1, 3)

#set up the starting values
start = rep(1, 3+3+2)

res = sgdMPM(data, mu, sigma, 0.1, 1000, 1e-8, start, 1.1)

res$value
res$niter
res$score
res$uncertainty
res$adherence

shuxiaoc/agRank documentation built on May 29, 2019, 9:27 p.m.