test_that("Average method behave as expected",
{
- pred00_z = computeForecast(data_p, indices, "Average", "Zero", 1, Inf, 24, ncores=1)
+ pred00_z = computeForecast(data_p, indices, "Average", "LastValue", 1, Inf, 24, ncores=1)
pred00_p = computeForecast(data_p, indices, "Average", "Persistence", 1, Inf, 24)
for (i in 1:7)
{
#NOTE: 24h-block become
#1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 (14h-->0h then 1h-->13h)
#No jump between days, thus zero and persistence are equivalent (and correct)
- pred13_z = computeForecast(data_p, indices, "Average", "Zero", 14, Inf, 24)
+ pred13_z = computeForecast(data_p, indices, "Average", "LastValue", 14, Inf, 24)
pred13_p = computeForecast(data_p, indices, "Average", "Persistence", 14, Inf, 24)
for (i in 1:7)
{
test_that("Persistence method behave as expected",
{
#Situation A: +Zero; (generally) correct if jump, wrong otherwise
- pred00_sd = computeForecast(data_p, indices, "Persistence", "Zero", 1, Inf, 24,
+ pred00_sd = computeForecast(data_p, indices, "Persistence", "LastValue", 1, Inf, 24,
ncores=1, same_day=TRUE)
- pred00_dd = computeForecast(data_p, indices, "Persistence", "Zero", 1, Inf, 24,
+ pred00_dd = computeForecast(data_p, indices, "Persistence", "LastValue", 1, Inf, 24,
ncores=1, same_day=FALSE)
for (i in 1:7)
{
expect_equal(pred00_dd$getForecast(i), rep(pred_order[i],24))
}
- pred13_sd = computeForecast(data_p, indices, "Persistence", "Zero", 14, Inf, 24,
+ pred13_sd = computeForecast(data_p, indices, "Persistence", "LastValue", 14, Inf, 24,
ncores=1, same_day=TRUE)
- pred13_dd = computeForecast(data_p, indices, "Persistence", "Zero", 14, Inf, 24,
+ pred13_dd = computeForecast(data_p, indices, "Persistence", "LastValue", 14, Inf, 24,
ncores=1, same_day=FALSE)
for (i in 1:7)
{
test_that("Neighbors method behave as expected",
{
#Situation A: +Zero; correct if jump, wrong otherwise
- pred00 = computeForecast(data_p, indices, "Neighbors", "Zero", 1, Inf, 24,
+ pred00 = computeForecast(data_p, indices, "Neighbors", "LastValue", 1, Inf, 24,
simtype="mix", local=FALSE, window=c(1,1))
for (i in 1:7)
expect_equal(pred00$getForecast(i), rep(pred_order[i],24))
- pred13 = computeForecast(data_p, indices, "Persistence", "Zero", 14, Inf, 24,
+ pred13 = computeForecast(data_p, indices, "Persistence", "LastValue", 14, Inf, 24,
simtype="mix", local=FALSE, window=c(1,1))
for (i in 1:7)
expect_equal(pred13$getForecast(i), rep(i,24) )