View source: R/TestFunctions.R
f1d2_n | R Documentation |
f1d2
Noisy 1d test function (2)
Add Gaussian noise with variance r(x) = scale * (exp(sin(2 pi x)))^2 to f1d2
f1d2_n(x, scale = 1)
x |
scalar or matrix (size n x 1) in [0,1] |
scale |
scalar in [0, Inf] to control the signal to noise ratio |
X <- matrix(seq(0, 1, length.out = 101), ncol = 1)
Xr <- X[sort(sample(x = 1:101, size = 500, replace = TRUE)),, drop = FALSE]
plot(Xr, f1d2_n(Xr))
lines(X, f1d2(X), col = "red", lwd = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.