working_tz="GMT", predict_at=0, limit=Inf)
data13 <<- getData(ts_data, exo_data, input_tz="GMT", date_format="%Y-%m-%d %H:%M",
working_tz="GMT", predict_at=13, limit=Inf)
-#Forecast at sunday to saturday, for monday to sunday
+#Forecast at sunday to saturday (series 7 to 1), for monday to sunday (series 1 to 7)
indices <<- seq(as.Date("2007-04-01"),as.Date("2007-04-07"),"days")
+pred_order = c(7,1:6) #will facilitate tests
test_that("Average method behave as expected",
{
for (i in seq_along(indices))
{
#zero jump: should predict true values minus 1
- expect_identical(pred00_z$getSerie(i), rep(i,24))
+ expect_equal(pred00_z$getSerie(i), rep(pred_order[i],24))
#persistence jump == 1: should predict true values
- expect_identical(pred00_p$getSerie(i), rep(i%%7+1,24))
+ expect_equal(pred00_p$getSerie(i), rep(i,24))
}
#NOTE: days become
prediction = c(rep(-13/24,11),rep(11/24,13))
for (i in seq_along(indices))
{
- expect_equal(pred13_z$getSerie(i), prediction )
+ expect_equal(pred13_z$getSerie(i), prediction ) ##TODO: prendre en compte recollement
expect_equal(pred13_p$getSerie(i), prediction )
}