sim_data {dlim} | R Documentation |
Simulate Data
Description
Simulate data to use with the dlim package. There are different effect modification scenarios to choose for simulation.
Usage
sim_data(
x,
L = NULL,
modifiers,
noise = 1,
type = 2,
SNR,
ncovariates = 0,
gamma = 1
)
Arguments
x |
a time series vector of length |
L |
a vector of length 1 containing the number of lag terms. This is required if |
modifiers |
vector of length |
noise |
a vector of length 1 containing the standard deviation for a normal distribution with mean 0 used to add noise to the simulated response values. Must proivde if |
type |
a vector containing the number 1, 2, 3, or 4 for simulation modification type: none, linear, non-linear shift, non-linear shift with linear scale (class " |
SNR |
The signal-to-noise ratio. If |
ncovariates |
number of covariates to add to the model, numeric vector of length 1. |
gamma |
True coefficient for the main effect of the modifier (class " |
Value
This returns a list of 8 items:
x |
a lagged exposure matrix. If |
L |
a numeric vector of length 1 containing the number of lag terms (class " |
modifiers |
the |
y |
a numeric vector of length |
betas |
a matrix containing true coefficients for each lag/modifier combination, with each row representing a lag and each column a modifier (class " |
betas_cumul |
a numeric vector of length |
Z |
covariates (class " |
gammas |
true coefficients for the covariates (class " |
See Also
Type vignette('dlimOverview')
for a detailed description.