Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After dropping extreme values, MPLE and MLE likelihoods report different numbers of observations. #574

Open
krivit opened this issue Jul 23, 2024 · 0 comments

Comments

@krivit
Copy link
Member

krivit commented Jul 23, 2024

suppressPackageStartupMessages(library(ergm))
data(sampson)

samplike.m <- as.matrix(samplike, matrix.type="adjacency")
samplike.m[4:10,4:10] <- 0

mple <- ergm(samplike~edges+edgecov(samplike.m))
#> Observed statistic(s) edgecov.samplike.m are at their greatest attainable values. Their coefficients will be fixed at +Inf.
mcmc <- ergm(samplike~edges+edgecov(samplike.m), control=control.ergm(force.main=TRUE, MCMLE.maxit=10))
#> Observed statistic(s) edgecov.samplike.m are at their greatest attainable values. Their coefficients will be fixed at +Inf.
waldo::compare(logLik(mple), logLik(mcmc), tolerance = 0.01)
#> `attr(old, 'nobs')`: 237
#> `attr(new, 'nobs')`: 306
#> 
#> `attr(old, 'br')` is absent
#> `attr(new, 'br')` is a list

Created on 2024-07-23 with reprex v2.1.1

NB: Here, the br attribute being different is as intended. The problem is with nobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant