0

I have a set of vectors which contain the same amount of entries. I have been googling for a while but i haven't found anything useful:

Is there a way to detect a pattern in these numbers?

The vectors look like this:

{840.2, 842.1,....,} {840.3, 843.1,....,} ....

Kara
  • 6,115
  • 16
  • 50
  • 57
Benedikt Bergenthal
  • 495
  • 1
  • 7
  • 20
  • 4
    What do you mean a *pattern* ? – fouronnes Mar 09 '11 at 22:37
  • 1
    What kind of a pattern are you looking for? Something more of a Mensa puzzle or a general trend? Where does this data come from? – julx Mar 09 '11 at 22:37
  • 2
    I don't think there's any chance of a useful answer unless either you explain what sort of pattern you're looking for, or someone happens to guess correctly. The former seems like a better bet. So: What sort of pattern are you looking for? – Gareth McCaughan Mar 09 '11 at 22:37
  • If you want to measure how closely the sequences resemble each other, then "correlation" would be a good word to google. If you mean something else, then please explain in more detail. – Mike Seymour Mar 09 '11 at 22:53
  • I'm sry if i didn't express my problem correct.The thing is i want see if the difference between the entries follows a pattern or a trend. These are peaks from a laser spectrum and i would like to take a "fingerprint" to see is i can identify a laser by its peaks. In other words if i have a certain vector the program should be able to tell me if this meets pattern 1 or 2, ... or whatever pattern. – Benedikt Bergenthal Mar 09 '11 at 23:44

3 Answers3

0

To analyze your data, I suggest writing a program that puts the data into a Comma Separated Values formatted file, then input the file into a spreadsheet. Spreadsheets already have great functions for analyzing data.

A good project would be to use (implement) a neural network for analyzing the data. Search the Web for "Neural Network C++".

Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
  • I already thought about the neural Network and found some pretty interesting things about it. The basic principle is clear to me, but I have no clue where to start and how to implement it. – Benedikt Bergenthal Mar 10 '11 at 11:34
0

Based on your comment above, I think you'll be interested in cross-correlation.

The basic idea is that you have two vectors (one of length m and one of length n, where n is usually much smaller than m) and you create a third vector (of length m - n) whose values represent how well the smaller vector matches a portion of the larger at particular points.

The basic algorithm is something like:

for i = 0 to m - n
    output[i] = 0
    for j = 0 to n
        output[i] = output[i] + (v0[i + j] * v1[j])^2 

The index of the maximum value in the output vector is where the smaller input vector best matches the larger.

This naive implementation is quite slow, but in the Properties section of the above link, we see that we can use FFTs to calculate the cross-correlation much faster in general.

Daniel Gallagher
  • 6,915
  • 25
  • 31
0

You could also use metrics like the cosine similarity in order to determine how similar two vectors are. If all of the vectors follow a similar trend, then their cosine similarities should also be similar.

David Weiser
  • 5,190
  • 4
  • 28
  • 35
  • Alright I just implemented to cosine similarity. I think it's not really precise enough. I only get results of 1 or really close to 1 (eg. 0.999994), but thanks for the idea. – Benedikt Bergenthal Mar 10 '11 at 22:20