Portfolio Analysis Using Tidyquant

Definitions

  • Portfolio: collection of investments
  • Volatility: how much returns fluctuate
  • Efficient: best return for level of risk
  • Inefficient: lower return for same risk

The problem

How do investors compare risk vs return across portfolios?

  • Higher returns come with risk
  • Avoid putting all your money in one stock
  • So how do we decide using data instead of intuition?

Turning Prices into Returns

  • Prices are NOT useful for risk
  • Returns are what matters in finance

Example of Daily Stock price behavior: APPL

Building a Portfolio

  • Each stock contributes differently
  • portfolio = weighted combination of assets

Sharpe Ratio

# A tibble: 4 × 4
  symbol avg_return volatility sharpe
  <chr>       <dbl>      <dbl>  <dbl>
1 AAPL      0.0143      0.0695  0.207
2 KO        0.00992     0.0484  0.205
3 MSFT      0.0134      0.0684  0.196
4 XOM       0.0271      0.0797  0.339

Risk vs Return

By using the Share ratio: - the higher the ration = better risk-adjusted return - The main idea to take away from portfolios

The solution

  • individual stocks are volatile, instead diversify
  • Risk and return are measurable
  • Data-driven beats guessing