projects
/
talweg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
revise package structure: always predict from 1am to horizon, dataset not cut at...
[talweg.git]
/
pkg
/
R
/
computeError.R
diff --git
a/pkg/R/computeError.R
b/pkg/R/computeError.R
index
1fbb2a8
..
0b1771f
100644
(file)
--- a/
pkg/R/computeError.R
+++ b/
pkg/R/computeError.R
@@
-13,9
+13,9
@@
#' step, averaged on the L forecasting days.
#'
#' @export
#' step, averaged on the L forecasting days.
#'
#' @export
-computeError = function(data, pred,
horizon=data$getStdHorizon(
))
+computeError = function(data, pred,
predict_from, horizon=length(data$getSerie(1)
))
{
{
- L =
forecast
$getSize()
+ L =
pred
$getSize()
mape_day = rep(0, horizon)
abs_day = rep(0, horizon)
mape_indices = rep(NA, L)
mape_day = rep(0, horizon)
abs_day = rep(0, horizon)
mape_indices = rep(NA, L)
@@
-24,9
+24,9
@@
computeError = function(data, pred, horizon=data$getStdHorizon())
nb_no_NA_data = 0
for (i in seq_len(L))
{
nb_no_NA_data = 0
for (i in seq_len(L))
{
- index =
forecast
$getIndexInData(i)
- serie = data$getSerie(index
+1)[1
:horizon]
- forecast = pred$getForecast(i)[
1
:horizon]
+ index =
pred
$getIndexInData(i)
+ serie = data$getSerie(index
)[predict_from
:horizon]
+ forecast = pred$getForecast(i)[
predict_from
:horizon]
if (!any(is.na(serie)) && !any(is.na(forecast)))
{
nb_no_NA_data = nb_no_NA_data + 1
if (!any(is.na(serie)) && !any(is.na(forecast)))
{
nb_no_NA_data = nb_no_NA_data + 1