Learn R Programming

spacejamr (version 0.2.1)

NetSim: Simulate a network from a point process or sequence

Description

Simulates a spatial Bernoulli network from a NetSim object using one of six probability law distributions.

Usage

NetSim(point_sim, sif, base_prob, scale, threshold, power)

Arguments

point_sim

a PointSim object

sif

the spatial interaction function to use. Use attenuated to use an attenuated power law; arctan to use an arctangent probability law; decay to use an exponential decay law; or logistic to use a logistic probability law. Default is a standard power law function.

base_prob

the theoretical probability that two nodes (points) with distance 0 share a tie. Default is 0.9.

scale

a coefficient to multiply the distance by. Default is 1.

threshold

if two node exceed this probability, they will be coded as having a tie. Default is 0.5.

power

the exponent at which tie probability decays. Default is -2.8.

Value

A network object of class 'NetSim' and 'igraph' that can be manipulated using the igraph' package.

Details

The algorithm proceeds in three steps. First, it calculates the distance between simulated points from a PointSim object. Then it calculates the distance between all pairs of points. Finally, it uses a spatial interaction function to calculate that any two point share a tie. If the threshold is exceeded, a tie is created.

References

Butts, Carter T. Spatial models of large-scale interpersonal networks. Dissertation. (2002).

Examples

Run this code
# NOT RUN {
# Load spacejamr object
data("RI")

ri_points <- PointSim(points = 10, window = RI, seed = 42)
power_law <- NetSim(ri_points, base_prob = 0.92, scale = 1, threshold = 0.5,
                    power = -2.4)

# }

Run the code above in your browser using DataLab