Error in `object@min`: no applicable method for `@` applied to an object of class "mle"

test_that("mle constructor stores all fields", {
test_that("mle constructor handles NULL fields", {
test_that("is_mle returns FALSE for non-mle objects", {
test_that("coef.mle returns same as params", {
fit <- mle(theta.hat = c(a = 1, b = 2), sigma = diag(2))
test_that("logLik.mle returns proper logLik object", {
fit <- mle(theta.hat = c(a = 1, b = 2), sigma = diag(2),
test_that("logLik.mle returns NULL when loglike is NULL", {
test_that("AIC and BIC work via logLik", {
test_that("nparams returns correct count", {
fit2 <- mle(theta.hat = c(a = 1, b = 2, c = 3))
fit <- mle(theta.hat = c(a = 1, b = 2), loglike = -50, sigma = diag(2))
test_that("se returns sqrt of diagonal of vcov", {
sigma <- matrix(c(4, 1, 1, 9), nrow = 2)
fit <- mle(theta.hat = c(a = 0, b = 0), sigma = sigma)
test_that("se returns NULL when vcov is NULL", {
fit <- mle(theta.hat = c(x = 1), sigma = 4)
test_that("confint returns correct structure", {
fit <- mle(theta.hat = c(mu = 5), sigma = matrix(0.25), nobs = 100L)
test_that("confint respects level parameter", {
fit <- mle(theta.hat = c(x = 0), sigma = matrix(1), nobs = 50L)
test_that("confint errors without vcov", {
test_that("bias.mle returns zero vector (asymptotic)", {
test_that("mse.mle equals vcov when bias is zero", {
fit <- mle(theta.hat = c(a = 1, b = 2), sigma = sigma)
test_that("mse.mle with scalar parameter", {
fit <- mle(theta.hat = c(x = 5), sigma = 0.25)
test_that("orthogonal detects diagonal FIM", {
fit <- mle(theta.hat = c(a = 1, b = 2), sigma = solve(info), info = info)
# Off-diagonals should be TRUE (near zero), diagonals FALSE (not near zero)
test_that("orthogonal returns NULL when no FIM", {
test_that("marginal extracts correct subset", {
fit <- mle(theta.hat = theta, sigma = sigma, nobs = 50L)
expect_equal(params(m), c(a = 1, c = 3))
expect_equal(vcov(m), sigma[c(1, 3), c(1, 3)])
test_that("marginal errors on empty or invalid indices", {
test_that("sampler.mle univariate returns numeric vector", {
fit <- mle(theta.hat = c(x = 5), sigma = 0.1)
test_that("sampler.mle multivariate returns matrix", {
fit <- mle(theta.hat = c(a = 1, b = 2), sigma = diag(c(0.1, 0.2)))
test_that("summary returns summary_mle object", {
fit <- mle(theta.hat = c(x = 5), sigma = matrix(0.1), loglike = -20)
test_that("superclasses are prepended to class vector", {
fit <- mle(theta.hat = c(x = 1), superclasses = "my_custom_mle")