harsm_invlink: The inverse link for the softmax.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.r

Description

The inverse link function for the softmax. This function takes the group-wise probabilities, μ, and computes the expected ranks within each group under the Harville model. That is, it is a groupwise computation of the erank function.

Usage

1
harsm_invlink(eta, mu = smax(eta, g), g = NULL)

Arguments

eta

a vector of the odds. Must be the same length as g if g is given.

mu

a vector of the probabilities. Should sum to one, at least per group. Should be the same size as g if given. If both mu and eta are given, a warning is issued, and the mu is used.

g

a vector giving the group indices. If NULL, then we assume only one group is in consideration.

Value

a vector of the ranks.

Author(s)

Steven E. Pav shabbychef@gmail.com

See Also

the ungrouped version of this, erank.

Examples

1
2
3
4
5
mus <- runif(12)
mus <- mus / sum(mus)
harsm_invlink(mus)

harsm_invlink(mus,c(rep(1,6),rep(2,6)))

ohenery documentation built on Oct. 30, 2019, 9:53 a.m.