L = length(x) #96 1/4h
K1 = 60
s = lapply( seq_len(K1), function(i) x^(1+i/30)*cos(x+i) )
- series = matrix(nrow=n, ncol=L)
+ series = matrix(nrow=L, ncol=n)
for (i in seq_len(n))
series[,i] = s[[I(i,K1)]] + rnorm(L,sd=0.01)
getSeries = function(indices) {
wf = "haar"
ctype = "absolute"
getContribs = function(indices) curvesToContribs(series[,indices],wf,ctype)
- indices1 = clusteringTask1(1:n, getContribs, K1, 75, verbose=TRUE, parll=FALSE)
+ require("cluster", quietly=TRUE)
+ browser()
+ algoClust1 = function(contribs,K) cluster::pam(contribs,K,diss=FALSE)$id.med
+ indices1 = clusteringTask1(1:n, getContribs, K1, algoClust1, 75, verbose=TRUE, parll=FALSE)
medoids_K1 = getSeries(indices1)
expect_equal(dim(medoids_K1), c(L,K1))
K2 = 3
#for (i in 1:60) {plot(x^(1+i/30)*cos(x+i),type="l",col=i,ylim=c(-50,50)); par(new=TRUE)}
s = lapply( seq_len(K1), function(i) x^(1+i/30)*cos(x+i) )
- series = matrix(nrow=n, ncol=L)
+ series = matrix(nrow=L, ncol=n)
for (i in seq_len(n))
series[i,] = s[[I(i,K1)]] + rnorm(L,sd=0.01)
getRefSeries = function(indices) {