simRegression0: Simulate noisy observations from a dynamic regression model

View source: R/helper_functions.R

simRegression0R Documentation

Simulate noisy observations from a dynamic regression model

Description

Simulates data from a time series regression with dynamic regression coefficients. The dynamic regression coefficients are selected using the options from the simUnivariate() function in the wmtsa package.

Usage

simRegression0(
  signalNames = c("bumps", "blocks"),
  nT = 200,
  RSNR = 10,
  p_0 = 5,
  include_intercept = TRUE,
  scale_all = TRUE,
  include_plot = TRUE,
  ar1 = 0
)

Arguments

signalNames

vector of strings matching the "name" argument in the simUnivariate() function, e.g. "bumps" or "doppler"

nT

number of points

RSNR

root-signal-to-noise ratio

p_0

number of true zero regression terms to include

include_intercept

logical; if TRUE, the first column of X is 1's

scale_all

logical; if TRUE, scale all regression coefficients to [0,1]

include_plot

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

ar1

the AR(1) coefficient for the predictors X; default is zero for iid N(0,1) predictors

Value

a list containing

  • the simulated function y

  • the simulated predictors X

  • the simulated dynamic regression coefficients beta_true

  • the true function mu_true

  • the true observation standard deviation sigma_true

Note

The number of predictors is p = length(signalNames) + p_0.

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


dsp documentation built on Aug. 21, 2025, 5:29 p.m.