error_propagation: Error Propagation

View source: R/error_propagation.R

error_propagationR Documentation

Error Propagation

Description

Propagate uncertainty using variance properties for addition, subtraction, and multiplication and the first order Taylor expansion (i.e., delta method) for the division of two random variables.

Usage

error_propagation(
  fx = c("addition", "subtraction", "product", "division"),
  type = c("both_random", "y_constant"),
  x,
  se.x,
  y,
  se.y = NULL,
  alpha = 0.05
)

Arguments

fx

the function being applied; c("addition", "subtraction", "product","division").

type

set both x and y as random variables (type = "both_random") or define y as a constant (type = "y_constant").

x

vector of random variables

se.x

standard error of x

y

vector of random variables

se.y

standard error of y

alpha

type I error rate. Default is set at 0.05 to produce 95% confidence intervals.

Author(s)

Ryan N. Kinzer

Examples

x <- rnorm(10, 0, 1)
y <- rnorm(10, 5, 10)
se.x <- rep(2,10)
se.y <- rep(10,10)
error_propagation("division", "both_random", x, se.x, y, se.y)

ryankinzer/cuyem documentation built on April 20, 2024, 2:10 p.m.