-
- # EXOGENS: distances computations are enough
- # TODO: search among similar concentrations....... at this stage ?!
- M = matrix( nrow=1+length(fdays), ncol=1+length(data$getExo(today)) )
- M[1,] = c( data$getLevel(today), as.double(data$getExo(today)) )
- for (i in seq_along(fdays))
- M[i+1,] = c( data$getLevel(fdays[i]), as.double(data$getExo(fdays[i])) )
-
- sigma = cov(M) #NOTE: robust covariance is way too slow
- sigma_inv = solve(sigma) #TODO: use pseudo-inverse if needed?
-
- # Distances from last observed day to days in the past
- distances2 = rep(NA, nrow(M)-1)
- for (i in 2:nrow(M))
- {
- delta = M[1,] - M[i,]
- distances2[i-1] = delta %*% sigma_inv %*% delta
- }
-
- ppv <- sort(distances2, index.return=TRUE)$ix[1:10] #..............
-#PPV pour endo ?
-
-
- similarities =
- if (simtype == "exo")
- simils_exo
- else if (simtype == "endo")
- simils_endo
- else #mix
- simils_endo * simils_exo
+# # EXOGENS: distances computations are enough
+# # TODO: search among similar concentrations....... at this stage ?!
+# M = matrix( nrow=1+length(fdays), ncol=1+length(data$getExo(today)) )
+# M[1,] = c( data$getLevel(today), as.double(data$getExo(today)) )
+# for (i in seq_along(fdays))
+# M[i+1,] = c( data$getLevel(fdays[i]), as.double(data$getExo(fdays[i])) )
+#
+# sigma = cov(M) #NOTE: robust covariance is way too slow
+# sigma_inv = solve(sigma) #TODO: use pseudo-inverse if needed?
+#
+# # Distances from last observed day to days in the past
+# distances2 = rep(NA, nrow(M)-1)
+# for (i in 2:nrow(M))
+# {
+# delta = M[1,] - M[i,]
+# distances2[i-1] = delta %*% sigma_inv %*% delta
+# }
+
+ similarities = simils_endo