# NOT RUN {
## Simulate data
par(mfrow = c(1,1))
x0 <- sin(seq(0, 2 * pi * 100, length.out = 10000))
x <- x0 + rnorm(1000, sd = 0.1)
template <- list(x0[1:500])
template.vl <- seq(300, 700, by = 50)
## Rescale pattern
template.scaled <- scaleTemplate(template, template.vl)
## Compute ADEPT similarity matrix
out <- similarityMatrix(x, template.scaled, "cov")
## Visualize
par(mfrow = c(1,1))
image(t(out),
main = "ADEPT similarity matrix\nfor time-series x and scaled versions of pattern templates",
xlab = "Time index",
ylab = "Pattern vector length",
xaxt = "n", yaxt = "n")
xaxis <- c(1, seq(1000, length(x0), by = 1000))
yaxis <- template.vl
axis(1, at = xaxis/max(xaxis), labels = xaxis)
axis(2, at = (yaxis - min(yaxis))/(max(yaxis) - min(yaxis)), labels = yaxis)
# }
Run the code above in your browser using DataLab