ergm icon indicating copy to clipboard operation
ergm copied to clipboard

ergm.mple() should accept two-column response output from ergm.pl().

Open krivit opened this issue 3 years ago • 0 comments

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)

krivit avatar Dec 03 '21 01:12 krivit