X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FF_Neighbors.R;h=7144fad777202020edbd427ea936af940bf34555;hp=f1aecb5ccb637a581e1984f444564786ce561ff6;hb=dea7ff860b42b3e246c8fa7ce2fb514561b8bc43;hpb=469529710f56c790ae932b45d13fed2e34bcabf2 diff --git a/pkg/R/F_Neighbors.R b/pkg/R/F_Neighbors.R index f1aecb5..7144fad 100644 --- a/pkg/R/F_Neighbors.R +++ b/pkg/R/F_Neighbors.R @@ -164,13 +164,12 @@ NeighborsForecaster = setRefClass( { h_exo = ifelse(simtype=="mix", h[2], h) - # TODO: [rnormand] if predict_at == 0h then we should use measures from day minus 1 - M = matrix( nrow=1+length(fdays_indices), ncol=1+length(dat[[today]]$exo_hat) ) - M[1,] = c( dat[[today]]$level, as.double(dat[[today]]$exo_hat) ) + M = matrix( nrow=1+length(fdays_indices), ncol=1+length(dat[[today]]$exo) ) + M[1,] = c( dat[[today]]$level, as.double(dat[[today]]$exo) ) for (i in seq_along(fdays_indices)) { M[i+1,] = c( dat[[ fdays_indices[i] ]]$level, - as.double(dat[[ fdays_indices[i] ]]$exo_hat) ) + as.double(dat[[ fdays_indices[i] ]]$exo) ) } sigma = cov(M) #NOTE: robust covariance is way too slow