arc.pa.from.nodes {streamDAG}R Documentation

Obtain arc stream activity outcomes based on bounding nodes

Description

Given nodal water presence absence data {0,1}\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 igraph. See graph_from_literal.

node.pa

A data frame or matrix of nodal presence absence data with column names corresponding to node names in G.

approach

One of "aho", "dstream", or "ustream" (see Details).

na.rm

For approach = "aho", one of TRUE or FALSE indicating whether NA values should be stripped before calculating means. Ignored for other appraches.

Details

The approach argument currently supports three alternatives "aho", "dstream" and "ustream". Let xkx_{k} represent the kkth arc with bounding nodes uu and vv.

Under approach = "aho" there are three possibilities: xk=1.0x_{k} = 1.0 if both uu and vv are wet, xk=0x_{k} = 0 if both uu and vv are dry, and xk=0.5x_{k} = 0.5 if only one of uu or vv is wet.

Under approach = "dstream", xk=1.0x_{k} = 1.0 if vv is wet, and xk=0x_{k} = 0 if vv is dry.

Conversely, if approach = "ustream", xk=1.0x_{k} = 1.0 if u is wet, and xk=0x_{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")

[Package streamDAG version 1.5 Index]