tests/testthat/test-mle.R

context("mle_pe, mle_p, and mle_e")

test_that("mle_pe works", {

    data(mbmixdata)

    expected <- structure(c(p = 0.744841169389641, e = 0.00284299905444711, loglik = -3005967.16862983,
                            lrt_p0 = 3611308.87945943, lrt_p1 = 820483.428998603),
                          SE = c(p = 0.000349271095363225, e = 0.0000267534146778811))

    expect_equal(mle_pe(mbmixdata, SE=TRUE), expected)

    attr(expected, "SE") <- NULL
    expect_equal(mle_pe(mbmixdata), expected)

})

Try the mbmixture package in your browser

Any scripts or data that you put into this service are public.

mbmixture documentation built on April 4, 2025, 1:44 a.m.