Skip to contents

Each line's ground-to-response count for a code to itself (ground i x response i): the ordered network's diagonal, which unordered networks drop when they fold to the upper triangle. Pass apply_tensor()$row_connection_counts, or $row_miss_counts for self-misses (ground i present, response i absent). The weight model is applied per line as in finalize_row_connections(): "binary" clamps unordered self-connections to 1 and leaves ordered ones raw.

Usage

finalize_self_connections(row_conn, n_codes, ordered = FALSE, weight = NULL)

Arguments

row_conn

Numeric matrix (n_response_rows x n_codes^2) of per-row directed counts, i.e. apply_tensor()$row_connection_counts

n_codes

Number of codes

ordered

TRUE = keep directed n*n rows; FALSE = fold to choose(n, 2)

weight

Weight model name ("binary", "product", "sqrt", "log1p"), or TRUE/FALSE for the legacy binary flag (TRUE = "binary", FALSE = "product"). NULL (default) = "binary".

Value

Numeric matrix (n_response_rows x n_codes)