GitHub - 000Justin000/spatial_core_periphery: spatial core-periphery model inspired by small-world network (original) (raw)

Detecting Core-Periphery Structure in Spatial Networks

This repository hosts the code and some example data for the following paper:

Detecting Core-Periphery Structure in Spatial Networks
Junteng Jia and Austin R. Benson
arXiv:1808.06544, 2018.

Our paper introduce a random network model for networks with core-periphery structure, where each vertex is associated with a real-valued core score to denote its role as a core. A user can do one of the following two things:

We have demonstrate in our paper that:

Our code is written in Julia 0.6.

Model inference

Given vertex coordinates and network topology, our model infer the vertex core scores by a maximum likelihood estimation. Here is the code snippet for inferencing the vertex core scores for the celegans dataset.

theta, epsilon = SCP_FMM.model_fit(A, coords, Euclidean_CoM2, Euclidean(), epsilon; opt=opt);

Output:

Input:

Network generation

Given vertex coordinates and vertex core scores, our model sample an instance of random network. Here is the code snippet for generating a random network for celegans dataset.

B = SCP_FMM.model_gen(theta, coords, Euclidean_CoM2, Euclidean(), epsilon; opt=opt);

Output:

Examples

For a more detailed explanation, please (see examples). For instance, the following code snippet reproduces figure 4 (A) in our paper.

include("examples/celegans_naive.jl"); include("examples/celegans_fmm.jl"); using Plots;

Plots.plot(size=(550,500),-5.0:0.1:1.0,-5.0:0.1:1.0,framestyle=:box,label="ideal",color="red",legend=:topleft); Plots.scatter!(theta0,theta,label="experiment",color="blue")

If you have any questions, please email to jj585@cornell.edu.