Skip to main content
HomeR

Introduction to Portfolio Analysis in R

Apply your finance and R skills to backtest, analyze, and optimize financial portfolios.

Start Course for Free
5 hours14 videos57 exercises33,536 learnersTrophyStatement of Accomplishment

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Group

Training 2 or more people?

Try DataCamp for Business

Loved by learners at thousands of companies


Course Description

A golden rule in investing is to always test the portfolio strategy on historical data, and, once you are trading the strategy, to constantly monitor its performance. In this course, you will learn this by critically analyzing portfolio returns using the package PerformanceAnalytics. The course also shows how to estimate the portfolio weights that optimally balance risk and return. This is a data-driven course that combines portfolio theory with the practice in R, illustrated on real-life examples of equity portfolios and asset allocation problems. If you'd like to continue exploring the data after you've finished this course, the data used in the first three chapters can be obtained using the tseries-package.
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
DataCamp for BusinessFor a bespoke solution book a demo.

In the following Tracks

Finance Fundamentals in R

Go To Track

Quantitative Analyst in R

Go To Track
  1. 1

    The Building Blocks

    Free

    Asset returns and portfolio weights; those are the building blocks of a portfolio return. This chapter is about computing those portfolio weights and returns in R.

    Play Chapter Now
    Welcome to the course
    50 xp
    Getting a grasp of the basics
    50 xp
    Get a feel for the data
    100 xp
    The portfolio weights
    50 xp
    Calculating portfolio weights when component values are given
    100 xp
    The weights of an equally weighted portfolio
    50 xp
    The weights of a market capitalization-weighted portfolio
    100 xp
    The portfolio return
    50 xp
    Calculation of portfolio returns
    100 xp
    From simple to gross and multi-period returns
    50 xp
    The asymmetric impact of gains and losses
    50 xp
    PerformanceAnalytics
    50 xp
    Buy-and-hold versus (daily) rebalancing
    50 xp
    The time series of asset returns
    100 xp
    The time series of portfolio returns
    100 xp
    The time series of weights
    100 xp
  2. 2

    Analyzing Performance

    The history of portfolio returns reveals valuable information about how much the investor can expect to gain or lose. This chapter introduces the R functionality to analyze the investment performance based on a statistical analysis of the portfolio returns. It includes graphical analysis and the calculation of performance statistics expressing average return, risk, and risk-adjusted return over rolling estimation samples.

    Play Chapter Now
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

In the following Tracks

Finance Fundamentals in R

Go To Track

Quantitative Analyst in R

Go To Track

datasets

Stock prices for Apple and MicrosoftBonds pricesCommodities pricesEquities pricesStock prices for DIJAReal estate pricesDaily prices in S&P 500

collaborators

Collaborator's avatar
Lore Dirick
Kris Boudt HeadshotKris Boudt

Professor of Finance and Econometrics at VUB and VUA

See More

What do other learners have to say?

Join over 15 million learners and start Introduction to Portfolio Analysis in R today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.