rThurstone: Sampler for Thurstone Model

Description Usage Arguments Details Value References Examples

View source: R/rThurstone.R

Description

Given a vector of scores and a vector of variances, sample a full ranking from the Thurstone model. The length of the ranking is the same as the length of the score vector.

Usage

1
rThurstone(S, Svar)

Arguments

S

vector of scores

Svar

vector of variances corresponding to each item

Details

Thurstone model describes a ranking process by sampling from normal distributions (Thurstone, 1927). An item i has a score s_i and an associated variance v_i. We sample a value independently for each item from N(s_i, v_i) and sort the resulting values in the decreasing order. This process gives rise to a ranking of all the items.

Value

Return a list with two components:

ranks

a vector where the i-th element is the rank assigned to the i-th item.

ranking

a vector where the i-th element is the item ranked in the i-th place

References

Thurstone, Louis L. "A law of comparative judgment." Psychological review 34.4 (1927): 273.

Examples

1
2
3
4
5
6
7
8
#random score vector
S = runif(10, 1, 10)
#random variance vector
Svar = runif(10, 0, 5)

res = rThurstone(S, Svar)
res$ranks
res$ranking

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