response | R Documentation |
This function takes a model object and extracts the responses
from step_distributed_lag
, step_lead_lag
, step_harmonic
and
step_earthtide
.
response(fit, rec, verbose = FALSE, ...) ## S3 method for class 'lm' response(fit, rec, verbose = FALSE, ...) ## S3 method for class 'cv.glmnet' response(fit, rec, verbose = FALSE, ...) ## S3 method for class 'numeric' response(fit, rec, verbose = FALSE, ...)
fit |
A model object that has a |
rec |
A prepped |
verbose |
Print names of steps with no response methods |
... |
Currently not used |
step_distributed_lag
and step_lead_lag
result
in impulse response functions and step_harmonic
and step_earthtide
result in harmonic components (amplitude and phase for each main frequency).
A data.frame of impulse response functions, or harmonic components corresponding to each step.
data(transducer) transducer$datetime_num <- as.numeric(transducer$datetime) rec_toll_rasmussen <- recipe(wl~baro + datetime_num, transducer) |> step_lead_lag(baro, lag = log_lags(100, 86400 * 2 / 120)) |> step_ns(datetime_num, deg_free = 10) |> prep() input_toll_rasmussen <- rec_toll_rasmussen |> bake(new_data = NULL) fit_toll_rasmussen <- lm(wl~., input_toll_rasmussen) resp <- response(fit_toll_rasmussen, rec_toll_rasmussen) plot(value~x, resp[resp$name == 'cumulative',], type = 'l')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.