data_gen_sine {stressor}R Documentation

Data Generation for Sinusoidal Regression

Description

Creates a synthetic data set for an additive sinusoidal regression model. See the details section for clarification.

Usage

data_gen_sine(
  n,
  weight_mat = matrix(rnorm(15), nrow = 3, ncol = 5),
  y_int = 0,
  resp_sd = 1,
  ...
)

Arguments

n

The number of observations for each parameter.

weight_mat

The parameter coefficients, where each column represents the coefficients and is three rows as each additive equation contains three parameters. Defaulted to be 15 random numbers from the normal distribution.

y_int

The y-intercept term of the additive model.

resp_sd

The standard deviation of the epsilon term to be added for noise.

...

Additional arguments that are not currently implemented.

Details

Observations are generated from the following model:

y = \sum_{i = 1}^n \alpha_i \ \sin{(\beta_i(x_i - \gamma_i)))} + y_{int}

Where 'n' is the number of parameters to be used, \alpha_i's are the amplitude of each sine wave, \beta_i's are the periods for each sine wave and indirectly the weight on each x_i, and the \gamma_i's are the phase shift associated with each sine wave. With the y_{int} being where it crosses the y-axis.

Value

A data.frame object with the n rows and the response variable with the number of parameters being equal to the number of columns from the weight matrix.

Examples

 # Generates 10 observations
 sine_data <- data_gen_sine(10)
 sine_data

[Package stressor version 0.2.0 Index]