MVP reminder for: Portfolio Optimization & Risk Factors

All these discussions are great [We need a risk model].

This is just a reminder that we’re trying to, in the end, spec out product enhancements that you want, and that we can deliver (MVP). And we’re trying to do it collaboratively! It’s an experiment… Let’s see if it works.

Each product enhancements will get a specification doc on the shared google drive with UI mockups, and a separate forums thread if needed. The google drive is here ( there’s been several edits).

These enhancements are not meant to recreate what PV has. Far from it. First it has to fit in with what we have. And second it’s a Minimum Viable Product and will have way less tools and “levers”.

I grouped the product enhancements in three areas:

1- Portfolio Optimization
Enhance Books to do something similar to PV’s Portfolio Optimization

2- Risk Factor Allocation
Enhance Books to do something similar to PV’s Risk Factor Allocation.
(and allow users can create their own Risk Factors)

3- Tools to “do it” outside of P123
Add whatever API, downloads, tools that save time, etc., that are needed so that you can do your analysis outside of P123, and allow you to import the results.

Please feel free to, concisely, express your thoughts re. product design and desired features.

Also… if anything makes no sense, has the wrong name, etc, please point it out.

Thanks!

1 Like

Marco,

For Risk Factor Allocation I do not really understand it yet. Not fully for sure. I have been playing with it over at PV this evening. I find “allow user to create their own risk factors” interesting. Is that along the lines of what Kurtis was suggesting? I have not found anything I plan on using yet.

I do use Portfolio Optimization already. I will probably continue to use it.

I have uploaded my sims into Portfolio Visualizer. Also PV allows one to add tickers. I have not needed the API to do that. I do not think I will find an immediate need for API enhancements. Obviously a cool thing if others find a use for that.

Just my experiences/uses so far. Thank you.

Jim

Marco and All,

I love P123 just the way it is. It makes me money ALMOST every single day (nothing is perfect) :smiling_face_with_three_hearts: I say that to make clear that while I use Portfolio Optimization now, the sims, ports, rank performance tests and available downloads are just awesome. Anything else P123 might decide to do would just be icing on the cake.

TL;DR: Not a feature request and certainly does not imply where anything should go on a priority to-do list.

That have been said we now, often, use 1/N for stocks in ports. . :white_check_mark:

Formula weighting is an option: :white_check_mark:.

P123 is considering minimum-variance, risk parity etc. as possible formula weighting options: :white_check_mark:.

Here is a the abstract of a paper that alleges to show the superiority of a minimum-variance portfolio of stocks (rebalanced monthly and with some allowance for transaction costs). Sadly, the full article is behind a paywall. But I find the to be a frequently citied paper. Just to advance the discussion (please see TL;DR above). Did I mention I love P123 just the way it is?

I just copied the abstract rather than link ot it:

Abstract

"Previous research has shown that equally weighted portfolios outperform optimized portfolios, which suggests that optimization adds no value in the absence of informed inputs. This article argues the opposite. With naive inputs, optimized portfolios usually outperform equally weighted portfolios. The ostensible superiority of the 1/N approach arises not from limitations in optimization but, rather, from reliance on rolling short-term samples for estimating expected returns. This approach often yields implausible expectations. By relying on longer-term samples for estimating expected returns or even naively contrived yet plausible assumptions, optimized portfolios outperform equally weighted portfolios out of sample.

Previous research has shown that equally weighted portfolios outperform optimized portfolios, which suggests that in the absence of informed inputs, optimization adds no value. We argued the opposite. Using naive inputs, we demonstrated that optimized portfolios usually outperform equally weighted portfolios. The ostensible superiority of the 1/N approach arises not from limitations in optimization but, rather, from reliance on rolling short-term samples for estimating expected returns. By relying on longer-term samples for estimating expected returns or even naively contrived yet plausible assumptions, optimized portfolios outperform equally weighted portfolios out of sample.

Our study covered 13 datasets comprising 1,028 data series. We constructed more than 50,000 optimized portfolios and evaluated their out-of-sample performance as compared with the market portfolio and the 1/N portfolio. We grouped portfolios into three categories: asset class, beta, and alpha.

We used three approaches to estimate expected returns for optimized portfolios: (1) We generated the minimum-variance portfolio; (2) for each asset, we estimated a risk premium over a long data sample before the backtest start date and assumed that it remained constant throughout the backtest; and (3) in the spirit of classical statistics, we used a growing sample that included all available out-of-sample data.

Although extremely simple, these expected returns have an important difference from most of the expected returns used in previous studies: They do not rely on rolling samples of realized returns, which often imply implausible expectations. For example, we might forecast that cash will outperform stocks because it did so in the past five years. Why would this particular realization be a good forecast of the next one? We should not use these past data; all we need is a reasonable forecast tied to economic intuition.

Our results show that optimized portfolios significantly outperform the 1/N portfolio, even across beta universes, which are notorious for the exceptional performance of the 1/N portfolio as compared with the market portfolio. We showed that even without any ability to forecast returns, optimization of the covariance matrix by itself adds value. In our view, 1/N is not a viable alternative to thoughtful optimization but is, rather, a capitulation to cynicism."

An optimization feature I would find useful is the efficient frontier for a set of stocks, or a set of etf’s held by a port or sim. The efficient frontier is a parabolic curve plotting the risk versus return over all component weightings. See for a simple explanation:

I would also like to see the frontier for stock and etf mixtures (early on P123 allowed this mixture within ports, but it was discontinued for some reason). I assume a book-wise optimization would not drill down to the components, but only optimize the entire book.

Hi Sglinski,

I agree that might be something P123 might want to look at. And thank you for the link to the code.

If you are coding some of this now, here is a Python library that you might find interesting. There may be a few additional things along the lines of what you have linked to in this library: PyPortfolioOpt

Jim

Hi, Is there a timeline for this project? I noticed ML features will be released soon but I can’t quite wrap my head around how will this work without differentiation of beta and alpha for the ML to learn to predict. I don’t think objective is to build a market timing algorithm, is it?

Hi Korr,

This may be off topic or it may be spot-on and maybe even something P123 could use.

Anyway, it has always seemed like you understand correlation Matrices better than most. In that regard, do you happen to use Leidolt-Wolf shrinkage? I will stop there as I would actually be interested ni anything you might say on the subject (shrinkage or not and/or Leidot-Wolf or not).

I can use it easily in some of the Python programs—and probably will. It is easy to enter this matrix as some of the other matrices (e.g., semi-variant).

Besides ChatGPT thinks I am just a stupid human if I do not :worried: Said so this morning in fact (perhaps in not so many words).

Thanks,

Jim

Hi Jim,

Unfortunately I’m not familiar with Leidolt-Wolf shrinkage. The only thing I can, imo, accurately say on this topic is that covariance matrices in financial markets are typically done over long horizons to maintain their stability with most prediction models.

Sorry.

I haven’t looked much into this but is there a reason to limit portfolio optimization to books? How about individual strategies? In the latter case, would the optimization happen at every rebalance or is it better to stick to 1/N allocation or use weights such as weights derived from rank score. This assumes that rank score results in better performance based on the current situation than optimization based on history?