Tell me more ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I am trying to classify similar looking curves of a timeseries and was wondering what is the best algorithm to research. Reading R, it looks like k-means clustering could be applied - but I don't know if there are better algorithms. Any pointers is much appreciated. My concern is if k-means could group points around a neighborhood of specific mean, but what if two curves with similar mean show different variance.

share|improve this question
QuantGuy - I need to think more and thanks for the link. The data is basically a list of pre-conditions (say related to volume/RSI/momentum etc) of a stock and I am trying to cluster these pre-conditions based on what the stock has done after those conditions are met. My approach was to first cluster the resultant curves of the stock first and then based on similar looking resultant curvers, cluster the pre-conditions for prediction. Hope the approach makes some sense. – fooledbypattern Dec 6 '11 at 17:41

2 Answers

If the means are similar, then K-means will not do a great job. I would generate new features, perhaps based on higher moments of the distribution or some other properties (auto-correlation, summary of spectral density, etc.).

Using this new set of features, If you see separation of two curves when you plot draws in feature space then k-means would be an effective grouping algorithm.

It's hard to diagnose the best classification tool without better understanding the data generating process. For example, it might make sense to use a mixture of gaussians model instead.

This R task view page on clustering will provide a broad list of various tools you can use.

share|improve this answer

We have used Neural Networks for this purpose. What we did was this: select a set of characteristics which can be directly calculated from the time series (e.g., mean, standard deviation, skewness, kurtosis, p-value from a normal fit, ACF stats etc.), and then run an NN to learn from a set of timeseries about how to classify them. We were trying to classify which among a set of models would produce the best forecasts for a series. We had the forecast answers, since we used the M-Competition data.

Unfortunately, the results weren't great. May be we were looking at wrong set of characteristics, may be our classification were wrong. But this is definitely an way to solve the problem you mention. I would be interested in knowing if you get any success in this work.

I would also be interested if someone wants to collaborate on this investigation. Please see my profile for contact information.

share|improve this answer
1  
Why do you think the results were not satisfactory? I would suggest that the characteristics of the first series did not match that of the set. Did you gain any additional insight into what was mentioned? – strimp099 Dec 6 '11 at 21:44
@strimp099: The results were not satisfactory because, after the training was done, we tried the NN on a test set. The success rate was only ~20%, which was close to randomly selecting one of the method as the best method. This could mean a variety of things: (1) We could have missed some important characteristic, (2) The construction of NN was faulty, (3) The training data was too noisy etc. We did not really gain much additional insight from the exercise, but I still think this is a very viable route. – Samik R Dec 13 '11 at 21:07
Samik: Update: Even for me, I did not find kmeans to give satisfactory results. One thing that I did not realize earlier was the fact that the order of data points is not being considered in kmeans. I need to consider a variant of kmeans that consider sequence. Doesn't look like R has any such implementation. – fooledbypattern Jan 2 '12 at 0:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.