Nothing
## Using the artificial example in ?PlackettLuce
R <- matrix(c(1, 2, 0, 0,
4, 1, 2, 3,
2, 1, 1, 1,
1, 2, 3, 0,
2, 1, 1, 0,
1, 0, 3, 2), nrow = 6, byrow = TRUE)
colnames(R) <- c("apple", "banana", "orange", "pear")
tol <- 1e-6
model_fruits1 <- PlackettLuce(rankings = R)
model_fruits2 <- PlackettLuce(rankings = R, method = "BFGS",
control = list(reltol = 1e-10))
test_that("BFGS gives same log-likelihood as iterative scaling", {
expect_equal(logLik(model_fruits1), logLik(model_fruits2),
tolerance = tol)
})
test_that("BFGS gives same coef as iterative scaling", {
expect_equal(coef(model_fruits1), coef(model_fruits2),
tolerance = tol, ignore_attr = TRUE)
})
if (require(lbfgs)){
model_fruits3 <- PlackettLuce(rankings = R, method = "L-BFGS",
gtol = 0.2)
test_that("L-BFGS gives same log-likelihood as iterative scaling", {
expect_equal(logLik(model_fruits1), logLik(model_fruits3),
tolerance = tol)
})
test_that("L-BFGS gives same coef as iterative scaling", {
expect_equal(coef(model_fruits1), coef(model_fruits3),
tolerance = tol, ignore_attr = TRUE)
})
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.