check_support {ergmito}R Documentation

Check the convergence of ergmito estimates

Description

This is an internal function used to check the convergence of the optim function.

Usage

check_support(target_stats, stats_statmat, threshold = 0.8, warn = TRUE)

check_convergence(optim_output, model, support, crit = 5)

Arguments

target_stats, stats_statmat

See ergmito_formulae.

threshold

Numeric scalar. Confidence range for flagging an observed statistic as potentially near the boundary.

warn

logical scalar.

optim_output

A list output from the stats::optim function.

model

An object of class ergmito_loglik.

support

As returned by check_support.

crit

Numeric scalar. Level at which a parameter estimate will be questioned.

Value

A list with the following components:

Return codes

The function makes an analysis of the outcome of the model and makes the corresponding adjustments when required. In particular, we check:

  1. Whether the optimization algorithm converged or not

  2. If the obtained estimates maximize the function. If this is not the case, the function checks whether the MLE may not exist. This usually happens when the log-likelihood function can improve by making increments to parameters that are already tagged as large. If the ll improves, then the value is replaced with Inf (+- depending on the sign of the parameter).

  3. If the Hessian is semi-positive-definite, i.e. if it is invertible. If it is not, it usually means that the function did not converged, in which case we will use MASS::ginv instead.

The return codes are composed of two numbers, the first number gives information regarding of the parameter estimates, while the second number give information about the variance-covariance matrix.

Column 1:

Column 2:

Possible codes and corresponding messages:


[Package ergmito version 0.3-1 Index]