Description Usage Arguments Details Value Author(s) References See Also Examples
An “experts only” softmax fitting function for the Harville model.
1 2 |
y |
a vector of the ranked outcomes within each group. Only the order within a group matters. |
g |
a vector giving the group indices. Need not be integers, but
that is more efficient. Need not be sorted.
Must be the same length as |
X |
a matrix of the independent variables. Must have as many rows
as the length of |
wt |
an optional vector of the observation level weights. These must
be non-negative, otherwise an error is thrown. Note that the weight of
the last ranked outcome within a group is essentially ignored.
Must be the same length as |
eta0 |
an optional vector of the consensus odds. These are added to
the fit odds in odds space before the likelihood caclulation. If given,
then when the model is used to predict, similar consensus odds must be
given.
Must be the same length as |
normalize_wt |
if |
method |
maximisation method, currently either "NR" (for Newton-Raphson), "BFGS" (for Broyden-Fletcher-Goldfarb-Shanno), "BFGSR" (for the BFGS algorithm implemented in R), "BHHH" (for Berndt-Hall-Hall-Hausman), "SANN" (for Simulated ANNealing), "CG" (for Conjugate Gradients), or "NM" (for Nelder-Mead). Lower-case letters (such as "nr" for Newton-Raphson) are allowed. If missing, a suitable method is selected automatically. |
Given a number of events, indexed by group, and a vector y of the ranks of each entry within that group, perform maximum likelihood estimation under the softmax and proportional probability model.
The user can optionally supply a vector of η_0, which are taken as the fixed, or ‘consensus’ odds. The estimation is then conditional on these fixed odds.
Weighted estimation is supported.
The code relies on the likelihood function of harsmlik
,
and MLE code from maxLik
.
An object of class harsm
, maxLik
, and linodds
.
Steven E. Pav shabbychef@gmail.com
Harville, D. A. "Assigning probabilities to the outcomes of multi-entry competitions." Journal of the American Statistical Association 68, no. 342 (1973): 312-316. http://dx.doi.org/10.1080/01621459.1973.10482425
the likelihood function, harsmlik
, and the
expected rank function (the inverse link), erank
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | nfeat <- 5
set.seed(1234)
g <- ceiling(seq(0.1,1000,by=0.1))
X <- matrix(rnorm(length(g) * nfeat),ncol=nfeat)
beta <- rnorm(nfeat)
eta <- X %*% beta
y <- rsm(eta,g)
mod0 <- harsmfit(y=y,g=g,X=X)
summary(mod0)
# now upweight finishers 1-5
modw <- harsmfit(y=y,g=g,X=X,wt=1 + as.numeric(y < 6))
summary(modw)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.