TestFunctions (version 0.2.0)

add_noise: add_noise: Adds noise to any function

Description

add_noise: Adds noise to any function

Usage

add_noise(func, noise = 0, noise_type = "Gauss")

Value

A function that has noise

Arguments

func

Function to add noise to.

noise

Standard deviation of Gaussian noise

noise_type

Type of noise, only option now is "Gauss" for Gaussian noise.

Examples

Run this code
tf <- add_noise(function(x)sin(2*x*pi));curve(tf)
tf <- add_noise(function(x)sin(2*x*pi), noise=.1);curve(tf)

Run the code above in your browser using DataLab