ergm
ergm copied to clipboard
ergm.mple() should accept two-column response output from ergm.pl().
This is a follow-up on #246. The main issue is that two-column GLM output produces different log-likelihood values due to the binomial coefficient, and this will need to be adjusted. I.e.,
y <- rbinom(100,1,.5)
x <- floor(runif(100,1,5))
glm01 <- (glm(y~x, family="binomial"))
f <- table(x,y)[,2:1]
glmf <- glm(f~I(1:4), family="binomial")
coef(glm01)-coef(glmf)
#> (Intercept) x
#> 2.020606e-14 -1.265654e-14
logLik(glmf)-logLik(glm01) - sum(lchoose(rowSums(f), f[,1]))
#> 'log Lik.' -7.105427e-15 (df=2)
Created on 2021-12-03 by the reprex package (v2.0.1)