Last active
December 23, 2018 15:35
-
-
Save baogorek/201b5073bc8512fe28b2af465215f8a4 to your computer and use it in GitHub Desktop.
Fitness and fatigue variables created from intensities w in data frame train_df
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convolve_training <- function(training, n, tau) { | |
sum(training[1:(n - 1)] * exp_decay((n - 1):1, tau)) | |
} | |
fitness <- sapply(1:nrow(train_df), | |
function(n) convolve_training(train_df$w, n, 60)) | |
fatigue <- sapply(1:nrow(train_df), | |
function(n) convolve_training(train_df$w, n, 13)) | |
E_perf <- 496 + .07 * fitness - .27 * fatigue | |
set.seed(45345) | |
train_df$perf <- E_perf + 7.0 * rnorm(nrow(train_df)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment