Expected `fit_irls` to equal `fit_irls_expected`.
Differences:
environment(actual$family$variance)$okLinks[3:6] vs environment(expected$family$variance)$okLinks[3:5]
  "cloglog"
  "cauchit"
  "log"
- "identity"

test_that("estimNLR - examples at help page", {
match <- scale(rowSums(GMAT[, 1:20])) # standardized total score
group <- GMAT[, "group"] # group membership variable
# formula for 3PL model with the same guessing for both groups,
M <- formulaNLR(model = "3PLcg", type = "both", parameterization = "irt")
# starting values for 3PL model with the same guessing for item 1
start <- startNLR(GMAT[, 1:20], group, model = "3PLcg", parameterization = "irt")
lower = M$M1$lower, upper = M$M1$upper, start = start
# saveRDS(fit_nls, file = "tests/testthat/fixtures/estimNLR_fit_nls.rds")
expect_equal(fit_nls, fit_nls_expected, tolerance = 1e-3)
# saveRDS(fit_mle, file = "tests/testthat/fixtures/estimNLR_fit_mle.rds")
expect_equal(fit_mle, fit_mle_expected, tolerance = 1e-3)
# formula for 3PL model with the same guessing for both groups
M <- formulaNLR(model = "3PLcg", type = "both", parameterization = "is")
# starting values for 3PL model with the same guessing for item 1,
start <- startNLR(GMAT[, 1:20], group, model = "3PLcg", parameterization = "is")
# saveRDS(fit_em, file = "tests/testthat/fixtures/estimNLR_fit_em.rds")
expect_equal(fit_em, fit_em_expected, tolerance = 1e-3)
# saveRDS(fit_plf, file = "tests/testthat/fixtures/estimNLR_fit_plf.rds")
expect_equal(fit_plf, fit_plf_expected, tolerance = 1e-3)
# iteratively reweighted least squares for 2PL model
M <- formulaNLR(model = "2PL", parameterization = "logistic")
# saveRDS(fit_irls, file = "tests/testthat/fixtures/estimNLR_fit_irls.rds")
expect_equal(fit_irls, fit_irls_expected, tolerance = 1e-3)