Suppose that I have a data for U.S sector indices such as Non Durable, Durable, Manufacturing,..., etc and for the companies within each of these sectors. I am aiming to see if for the given sectors, does adding and increasing number of companies affect the portfolio risk adjusted return.
Is there a way in R that write a code to:
1- Obtain weights to be allocated for each of these sectors based on max decorrelation, 2- Create several portfolios based on investing for assets in these sectors. For example, a portfolio with 4 assets and measure its Sharpe Ratio, a portfolio with 8 assets,..., etc.
I have tried computing the max decorrelation weights for the sectors using RiskPortfolios package in the following code:
sigma =covEstimation(return_sectoral_data)
weights_max_decorrel<-round(optimalPortfolio(Sigma = sigma,
control = list(type = 'maxdec', constraint = 'lo')),2)
print(weights_max_decorrel)
Durable Manufacturing Energy Tech NonDurable
0.41 0.06 0.34 0.00 0.16
Tech Shops Health
0.00 0.03 0.00
But after getting these weights, I am not sure how can I create different portfolios based on investing in the companies of the portfolios with Non-zero weights.