Exercise

Bivariate graphical analysis

A graphical analysis can often help you to get a grasp on the co-movement between financial assets. The pairs() function generates all possible pair-wise scatter plots between series.

To get a more formal grasp on the co-movement between assets, the covariance and correlation matrix of the returns can be computed by applying the var and cor on the return_matrix.

Instructions

100 XP
  • Create all possible pair-wise scatter plots between the series with the pairs() function. Additionally, set the pch argument to 16 and the col argument to slateblue1 in the pairs() function.
  • Print the 3 x 3 covariance and correlation matrix of the returns to the console.