simRegression | R Documentation |
Simulates data from a time series regression with dynamic regression coefficients.
The dynamic regression coefficients are simulated as a Gaussian random walk,
where jumps occur with a pre-specified probability sparsity
.
The coefficients are initialized by a N(0,1) simulation.
simRegression(
T = 200,
p = 20,
p_0 = 15,
sparsity = 0.05,
RSNR = 5,
ar1 = 0,
include_plot = FALSE
)
T |
number of time points |
p |
number of predictors (total) |
p_0 |
number of true zero regression terms |
sparsity |
the probability of a jump (i.e., a change in the dynamic regression coefficient) |
RSNR |
root-signal-to-noise ratio |
ar1 |
the AR(1) coefficient for the predictors X; default is zero for iid N(0,1) predictors |
include_plot |
logical; if TRUE, include a plot of the simulated data and the true curve |
a list containing
the simulated function y
the simulated predictors X
the simulated dynamic regression coefficients beta_true
the true function y_true
the true observation standard devation sigma_true
The root-signal-to-noise ratio is defined as RSNR = [sd of true function]/[sd of noise].
sims = simRegression() # default simulations
names(sims) # variables included in the list
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.