Cookies help us display personalized product recommendations and ensure you have great shopping experience.

By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    predictive analytics risk management
    How Predictive Analytics Is Redefining Risk Management Across Industries
    7 Min Read
    data analytics and gold trading
    Data Analytics and the New Era of Gold Trading
    9 Min Read
    composable analytics
    How Composable Analytics Unlocks Modular Agility for Data Teams
    9 Min Read
    data mining to find the right poly bag makers
    Using Data Analytics to Choose the Best Poly Mailer Bags
    12 Min Read
    data analytics for pharmacy trends
    How Data Analytics Is Tracking Trends in the Pharmacy Industry
    5 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-25 SmartData Collective. All Rights Reserved.
Reading: Building Diversified Portfolios with R
Share
Notification
Font ResizerAa
SmartData CollectiveSmartData Collective
Font ResizerAa
Search
  • About
  • Help
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
SmartData Collective > Data Management > Risk Management > Building Diversified Portfolios with R
R Programming LanguageRisk Management

Building Diversified Portfolios with R

DavidMSmith
DavidMSmith
4 Min Read
SHARE

A common approach to reducing risk associated with financial portfolios is diversification. A portfolio made of components that are all highly correlated with each other — a portfolio composed solely of financial stocks, for example — is risky, because if there’s a wide-spread crisis that affects the banking sector, all components of the portfolio will tank at once, together. This is bad.

A common approach to reducing risk associated with financial portfolios is diversification. A portfolio made of components that are all highly correlated with each other — a portfolio composed solely of financial stocks, for example — is risky, because if there’s a wide-spread crisis that affects the banking sector, all components of the portfolio will tank at once, together. This is bad. A way to avoid risks like this is to try and choose components that are as uncorrelated (or even anti-correlated) as possible: that way, if one sector tanks, the entire portfolio isn’t brought down. 

The classical way to deal with this is problem is Markowitz mean-variance portfolio optimization: for a given level of risk (say, 12%), find the portfolio that maximizes the expected return, given the historic correlations between the different potential components (treasury bonds, equities, index funds, commodities, etc). Choosing a higher or lower level of risk will result in a different mix of components: generally more on the equities side for the higher risk levels, more in treasuries for the lower risk levels.

Portfolio managers often set constraints on the amount of stocks to be allocated specific sectors (say, 20% in finance equities and 10% in municipal bonds). Given those constraints, the classical mean-variance optimization process can still be used, but the set of solutions is constrained to those portfolios that meet the sector allocations. Nonetheless, the individual assets in those sectors are still considered independently in the optimization process.

More Read

How the New York Times uses R for Data Visualization
Are Data Scientists the Next Masters of the Universe?
2020: US Banks Are Betting Big on Analytics
Tracking Hurricane Sandy with Open Data and R
Big Data For Big Weather

A recent paper suggests a better approach might be to minimize not overall risk, but instead the average correlation of the components within each sector. The Systematic Investor blog shows that it’s easy to implement a criterion like this in the R language:

portfolio.sigma = sqrt( t(weight) %*% assets.cov %*% weight )
mean( ( weight %*% assets.cov ) / ( assets.sigma * portfolio.sigma ) )

You can then use one of R’s nonlinear solvers — they use Rdonlp2 — to maximize the equations and return the optimal portfolios for different levels of risk. (Rhe R code to do this is available at github.) Here are their results for standard mean-variance portfolios (at the top), and minimum average correlation portfolios at the bottom:

Avgcor
In each case, read the vertical line above a given level of risk to see how the optimal portfolio is allocated. At the lower risk levels, the average-correlation portfolio includes gold (GLD) and 20-year treasuries (TLT); at higher risk levels emerging markets securities (EEM) get mixed in as well.

For the full details of average-correlation portfolios and their implementation in R, see the blog post at Systematic Investor linked below.

Systematic Investor: The Most Diversified or The Least Correlated Efficient Frontier

TAGGED:Risk
Share This Article
Facebook Pinterest LinkedIn
Share

Follow us on Facebook

Latest News

street address database
Why Data-Driven Companies Rely on Accurate Street Address Databases
Big Data Exclusive
predictive analytics risk management
How Predictive Analytics Is Redefining Risk Management Across Industries
Analytics Exclusive Predictive Analytics
data analytics and gold trading
Data Analytics and the New Era of Gold Trading
Analytics Big Data Exclusive
student learning AI
Advanced Degrees Still Matter in an AI-Driven Job Market
Artificial Intelligence Exclusive

Stay Connected

1.2kFollowersLike
33.7kFollowersFollow
222FollowersPin

You Might also Like

Requirements for Becoming a Strategic Chief Risk Officer

15 Min Read

Information theft on the rise globally

1 Min Read

Risk by risk – a decision-centric approach to risk management

4 Min Read
Predictive Analytics
AnalyticsPredictive Analytics

5 Applications of Predictive Analytics

5 Min Read

SmartData Collective is one of the largest & trusted community covering technical content about Big Data, BI, Cloud, Analytics, Artificial Intelligence, IoT & more.

AI and chatbots
Chatbots and SEO: How Can Chatbots Improve Your SEO Ranking?
Artificial Intelligence Chatbots Exclusive
giveaway chatbots
How To Get An Award Winning Giveaway Bot
Big Data Chatbots Exclusive

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-25 SmartData Collective. All Rights Reserved.
Go to mobile version
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?