Skip to content

Commit

Permalink
In ergm.MCMLE() for missing data, guard against constrained variance …
Browse files Browse the repository at this point in the history
…being higher than unconstrained on a particular interation by treating the difference as 0 instead.
  • Loading branch information
krivit committed Jan 26, 2024
1 parent c002361 commit 3f3ebbf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/ergm.MCMLE.R
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ ergm.MCMLE <- function(init, s, s.obs,
estdiff <- NVL3(esteq.obs, colMeans(.), 0) - colMeans(esteq)
pprec <- diag(sqrt(control$MCMLE.MCMC.precision), nrow=length(estdiff))
Vm <- pprec%*%(cov(esteq) - NVL3(esteq.obs, cov(.), 0))%*%pprec
novar <- diag(Vm) <= 0
Vm[,novar] <- Vm[novar,] <- 0
d2 <- xTAx_seigen(estdiff, Vm)
if(d2<2) last.adequate <- TRUE
}
Expand Down

0 comments on commit 3f3ebbf

Please sign in to comment.