I'm trying to find the most similar sample between a candidate and a bag of samples.
Consider you have a knowledge corpus as follows:
corpus = data.frame(region = factor(), time = numeric(), observation = numeric()) corpus = rbind(corpus, data.frame(region = 'america', time = 1:20, observation = rnorm(20))) corpus = rbind(corpus, data.frame(region = 'asia', time = 1:20, observation = rnorm(20))) corpus = rbind(corpus, data.frame(region = 'europe', time = 1:20, observation = rnorm(20)))
Now I have a new sample and I want to choose from my knowledge base, which of the records is the most similar to my new sample.
I used different metrics with not so much improvements between them:
But what I really want to see is that the matching is done based on the shape of the curve not in vectorial distance but I have no clues about similarity functions that would metric this type of space.
*Edit: I want to match my new sample with the "closest" element in my knowledge base. But what I want is to have a match using the shape of the curve to compare the samples. If it has positive or negative derivatives in the same intervals, same amount of local maximums, that sort of things.
I tried different approaches and compared the quality of them with a random assign using a KolmogorovSmirnov test.
Fact is that my random assign is not showing to be worse than my super califragilistic detection method .
Any clues? Thoughts?