
Log-likelihood of network histogram fits
logLik.network_histogram.RdExtracts the Bernoulli log-likelihood of a fitted network histogram. The
method is defined on the common base class, so it applies to
nethist, multinethist, and hnethist objects alike; see
network_histogram-class.
Usage
# S3 method for class 'network_histogram'
logLik(object, normalized = FALSE, ...)Arguments
- object
a
network_histogramobject, that is, a fit returned bynethist,multinethist, orhnethist.- normalized
logical. If
FALSE(default), the unnormalized log-likelihood is returned as alogLikobject. IfTRUE, the per-edge normalized value stored inobject$normalized_LLis returned as a plain numeric.- ...
currently unused.
Value
With normalized = FALSE, an object of class logLik carrying
df and nobs attributes, so that stats::AIC() and
stats::BIC() work directly on the fit. With normalized = TRUE, an
unclassed numeric equal to object$normalized_LL.
Details
The normalized value is not given class logLik on purpose. Passing a
per-edge normalized value to AIC() or BIC() would return a
meaningless number without any error.
The degrees of freedom count the free block probabilities: k * (k + 1)
/ 2 for nethist, where k is the number of blocks; the same
for multinethist fitted with common_f = TRUE, and L
times that for L layers otherwise; and s, the number of
selected shapes, for hnethist.
The number of observations is the number of Bernoulli edge variables, i.e.
n * (n - 1) / 2 for a single layer and L times that for
L layers.
The log-likelihood is evaluated at the fitted probability matrix regardless
of method, so it is also available for method = "LSE" fits.