MyNixOS website logo
Description

Simulate Spatial Bernoulli Networks.

Social network analysis is becoming commonplace in many social science disciplines, but access to useful network data, especially among marginalized populations, still remains a formidable challenge. This package mitigates that problem by providing tools to simulate spatial Bernoulli networks as proposed in Carter T. Butts (2002, ISBN:978-0-493-72676-2), "Spatial models of large-scale interpersonal networks." Using this package, network analysts can simulate a spatial point process or sequence with a given number of nodes inside a geographical boundary and estimate the probability of a tie formation between all node pairs. When simulating a network, an analyst can choose between five spatial interaction functions. The package also enables quick comparison of summary statistics for simulated networks and provides simple to use plotting methods for its classes that return plots which can be further refined with the 'ggplot2' package.

spacejamr: Simulate Spatial Bernoulli Networks

R-CMD-check codecov.io

The goal of spacejamr is to enable social network analysis where conventional collection of social network data would be impossible. It does this by providing tools to prepare shapefiles, simulate spatial point processes, generate networks from those point processes using a spatial interaction function. It also contains plot methods that return 'ggplot2' objects that can be further refined.

Installation

You can install the released version of spacejamr from CRAN with:

install.packages("spacejamr")

Simulate a point process or sequence

library(spacejamr)

# Load Rhode Island dataset
data(RI)

# Spatial Poisson point process
ri_points <- PointProcess(points = 5000, window = RI, seed = 88)

# Halton sequence
ri_seq <- haltonSeq(points = 5000, window = RI, seed = 9)

Generate networks from spatial interaction functions

# Standard power law SIF
rinet_standard <- NetSim(point_process = ri_points, base_prob = 0.95, 
                         scale = 100, threshold = 0.5, power = -2.3)

# Attenuated power law SIF
rinet_apl <- NetSim(point_process = ri_points, type = attenuated,
                    base_prob = 0.93, scale = 100, threshold = 0.5, 
                    power = -1.9)

# Arctangent probability law SIF
rinet_arctan <- NetSim(point_process = ri_points, type = arctan,
                       base_prob = 0.93, scale = 100, threshold = 0.5, 
                       power = -1.9)
                    
# Exponential decay law SIF
rinet_arctan <- NetSim(point_process = ri_points, type = decay,
                       base_prob = 0.93, scale = 100, threshold = 0.5, 
                       power = -1.9)
                    
# Logistic probability law SIF
rinet_arctan <- NetSim(point_process = ri_points, type = logistic,
                       base_prob = 0.93, scale = 100, threshold = 0.5, 
                       power = -1.9)

Plot methods

# Boundaries
plot(RI)

# Point process or sequence realization
plot(ri_points)
plot(ri_seq)

# Network generated from SIF
plot(rinet_standard)
plot(rinet_apl)

Compare two simulated networks

compare_networks(rinet_standard, rinet_apl)

About

Creator: Darren Colby
Creater ORCID: 0000-0001-8468-2755
Maintainer: Darren Colby
Maintainer email: [email protected]
Current version: 0.2
License: MIT.

Metadata

Version

0.2.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows