Simulate noisy observations

sim.create_y(noise_type, f, snr, phi, gamma, N_trials)

Arguments

noise_type

Either "gaussian", "poisson", "nb" (negative binomial), "binomial", or "bb" (beta-binomial).

f

The underlying signal.

snr

The desired signal-to-noise ratio. This argument is valid only when noise_type is "gaussian".

phi

The inverse overdispersion parameter for negative binomial data. The variance is g + g^2/phi.

gamma

The dispersion parameter for beta-binomial data.

N_trials

The number of trials parameter for binomial data.

Value

A list out, where

  • out$h is f mapped through an inverse link function (times N_trials if noise_type is binomial or beta-binomial)

  • out$y is the noisy response variable.