Computes the likelihood ratio G^2 measure of fit.
likelihood_ratio_chisq(n, pi, exclude_diagonal = FALSE)G^2
Matrix of observed counts
Matrix of same dimensions as n. Model-based matrix of predicted proportions
logical. Should the diagonal cells of a square matrix be excluded from the computation. Default is FALSE. The effect of setting it to TRUE for non-square matrices may be unintuitive and should he avoided.