Skip to contents

Looks up b_table[d] (clipped to the table size) and uses unreachable_bias for disconnected pairs.

Usage

morie_grphmr_spatial(distance, b_table, unreachable_bias = -10)

Arguments

distance

N x N matrix from shortest_path_matrix.

b_table

Numeric vector of learnable biases indexed by distance.

unreachable_bias

Bias for disconnected pairs; defaults to -10.

Value

A list with bias, unreachable_bias, note.

Examples

D <- matrix(c(0, 1, 2, 1, 0, 1, 2, 1, 0), 3)
morie_grphmr_spatial(D, b_table = c(0.5, 0.2, -0.1))$bias
#>      [,1] [,2] [,3]
#> [1,]  0.5  0.2 -0.1
#> [2,]  0.2  0.5  0.2
#> [3,] -0.1  0.2  0.5