You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Does the EfficientFrontier with capm_returns and ledoit_wolf assign more weight to recently listed stocks? #514
S = risk_models.CovarianceShrinkage(prices).ledoit_wolf()
mu = pypfopt.expected_returns.capm_return(prices)
ef = EfficientFrontier(mu, S)
ef.add_objective(objective_functions.L2_reg, gamma=(0.1))
ef.efficient_risk(0.025)
weights = ef.clean_weights()
su = pd.DataFrame([weights])
#finding zero weights
num_small = len([k for k in weights if weights[k] <= 1e-4])
global_dict[int(userId)]['num_small'] = str(f"{num_small}/{len(ef.tickers)} tickers have zero weight")
fig = px.pie(su, values=weights.values(), names=su.columns)
fig.update_traces(textposition='inside')
fig.update_layout(width=500, height=500, uniformtext_minsize=12, uniformtext_mode='hide', title_text='Weights Distribution using Capital Asset Pricing Model', title_x=0.5)
I have gathered the top 40 US stocks by market cap + a recently listed stock GLBE, and run the above on it
GLBE was listed on May 2021
And I have the following output:
The weights return of the above code
The allocation return of the above code
When using another recently listed stock (MNDY) instead of GLBE I get similar results:
Is there more weights allocated in this setup to more recently listed stocks? or this is by chance ?
Yes, that is by chance, not by our setup. If you prefer allocations with more recent stocks, you should do it yourself because there is no algorithm or atleast I dont know any algorithm that can do that.
I am temporarily closing this issue. If you would like to discuss it further, please feel free to reopen it.
Activity
88d52bdba0366127fffca9dfa93895 commentedon Apr 28, 2023
Hi @Originn,
Yes, that is by chance, not by our setup. If you prefer allocations with more recent stocks, you should do it yourself because there is no algorithm or atleast I dont know any algorithm that can do that.
I am temporarily closing this issue. If you would like to discuss it further, please feel free to reopen it.