b20f104f72a5b4b14107f6775d41c904cd5de36f
[talweg.git] / pkg / tests / testthat / test.Forecaster.R
1 context("Check that forecasters behave as expected")
2
3 test_that("Average+Zero method behave as expected",
4 {
5
6 test_that("Persistence+Zero method behave as expected",
7 {
8
9 test_that("Neighbors+Zero method behave as expected",
10 {
11
12 test_that("Neighbors+Neighbors method behave as expected",
13 {
14
15
16
17 #TODO: with and without shift at origin (so series values at least forst ones are required)
18
19
20 n = 1500
21 series = list()
22 for (i in seq_len(n))
23 {
24 index = (i%%3) + 1
25 level = mean(s[[index]])
26 serie = s[[index]] - level + rnorm(L,sd=0.05)
27 # 10 series with NAs for index 2
28 if (index == 2 && i >= 60 && i<= 90)
29 serie[sample(seq_len(L),1)] = NA
30 series[[i]] = list("level"=level,"serie"=serie) #no need for more :: si : time !!!
31 }
32 data = new("Data", data=series)
33
34 dateIndexToInteger = function(index, data)
35 })