samuel-watson / glmmrBase

R package for specifying, fitting, analysing, and simulating generalised linear mixed models
3 stars 0 forks source link

Log likelihood error with binomial-log and binomial-identity #24

Closed samuel-watson closed 8 months ago

samuel-watson commented 11 months ago

Fitting the model below produces NaN for the value of the log-likelihood

df <- nelder(~ind(200) > obs(2))
df$int <- rep(c(0,1),200)

mod <- Model$new(
  formula = ~ int + (1|gr(ind)),
  mean = list(parameters = c(log(0.1)-0.5,log(1.3))),
  covariance = list(parameters = c(1)),
  family = binomial(link = "log"),
  data = df
)

y <- mod$sim_data(type="data")

mod$LA(y$y,method="nloptim",verbose=TRUE)