If I have a time series set such as x=[0,2,5,2,3,1,0] that represents an artifact.
What is the best way to match a similar set as x in a larger data set y?
A few approaches come to mind but this list is far from exhaustive:
http://cran.r-project.org/web/packages/pdc/index.html
http://www.cs.ucr.edu/~eamonn/SAX.htm
see, e.g., http://link.springer.com/chapter/10.1007/978-0-387-84816-7_4
http://www.robjhyndman.com/papers/wang2.pdf
http://users.eecs.northwestern.edu/~goce/SomePubs/Similarity-Pubs/Chapter-ClusteringTimeSeries.pdf
You can do this in R. Your time series data is represented by v
and the pattern you wish to match by p
. Returns match indices.
> v<-c(1,2,3,4,5,6,7,8,9,1,2,3,4,6,7,5,8,1,2,3,4,5)
> p<-"123"
> gregexpr(p,paste(v,collapse = ""))
[[1]]
[1] 1 10 18
attr(,"match.length")
[1] 3 3 3
attr(,"useBytes")
[1] TRUE