Functions to generate points on a network.
1 2 3 4 5
binomialDesign(n, replications=1, rep.variable = "Time", rep.values) poissonDesign(lambda, replications=1, rep.variable = "Time", rep.values) hardCoreDesign(n, inhibition_region, replications=1, rep.variable = "Time", rep.values) systematicDesign(spacing, replications=1, rep.variable = "Time", rep.values) noPoints
A numeric vector having length 1 or the same length as the number of networks. This represents the number of points to be spread across a network.
A numeric vector having length 1 or the same length as the number of networks. This represents the rate at which points occur on a network.
A numeric vector having length 1 or the same length as the number of networks. This represents the size of the inhibition region on a network.
A numeric vector having length 1 or the same length as the number of networks. This represents the desired spacing for the regular grid of points.
The number of replications of each point.
The name of the variable that will distinguish between the replicated points.
The values that will be given to the variable named
These design functions are intended to be used in the
predDesign inputs of the createSSN function. The
binomialDesign function represents a binomial process - A number
n[i] of points are distributed randomly and uniformly across network
n points if
n is a single number).
poissonDesign function represents a poisson process, where points occur at rate
lambda[i] on network
lambda is a single number).
hardCoreDesign function represents a hard-core process where
n has length 1) points are distributed uniformly and randomly on network
i, and then points are removed until all points are at least
inhibition_region[i] distant from each other (or
inhibition_region has length 1).
systematicDesign function gives a deterministic and regular set of points. Starting from the outlet points are placed upwards along the network, at a fixed distance from the previous point. Note that while the generated grids are regular in a certain sense, they can appear non-regular at certains points from visual inspection. This is because it is impossible to generate a grid of truly equal-spaced points on a network.
The noPoints function simply generates zero points across all networks. Note that this cannot be used as the design for the observed points as there must be at least one observed point. Also this is used directly without any parameters, unlike the other design functions.
A design function must have the form
function(tree.graphs, edge_lengths, locations, edge_updist, distance_matrices)
All inputs to the design function are lists of length
n is the number of trees. Input
an object of class
igraph which represent the ith generated network
in a graph theoretic sense; without any specific locations assigned to the
edge_lengths[[i]] contains the lengths of the edges for the
ith tree, in the same order as the edges appear in the corresponding
igraph object. Input
locations[[i]] is a matrix with
n[i] rows and 2 columns giving the locations of the points on that
edge_updist[[i]] is a numeric vector which gives the upstream
distance from the downstream point of every stream segment, in the same order
as these edges appear in the corresponding
distance_matrices[[i]] is a matrix with
n[i] rows and columns,
giving the network distance between the downstream points of a pair of edges,
where the edges are ordered in the same way as in the
To summarise, on tree number
i if edge number
k has downstream
k_ and edge number
l has downstream point
edge_lengths[[i]][k] gives the length of edge number
edge_updist[[i]][k] gives the distance from point
k_ to the
outlet of the stream network, and
distance_matrices[[i]][k, l] gives
the network distance between points
l_. Note that some
of these inputs may have associated row or column names, but these should be
A design function having the signature mentioned above.
Rohan Shah support@SpatialStreamNetworks.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.