datafest competition 2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
633 B

fatigueFunction <- function(workLoad, index)
{
if(index == 1)
{
return(workLoad[1])
}
else
{
return(workLoad[index] + (exp(1)^(-1/15))**fatigueFunction(workLoad, index -1))
}
}
smoothVector <- function(dataV)
{
dataNew <- c()
for(i in 1:length(dataV))
{
dataNew <- c(dataNew, fatigueFunction(dataV, i))
}
dataNew
}
slidingWindowSmooth <- function(dataV, windowSize = 7)
{
dataNew <- c()
for(i in 1:windowSize)
{
dataNew <- c(dataNew, mean(dataV[c(1:i)]))
}
for(i in (windowSize + 1):length(dataV))
{
dataNew <- c(dataNew, mean(dataV[(i-7):i]))
}
dataNew
}