Skip to content

Commit

Permalink
In MCMC SE calculation, handle the case of the Hessian not SNND.
Browse files Browse the repository at this point in the history
  • Loading branch information
krivit committed Jan 25, 2024
1 parent ff704e4 commit b2f9a06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/ergm.MCMCse.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ ergm.MCMCse <- function(model, theta, init, statsmatrices, statsmatrices.obs,

mc.cov <- matrix(NA,ncol=length(novar),nrow=length(novar))

if(sum(!novar)==0 || srcond(-H) < .Machine$double.eps){
if(sum(!novar)==0 || ERRVL(try(srcond(-H) < .Machine$double.eps, TRUE), TRUE)){
warning("Approximate Hessian matrix is singular. Standard errors due to MCMC approximation of the likelihood cannot be evaluated. This is likely due to insufficient MCMC sample size or highly correlated model terms.", call.=FALSE)
}else{
mc.cov0 <- sandwich_ssolve(-H, cov.zbar)
Expand Down

0 comments on commit b2f9a06

Please sign in to comment.