I have a problem that requires ranking rather than regression or classification e.g. out of a portfolio of 3 stocks which stock will go up the most in the next one month, which stock will be 2nd and which will be 3rd. Can anyone suggest an appropriate algorithm and R package to use .

# Algorithm to predict ranks instead of value or class?

**nayan1247**#2

I think you are referring to forecasting the rank where time component is also involved. You take past (for eg) 3 years data for stocks in your portfolio and want to predict next months rank order.

I would approach it as a time series forecasting problem and then rank it appropriately.

Below link should get you started…

http://www.statmethods.net/advstats/timeseries.html

Also you can include sectoral indices to refine your prediction.

-Nayan

**Nalin**#3

I realise the stock market aspect might have a time series component. But I’m looking for a more general ranking algorithm which might also rank, say, each horses rank in a horse race. Such a problem might require only ranking with no time series involvement.

**Subarna**#4

I believe logistic regression to predict probability / odds ratio and use it to order the rank (from highest to lowest probability) might serve your need. Not sure about any package readily available in R to predict the ranks!