- #Some traces: 0 is not well estimated, but others are OK
- cat("\n\nReference parameter matrix:\n")
- print(beta_ref)
- cat("Estimated parameter matrix:\n")
- print(betas[,,2])
- cat("Difference norm (Matrix norm ||.||_1, max. abs. sum on a column)\n")
- diff_norm = norm(beta_ref - betas[,,2])
- cat(diff_norm,"\n")
+ # index 143 : serie type 2
+ f = computeFilaments(data, 143, limit=60, plot=FALSE)
+ # Expected output: 23 series of type 3 (closer), then 50-3-10 series of type 2, then 143
+ expect_identical(length(f$indices), as.integer(61)) #61 because result also contain today
+ expect_identical(length(f$colors), as.integer(61))
+ expect_true(all(I(f$indices) >= 2))
+ for (i in 1:23)
+ {
+ expect_equal(I(f$indices[i]), 3)
+ expect_match(f$colors[i], f$colors[1])
+ }
+ for (i in 24:60)
+ {
+ expect_equal(I(f$indices[i]), 2)
+ expect_match(f$colors[i], f$colors[24])
+ }
+ expect_equal(f$indices[61], 143)
+ expect_match(f$colors[61], "#FF0000") #special color: current day in red
+ expect_match(f$colors[1], "#E*")
+ expect_match(f$colors[24], "#1*")