Atomize: ** RESERVED FOR INTERNAL USE **

View source: R/z_projections.R

AtomizeR Documentation

** RESERVED FOR INTERNAL USE **

Description

Produce noise to be added to numeric values

Usage

Atomize(n, spray = c("uniform", "triangle", "cosine", "normal"), fwhm = 1/2)

Arguments

n

number of pseudo random values to generate.

spray

defines the distribution used to generate noise values. This can be either "uniform" (default), "triangle", "cosine", or "normal". It is possible to use non-ambiguous abbreviated forms of these keywords.

fwhm

positive numeric value defining the Full Width at Half Maximum of the normal distribution used when spray = "normal". The default value is 0.5 and produces normally distributed noise values with a similar span as when using the triangle and cosine distributions which both have the same FWHM of 0.5 by design.

Value

Atomize returns a numeric vector of length n with values centered at 1/2 and strictly within [0 ; 1] when using the uniform, triangle or cosine distributions.

See Also

UnivariateProjection, BivariateProjection

Examples


## Not run: 

layout(matrix(1:8, 2, 4, byrow = TRUE))
par(pch = ".", col = grey(0, 0.2))

lst <- c("uniform", "triangle", "cosine", "normal")

n <- 10000
x <- y <- rep(1:4, length.out = n)

for(j in lst) {
  u <- x + Atomize(n, spray = j) - 0.5
  v <- y + Atomize(n, spray = j) - 0.5
  plot(u, v, main = j)
}

par(pch = 20, col = grey(0, 0.5))

n <- 25000

for(j in lst) {
  x <- Atomize(n, spray = j)
  d <- ASH1D(x, k = 10)
  plot(x, d, main = j, xlim = c(-0.5, 1.5))
}

## End(Not run)

benja0x40/Barbouille documentation built on March 26, 2023, 11:38 p.m.