RS-optimizer use? Best practice. My method

It seems like the best system here, based on still being a fairly new member - is to focus on RS, finding good node (factors), node combinations, and node weights.

The RS-optimiser seems like a good place to start. But there are very few posts on it. Does anyone use it?

Here is my method:

I create 50 RS systems at once with different weights on each of the nodes in each of the 50 RS systems.

Then I used this formula in excel (=IF(RANDBETWEEN(1;12)<=6;0;RANDBETWEEN(1;12))), which assigns random numbers to the entire row of nodes (131) and all 50 columns (50 different systems).

Then I run the optimizer on my universe, 10 years, 100 bulks (50 stocks). 8 week rebalance, since I in my Simulator want to have around 300% turnover. When it has run through the 50 RS systems, I will take the best. Copy the weight into a spreadsheet. Then run 50 new systems with random weights until I’ve done this 10–20 times. Then I use the average of the weight of each node, which has then been run in the 10–15 best RS systems.

Then my thinking is that I have run all the nodes with different weightings in several hundred different RS systems, so when I take the average of those that collectively in the 15 tests have done the best, it is because these nodes together with the others in the system are best.

Im not sure if this is the best use or if it will work.

What is your method?
What could improve my method?
And is there any way of downloading all the RS at once that is created each time I run the optimizer?

1 Like

I would use the rebalancing period your sims use. Specifying a longer period adds too much latency when ranks change - i.e. if a stock drops out of an upper bucket, you want to detect that change as soon as possible.

Also, I consider turnover a secondary concern. For me, average return is the important metric to monitor.

For me, it is: " Rebalance Frequency Every Week". And turnover is 300% (because of sellrank < 97) in simulator

Thank you for the reply.

But won’t the RS performance test each week then be very different then the simulator since the RS performance test uses equal weight and switch stocks each week, while the simulator holds stocks for 100 days and more?

Will this not just pick factors that are fast to react and, at the same time, only work in high-turnover simulations?

Why would stocks switch buckets each week? If the factors are persistent, then stocks should stay within buckets for awhile. No?

For those factors that change often enough to degrade RS performance, your optimization should end up assigning them lower weights.

EDIT: what are you using for slippage?

Im not sure :slight_smile: ! Maybe it’s a fabrication of my mind.

What I see, is that now, with 1 week rebalance in RS rank performance, the performance is actually more like the one that I have in the simulation with the same RS systems. So you may be right that rebalancing should be the same.

It seems to me that, for a given factor, rank order will change more with longer rebalance intervals. So more bucket switching, less often.

Shorter rebalance periods, supports fewer rank order changes i.e. less frequent bucket changes, but more often.

Pick your poison.

I prefer the lower latency of more frequent rebalancing.

One more question.

Here, I use a random matrix with each optimizer run. With 50 columns x 131 rows of node weights, and run it in the optimizer. The matrix have a random number from 1-25 % weight, where half of the 131 node rows have to be 0.

Any better solution? 1-12% instead of 1-25% (high number, low number), don’t test the system with 0%?

Dunno. I don’t optimize weights. I have used the RS optimizer to select factors via a binary on/off weighting.

Walt, if you don’t optimize weights, do you simply assign a static weight to every factor?

Tony

99% of my ranking systems are equally weighted. I only deviated from that when I made focused models - like for dividends.

Watler and Whycliffes,

I will try to be shorter in my posts and be more open to just letting people do what works for them.

But why do all to that optimization if you are going to do equal weights? Just a question and I am sure there is a good answer.

Personally, Python gives me easy answers on weights that seem to work for me.

This is Duckruck’s idea really. One of his methods but each of these would be a weight for a factor to put into a P123 ranking system that P123 would normalize for you.

No coding to speak of and Bard or ChatGPT would give it to you in the blink an eye. Maybe spare you the details of the name of the machine learning model (find your own?). And maybe say just me but I would never do equal weights? I do think you guys are doing great stuff even in my machine learning terms (I would give it the name gradient descent or just cool stuff).

So here are the weights you would get printed out. The factors are to the left and I have cut them off so you could find your own factors. You may see “……EV Quarter” to get an idea of what kind of factors.

Don’t forget you could use composite nodes with multiple factors. P123 is truly a capable platform for EXTREME machine learning. I just wish Marco understood its potential.

He just needs to UNDERSTAND the potential and have someone from P123 encourage it in the forum. Maybe take a few suggestions from people like Duckruck and Judith.

I am not sure sending people messages not to discuss machine learning in the forum is going to work for bringing machine learners to P123. But just me on that, I guess. I am not a businessman.

Not suggesting any body needs to change anything that is working for them….in fact I would suggest they shouldn’t:

BTW, a laptop has no trouble running the code used for this in Jupyter notebooks. Random forests are a little slower. You would want to set max_features = sqrt for a random forest (speeds it up a lot).

You will have to use excess returns relative to your universe but really that is all you need as far as advice. The rest is up to you and your creativity.

Jim

Even though I don’t optimize factor weights, I do have a few thoughts about using the optimizer - just trying to help.

Philosophical, just as I need a reasonable basis for including factors - I need a reasonable basis for adjusting their weights. I’m not there - yet.

1 Like

That is cool. How do you use the optimizer then?

Just a question. Do you randomize the weights in a spreadsheet and exclude factors that get zeroed out and equally weight the others?

I do not think that would be a bad way to do it, BTW. I thought of it because it has a lot of merit (in my mind at least).

I am all for the methods being described even in machine learning terms. Again, calling what you are doing the either cool or nerdy term: gradient descent. I happen to think it is cool.

Full stop. Just truly interested in what you are doing.

I use composite nodes so there are relatively few top-level items to work though.

My last run had 9 nodes. To go though all the possible combinations required 512 runs. The best result was identical to that I found manually. Neither method is fun.

Obviously, that approach isn’t feasible for a flat RS with a 100 factors.

Nice!!!

I think my previous post encouraged at least trying composite nodes. I like the idea.

The only thing I would add to this discussion it that I believe I am only expanding on what Duckruck was trying to encourage in the forum.

Duckruck is free to say he disagrees with my understanding, but I think I agree Duckruck’s general points.

Edit: one nice P123 feature making it a potential machine learning EXTREME POWERHOUSE for years to come , BTW (composite nodes).

Jim

Thank you for the input. What do you think of the debate about not having composite nodes?

I know Yuval, doesn’t use composite node, but all p123 Core systems use it

Here is also a great debate: A simple way to improve many rankings - #3 by dwpeters

So which is better? Composite or flat? Equally weighted or non-equally weighted?

I think the answer is … yes.

I should have been clearer about my ranking systems. They’re almost always equally weighted, composite designs. I started that way b/c I considered composite nodes an organizing method. Given a set of similar factors - analyst EPS estimates, for example - it was natural to group them all into a composite node. At that point, the composite node became a kind of mega factor. Factor colinearity may be beneficial here - maybe even a requirement. I stuck w/ equal weights b/c I couldn’t justify why they should be anything else.

So what would happen if I propagated each leaf node to the top, scaling the starting weight by the composite node weights? I would end up with a flat systems w/ non-equal weights.

In some sense, the systems would be identical in spite of the different structure.

Would they simulate identically? Dunno. The thread you provided concluded with a maybe. If I have time this weekend, I’ll try that experiment.

Thanks for making me think!