-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
All tests pass for
# specials are correctly handled for estimating method with x, y arguments
m4 <- ml_model$new(formula = y ~ x + offset(log(w)), estimate = glm.fit,
intercept = TRUE, specials = "offset", family = poisson())
m4$estimate(ddata_count)
fit <- glm(y ~ x + offset(log(w)), data = ddata_count, family = poisson())
expect_equal(coef(fit), coef(m4$fit))
# it is currently not possible for the estimate method call to pass arguments
# to targeted::design inside the fitfun
m4 <- ml_model$new(formula = y ~ x + offset(log(w)), estimate = glm.fit,
intercept = TRUE, family = poisson())
m4$estimate(ddata_count, specials = c("offset"))
expect_true(all(coef(fit) != coef(m4$fit)))
The specials argument is not passed on to targeted::design because of
private$fitfun <- function(data, ...) {
xx <- do.call(
targeted::design,
c(list(formula = self$formula, data = data), private$des.args)
)
args <- private$update_args(self$args, ...)
args <- c(list(xx$x), args)
Is this something we would like to fix?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels