fdays, today, horizon, list(...)$h_window, kernel, simtype, TRUE) )
}
- # Indices of similar days for cross-validation; TODO: 45 = magic number
- sdays = getSimilarDaysIndices(today, data, limit=45, same_season=FALSE)
-
- cv_days = intersect(fdays,sdays)
- # Limit to 20 most recent matching days (TODO: 20 == magic number)
- cv_days = sort(cv_days,decreasing=TRUE)[1:min(20,length(cv_days))]
+ # Indices of similar days for cross-validation; TODO: 20 = magic number
+ cv_days = getSimilarDaysIndices(today, data, limit=20, same_season=FALSE, days_in=fdays)
# Function to optimize h : h |--> sum of prediction errors on last 45 "similar" days
errorOnLastNdays = function(h, kernel, simtype)