arc.pa.from.nodes {streamDAG} | R Documentation |
Obtain arc stream activity outcomes based on bounding nodes
Description
Given nodal water presence absence data 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 represent the
th arc with bounding nodes
and
.
Under approach = "aho"
there are three possibilities:
if both
and
are wet,
if both
and
are dry, and
if only one of
or
is wet.
Under approach = "dstream"
, if
is wet, and
if
is dry.
Conversely, if approach = "ustream"
, if u is wet, and
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")