Learning R

R is an open-source programming language popular in science and finance. Run the following programs to get a taste of how it works. 

The first assignment shows how to read time series data from a public data base into R and how to transform and plot the series. The second assignment uses a simulation to determine the probability that an insurance company will run out of money. In the third assignment the Black-Scholes option price is compared with a simulation.  

The student projects show the R code for regression analysis and the estimation of copulas. 

 

Computer Assignments

 

1. South African Stock Market Index

  • R code: 

2. Ruin Probability 

  • R code: 

3. Price of European Call Option

  • R code: 

 

Student Projects

1. The Systematic Risk of Insurance Shares (CAPM)

  • Data 

  • R code 

2. Is the Share Market a Leading Economic Indicator? (VAR model) 

  • Data

  • R code 

3. Copula-Based Models of Regional Wheat Production in Australia 

  • Data  

  • R code 

 

This scatter plot is from the project on copulas. It show annual wheat yield in Victoria and New South Wales with the marginal distributions. 

Rplot2.png