reg_sine {stressor} | R Documentation |
Sinusoidal Regression
Description
A simple example of sinusoidal regression that is in the form of
y = asin(b(x - c))
and is the sum of of multiple of these sine
functions with a common intercept term.
Usage
reg_sine(
formula,
data,
method = "BFGS",
init_guess = rep(1, ncol(data) * 3 - 2),
...
)
Arguments
formula |
A formula object to describe the relationship. |
data |
The response and predictor variables. |
method |
The method that is passed to the optim function. By default, it is the BFGS method which uses a gradient. |
init_guess |
The initial parameter guesses for the optim function. By default, it is all ones. |
... |
Additional arguments passed to the optim function. |
Value
A "reg_sine" object is returned which contains the results from the optim function that was returned.
Examples
sine_data <- data_gen_sine(10)
reg_sine(Y ~ ., sine_data)
[Package stressor version 0.2.0 Index]