X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=data%2Fscripts%2Fbuild_testdata.R;h=20cb725783e489be3b75a0c17fa7464184690160;hb=HEAD;hp=e0bc15321b605f88a62e57667cc21614cc49380f;hpb=da7f46b8108ba9e39f24cbe29284064501a81175;p=talweg.git diff --git a/data/scripts/build_testdata.R b/data/scripts/build_testdata.R index e0bc153..20cb725 100644 --- a/data/scripts/build_testdata.R +++ b/data/scripts/build_testdata.R @@ -3,11 +3,11 @@ dates = seq(as.Date("2007-01-01"),as.Date("2007-07-01"),"days") times = strftime( seq( from=ISOdatetime(2007,1,1,1,0,0,tz="GMT"), to=ISOdatetime(2007,7,2,0,0,0,tz="GMT"), - by="hour") ) + by="hour"), tz="GMT" ) -# Only one covariable (so that the "matrix" is always invertible) +# Only one covariable (no need for more; random, to invert cov(M)) L = length(dates) #182 -exo_df = data.frame( "date"=dates, "var"=rep(1,L), "var_pred"=rep(1,L) ) +exo_df = data.frame( "date"=dates, "var"=rnorm(L,1), "var_pred"=rnorm(L,1) ) # Series are 1,1,...,1 2,2,...,2 ... 7,7,...,7 1,1,...,1 ...etc # First serie on monday 2007-01-01, there are exactly 26 weeks ts_df = data.frame( "time"=times, "value"=rep(seq_len(7), each=24, times=26) )