Learn R Programming

CommKern (version 1.0.1)

ham_distance: Hamiltonian distance matrix creation

Description

Description of the Hamiltonian distance matrix creation function.

Usage

ham_distance(hamil_df)

Value

the Hamiltonian distance matrix to be used as input for the kernel function

Arguments

hamil_df

a data frame containing two columns, one for network ID and another containing Hamiltonian values

Details

This function creates a distance matrix using the Hamiltonian output values from a community detection algorithm that implements a Hamiltonian value, such as the hierarchical multimodal spinglass algorithm. To ensure a positive, semi-definite matrix (as required for the kernel function), the absolute difference between Hamiltonian values is calculated.

The function returns an m x m matrix (where m is the number of networks) to be used as input for the kernel function.

See Also

hms

Examples

Run this code
hamil_df <- data.frame(id  = seq(1:8),
                       ham = c(-160.5375, -167.8426, -121.7128, -155.7245,
                               -113.9834, -112.5262, -117.9724, -171.374))

ham_distance(hamil_df)

Run the code above in your browser using DataLab