# Bayes inference for comparing stock portfolios

#### nradov

##### New Member
I am working on an optimization problem to figure out which stock portfolio out of a large set of possible portfolios has the highest Sharpe ratio (risk-adjusted return) based on historical data. As part of that larger problem, I need an efficient way to determine which of two portfolios has the highest Sharpe ratio. The obvious brute-force solution is to pick a large sample of historical days, run each portfolio through all of those days to find what the returns would have been, and then calculate the Sharpe ratio for each. I suspect I could get faster and more accurate results by using Bayes inference, but I don't understand how to apply it to this case. Can anyone give me a hint, or point me toward a web page with some relevant examples?

To state the problem more clearly, let's assume we have two stock portfolios S1 and S2. After each simulated day, I would like to calculate the probability p that the Sharpe ratio for S2 really is higher than the Sharpe ratio for S1. At the start time t=0 we can assume that p=0.5 since it is equally likely that either portfolio will have the higher ratio. After we run the simulation for one day we are at time t=1. And at that time we can calculate updated Sharpe ratios for both S1 and S2, giving us an additional data point for which one has the higher ratio. Now, how can I calculate the new probability p' based on the values of p, t and that new data point? Once p' rises above 0.95 or falls below 0.05 we can be confident that we have identified the better portfolio.

Hopefully that made sense.