simUnivariate: Simulate noisy observations from a function

View source: R/helper_functions.R

simUnivariateR Documentation

Simulate noisy observations from a function

Description

Builds upon the make.signal() function (originally in the wmtsa package) to include Gaussian noise with a user-specified root-signal-to-noise ratio.

Usage

simUnivariate(signalName = "bumps", T = 200, RSNR = 10, include_plot = TRUE)

Arguments

signalName

string matching the "name" argument in the make.signal() function, e.g. "bumps" or "doppler"

T

number of points

RSNR

root-signal-to-noise ratio

include_plot

logical; if TRUE, include a plot of the simulated data and the true curve

Value

a list containing

  • the simulated function y

  • the true function y_true

  • the true observation standard devation sigma_true

Note

The root-signal-to-noise ratio is defined as RSNR = [sd of true function]/[sd of noise].

Examples

sims = simUnivariate() # default simulations
names(sims) # variables included in the list


drkowal/dsp documentation built on July 19, 2023, 11:42 a.m.