noise: Noise

Description Usage Arguments Details Value Examples

Description

Add random uncertainty for sensitivity analysis.

Usage

1
noise(z, perc = 1e-04, unif = TRUE, ...)

Arguments

z

vector, matrix, or data.frame of observations.

perc

numeric, percent of data range.

unif

logical, use default uniform distribution? Alternative is to use normal distribution.

...

further arguments passed to other functions.

Details

Adds noise, ignoring NA values. If unif=TRUE, then uniformly-distributed noise is bounded within perc percent of the original data range. If unif=FALSE, then normally-distributed noise has standard deviation equal to perc percent of the original data range. Useful for perturbing values for sensitivity analysis.

Value

Matrix of noisified data of same dimensions as 'z'.

Examples

1
2
3
4
5
# iris data
x  <- iris[,1:3]
xn <- noise(x, perc=1)
pairs(x, lower.panel=NULL)
pairs(xn, lower.panel=NULL)

phytomosaic/vuln documentation built on Sept. 21, 2019, 8:23 a.m.