Quantopian Risk Model

Hi all!

I am an Economics / Finance undergrad student about to start writing my thesis and I would love to use Quantopian for this purpose. I have a few ideas brewing at the moment but would like to ask a question about the risk model Quantopian offers and it is a pretty basic question but I was not able to find the answer elsewhere.

Regarding the style factors, is it possible to EXCLUDE the UMD factor from the model? My current ideas relate to momentum in some shape or form and having the option to exclude the UMD factor from the risk model might be important to me.

11 responses

Hi Nikolas,

First, welcome to Quantopian!
You can find introduction here
You can find documentation here

Hi James!
Thank you for taking the time to reply. I think maybe I was not entirely clear in my question. I am not looking to replicate the QRM in terms of methodology, I intend to use it on the site as is, EXCEPT I am looking to exclude the momentum style factor from the model altogether. This is because my current ideas revolve around momentum in some shape or form and I think it would be pertinent to exclude it.

Thank you!

I'm a little confused about what you mean by 'remove the momentum style factor', if you're developing an algorithm, by default the risk model will have no impact of the returns. It's literally just describing what the performance is attributed to. If you want to constrain everything except the momentum factor (or the opposite) that can be achieved through using the risk model pipeline in conjunction with the Optimize API. Can you elaborate on what you're trying to achieve?

Hi Jamie!
I'll try to be a little more specific. My ideas for this thesis are centered around pitting one kind of momentum strategy against another. (e.g. a cross-sectional momentum vs a time-series vs dual momentum strategy). I am thinking that down the line when analyzing the results of how these strategies perform, looking at "abnormal returns" of each makes a lot of sense. Maybe my understanding of factor models are a little off, but to me, it makes sense that, when dissecting where the returns of each of these strategies are coming from (using the QRM) one should exclude the momentum factor such that the effect of this factor (which is what I would be interested in) is reflected in the intercept of the regression, which can be compared across the different momentum strategies.

In case it isn't clear, I am not interested in writing an algorithm that is necessarily profitable or performs consistently and independently of market movements. If the momentum strategies perform poorly, that is a perfectly valid result for me (assuming I operationalized it adequately). I am using Quantopian strictly for research in an academic context.
Hope that clarified it a bit!

Hi Nikolas,

You should try:

opt.experimental.RiskModelExposure(
min_momentum=opt.NotConstrained,
max_momentum=opt.NotConstrained,
)


Thank you so much Mathieu! I am still in the very very early stages of this process so I was really just inquiring to see if it was even possible but from your answer, I suppose I can infer the answer is a yes! Thank you!

You're welcome. Yes you can relax the optimizer constraints on any of the risk factors.

Just to double check that I understood you right:

By not constraining momentum in the optimizer, momentum will not be controlled for in the risk model. I.e. it is not reflected in "common returns" in the first plot found on this thread: https://www.quantopian.com/posts/new-tool-for-quants-the-quantopian-risk-model
I essentially want momentum to be reflected as my alpha.

The cumulative common returns are the returns obtained by all of an algo’s exposures in common factors (sector factors and style factors). The cumulative specific returns are the returns not explained by the common factors.
Thus momentum WILL be reflected in common returns. However, it doesn't matter here since you will see the momentum contribution in the total return (common + specific return), either if it's reflected in the specific or in the common returns.

Yepp, I follow what you're saying 100%, thank you!

I think, however, that it does in fact matter a bit. If I am looking to somehow quantify the different momentum effects across strategies and the momentum effect is specifically reflected in specific returns only, then comparing the annualized specific return across strategies seems like a decent way of quantifying the momentum effect in terms of return. But I gather that there is no way for me to tell Quantopian to drop the momentum style factor in the risk model, such that the momentum effect is reflected in specific returns and not common returns. This is not really a deal breaker, but it would have been nice to specifically quantify the momentum contribution to returns and then compare them.

And as a follow-up to what I just wrote, I'd like to ask another question and it might a dumb one, so sorry about that:
I am aware that I can plot out the exposure to specific/individual risk factors, but is it safe to make the inference that a higher exposure to the momentum risk/style factor unequivocally means that a higher portion of the returns is explained by the momentum effect? Thank you again for taking the time to reply!