arc.pa.from.nodes {streamDAG} | R Documentation |
Obtain arc stream activity outcomes based on bounding nodes
Description
Given nodal water presence absence data \in \{0,1\}
for a graph, G, the function calculates arc water presence probabilities using particular rules (see approaches in Details).
Usage
arc.pa.from.nodes(G, node.pa, approach = "aho", na.rm = TRUE)
Arguments
G |
Graph object of class |
node.pa |
A data frame or matrix of nodal presence absence data with column names corresponding to node names in |
approach |
One of |
na.rm |
For |
Details
The approach
argument currently supports three alternatives "aho"
, "dstream"
and "ustream"
. Let x_{k}
represent the k
th arc with bounding nodes u
and v
.
Under approach = "aho"
there are three possibilities:
x_{k} = 1.0
if both u
and v
are wet,
x_{k} = 0
if both u
and v
are dry, and
x_{k} = 0.5
if only one of u
or v
is wet.
Under approach = "dstream"
, x_{k} = 1.0
if v
is wet, and x_{k} = 0
if v
is dry.
Conversely, if approach = "ustream"
, x_{k} = 1.0
if u is wet, and x_{k} = 0
if u is dry.
Value
Returns a matrix whose entries are estimated probabilities of success (e.g. surface water presence) based on the rules given in Aho et al. (2023). Matrix columns specify arcs and rows typically represent time series observations.
Author(s)
Ken Aho
References
Aho, K., Derryberry, D., Godsey, S. E., Ramos, R., Warix, S., Zipper, S. (2023) The communication distance of non-perennial streams. EarthArXiv https://eartharxiv.org/repository/view/4907/
Examples
murphy_spring <- graph_from_literal(IN_N --+ M1984 --+ M1909, IN_S --+ M1993,
M1993 --+ M1951 --+ M1909 --+ M1799 --+ M1719 --+ M1653 --+ M1572 --+ M1452,
M1452 --+ M1377 --+ M1254 --+ M1166 --+ M1121 --+ M1036 --+ M918 --+ M823,
M823 --+ M759 --+ M716 --+ M624 --+ M523 --+ M454 --+ M380 --+ M233 --+ M153,
M153 --+ M91 --+ OUT)
data(mur_node_pres_abs)
pa <- mur_node_pres_abs[400:405,][,-1]
arc.pa.from.nodes(murphy_spring, pa)
arc.pa.from.nodes(murphy_spring, pa, "dstream")