- fdays_indices = c()
- for (i in first_day:(today-1))
- {
- if ( !any(is.na(data$getSerie(i)) | is.na(data$getSerie(i+1))) )
- fdays_indices = c(fdays_indices, i)
- }
-
- #GET OPTIONAL PARAMS
- # Similarity computed with exogenous variables ? endogenous ? both ? ("exo","endo","mix")
- simtype = ifelse(hasArg("simtype"), list(...)$simtype, "mix")
- simthresh = ifelse(hasArg("simthresh"), list(...)$simthresh, 0.)
- kernel = ifelse(hasArg("kernel"), list(...)$kernel, "Gauss") #or "Epan"
- mix_strategy = ifelse(hasArg("mix_strategy"), list(...)$mix_strategy, "mult") #or "neighb"
- same_season = ifelse(hasArg("same_season"), list(...)$same_season, FALSE)
- if (hasArg(h_window))
- return (.predictShapeAux(fdays_indices, today, horizon, list(...)$h_window, kernel,
- simtype, simthresh, mix_strategy, TRUE))
- #END GET
+ first_day = max(today - memory, 1)
+ fdays = (first_day:(today-1))[ sapply(first_day:(today-1), function(i) {
+ !any(is.na(data$getSerie(i)) | is.na(data$getSerie(i+1)))
+ }) ]