--- /dev/null
+simulateur : complètement aléatoire ? from Irish dataset ?
+wavelets methods in statistics with R - p180
+
+00-convertir2009 et 2010.R
+01-extractFeatures.R pour 2009 [utilise Stbr.R] (car on prédit 2010, pas besoin)
+02-cluster2009.R
+03-compute-sum-of-classes2009.R
+05-cluster2WER-2009.R
+06-prediction.R
+
+Essayer distance wdist du package biwavelet ?
+
+geometric structure of high dim data and dim reduction 2011
lims <- quantile(sdcontrib, probs = c(.005, .995)) # obtain 1%-extreme data
is_normal <- which((sdcontrib > lims[1]) & (sdcontrib < lims[2]))
-matcontri_ext <- matcontrib0[-is_normal, ]""
+matcontri_ext <- matcontrib0[-is_normal, ]#""
matcontrib <- matcontrib0[is_normal, ] # wipe out aberrant data
matcontrib <- t(apply(matcontrib, 1, function(x) x / sum(x)))
## c. Clustering ##########
K <- 200
system.time(
+
+#TODO: cette partie en C
+
clfit <- clara(x = tdata[, selvar],
k = K,
sampsize = 4000,
library(cluster) # pam
#library(flexclust) # kcca
source("aux.r") # auxiliary clustering functions
+
+#TODO: [plus tard] alternative à sowa (package disparu) : cwt..
source("sowas-superseded.r") # auxiliary CWT functions
## 1. Read auxiliar data files ####
#synchros09 <- t(as.matrix(read.table("~/tmp/2009_synchros200-random.txt")))
nas <- which(is.na(synchros09)[, 1]) # some 1/1/2009 are missing
-synchros09[nas, 1] <- rowMeans(synchros09[nas, 2:4])
+synchros09[nas, 1] <- rowMeans(synchros09[nas, 2:4]) #valeurs après 1er janvier
+#moyenne pondérée pour compléter deux demi-heures manquantes
imput09 <- synchros09[, 4180:4181] %*% matrix(c(2/3, 1/3, 1/3, 2/3), 2)
synchros09 <- cbind(synchros09[, 1:4180], imput09, synchros09[, 4181:17518])
# scalevector4 <- 2^(4:(noctave4 * nvoice) / nvoice) * 2
# lscvect4 <- length(scalevector4)
# lscvect <- lscvect4 # i should clean my code: werFam demands a lscvect
+
+
+#17000 colonnes coeff 1, puis 17000 coeff 2... [non : dans chaque tranche du cube]
+
+#TODO: une fonction qui fait lignes 59 à 91
+
+#cube:
# Xcwt4 <- toCWT(conso, noctave = noctave4, dt = 1,
# scalevector = scalevector4,
# lt = delta, smooth = FALSE,
# nvoice = nvoice) # observations node with CWT
#
-# #Xcwt2 <- matrix(0.0, nrow= n, ncol= 2 + delta * lscvect)
+# #matrix:
+# ############Xcwt2 <- matrix(0.0, nrow= n, ncol= 2 + delta * lscvect)
# #Xcwt2 <- matrix(NA_complex_, nrow= n, ncol= 2 + length((c(Xcwt4[,,1]))))
#
+# #NOTE: delta et lscvect pourraient etre gardés à part (communs)
# for(i in 1:n)
# Xcwt2[i,] <- c(delta, lscvect, Xcwt4[,,i] / max(Mod(Xcwt4[,,i])) )
#