R.bounds {streamDAG} | R Documentation |
Bounds for the correlation of two (or more) Benrnoulli random variables
Description
Replaces impossible correlations (values too small or too large) with minimum and maximum correlations, respectively.
Usage
min_r(p1, p2)
max_r(p1, p2)
R.bounds(p, R, pad = 0.001)
Arguments
p1 |
Probability of success for first random variable |
p2 |
Probability of success for second random variable |
p |
Vector of marginal probabilities for multivariate Bernoulli random variables, for |
R |
Raw correlation matrix for random variables |
pad |
Padding (in correlation units) to adjust the returned correlation matrix with respect extremal values. |
Details
The functions r.min
and r.max
define minimum and maximimum possible correlations. The function R.bounds
replaces impossibly large or small values with maximally large or small values repectively.
Value
Functions return a scalar defining minimum or maximimum possible correlations. See Aho et al. (2023).
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
min_r(0.6, 0.9)
max_r(0.1, 0.2)
x1 <- rep(c(1,0),5)
x2 <- c(rep(1,7), rep(0,3))
x3 <- c(rep(1,3), rep(0,7))
R <- cor(cbind(x1, x2, x3))
R.bounds(c(0.5, 0.7, 1), R)