Free course

# Intro to Computational Finance with R

Start Free Course7 Hours87 Exercises19,031 Learners

7700 XP## Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).## Loved by learners at thousands of companies

## Course Description

In this course, you'll make use of R to analyze financial data, estimate statistical models, and construct optimized portfolios. You will learn how to build probability models for assets returns, the way you should apply statistical techniques to evaluate if asset returns are normally distributed, methods to evaluate statistical models, and portfolio optimization techniques.

The material in this course was originally developed as a complement to Prof. Eric Zivot's Coursera lectures. Having a good mathematical basis, and an interest in financial markets is recommended.

- 1
### Return calculations

**Free**Learn how to calculate, analyze and plot simple and continuously compounded returns in R.

Load the monthly Starbucks return data100 xpGet a feel for the data100 xpExtract the price data100 xpFind indices associated with the dates 3/1/1994 and 3/1/1995100 xpSubset directly on dates100 xpPlot the price data100 xpCalculate simple returns100 xpAdd dates to simple return vector100 xpCompute continuously compounded 1-month returns100 xpCompare simple and continuously compounded returns100 xpGraphically compare the simple and continuously compounded returns100 xpCalculate growth of $1 invested in SBUX100 xpCompute one simple Starbucks return50 xpCompute one continuously compounded Starbucks return50 xpMonthly compounding50 xpSimple annual Starbucks return50 xpAnnual continuously compounded return50 xp - 2
### Random variables and probability distributions

**Free**Learn how to work with probability distributions in R in the context of return and value-at-risk calculations.

Compute probabilities100 xpCompute quantiles100 xpCompute densities100 xpPlot normal curve100 xpAdd second normal curve100 xpDetermine the value-at-risk of simple monthly returns100 xpDetermine the value-at-risk of continuously compounded monthly returns100 xpCompute simple monthly returns100 xpCompute continuously compounded monthly returns100 xpCompute simple total returns and dividend yields100 xpCompute annual returns100 xpCompute portfolio shares and portfolio returns100 xp - 3
### Bivariate distributions

**Free**Explore bivariate probability distributions in R.

Covariance matrix100 xpSimulate data100 xpPlot the simulated data100 xpAdd lines to the plot100 xpCompute a joint probability100 xpNegatively correlated random variables100 xpUncorrelated random variables100 xpCorrelation50 xpCorrelation (2)50 xpCalculate the probability50 xpCalculate the probability (2)50 xpCalculate the probability (3)50 xp - 4
### Simulating time series data

**Free**Learn how to use R to simulate autoregressive and moving average processes.

- 5
### Analyzing stock returns

**Free**Learn how to analyze stock returns with the R packages PerformanceAnalytics, zoo and tseries.

- 6
### Constant expected return model

**Free**Estimate parameters of the constant expected return (CER) model, compute standard errors and confidence intervals and test various hypotheses about the parameters and assumptions of the model. Perform bootstrapping of CER model estimates.

The standard error of the variances100 xpEstimate the standard error of the correlation parameter100 xpHypothesis test for the mean100 xpInterpretation of the hypothesis test for the mean50 xpHypothesis test for the correlation100 xpInterpretation of the hypothesis test for correlation50 xpNormality of the asset returns100 xpInterpretation of the normality test50 xpBootstrapping100 xp - 7
### Introduction to portfolio theory

**Free**Compute portfolios that consist of Boeing and Microsoft, T-bills and Boeing, T-bills and Microsoft and T-bills and combinations of Boeing and Microsoft. Use R functions to compute the global minimum variance portfolio and the tangency portfolio.

Loading in your data set100 xpThe CER model100 xpA portfolio of Boeing and Microsoft stock100 xpAdding T-bills to your portfolios100 xpThe Sharpe Slope100 xpGlobal Minimum Variance Portfolio100 xpExpected return50 xpTangency Portfolio100 xpTangency portfolio and T-bills100 xpAn Efficient Portfolio with 30% Tangency100 xpAn Efficient Portfolio with the SD of Boeing100 xp - 8
### Computing efficient portfolios using matrix algebra

**Free**Using the monthly closing price data on four Northwest stocks, you will estimate expected returns, variances and covariances to be used as inputs to the Markowitz algorithm. You will compute the global minimum variance portfolio, efficient portfolios, and the tangency portfolio for short-sales allowed and for short-sales not allowed.

Loading in your data set100 xpThe CER model100 xpCorrelation50 xpThe global minimum variance portfolio - Part One100 xpStandard deviation50 xpThe global minimum variance portfolio - Part Two100 xpThe global minimum variance portfolio - End game100 xpAn efficient portfolio100 xpThe weight of Boeing50 xpThe efficient frontier100 xpThe tangency portfolio100 xpThe weight of Boeing ... again50 xp

## What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph

Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden

Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers

Decision Science Analytics, USAA

## Join over 9 million learners and start Intro to Computational Finance with R today!

### Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).