Session Ready
Exercise

Representing a univariate time series

The very first step in the analysis of any time series is to address if the time series have the right mathematical properties to apply the standard statistical framework. If not, you must transform the time series first.

In finance, price series are often transformed to differenced data, making it a return series. In R, the ROC() (which stands for "Rate of Change") function from the TTR package does this automatically to a price or volume series x:

ROC(x)

In this exercise, you will compare plots of the Apple daily prices and Apple daily returns using the stock data contained in data, which is available in your workspace.

Instructions
100 XP
  • Plot data and name the chart "Apple stock price"
  • Apply ROC() to data to create a time series rtn containing Apple's daily returns
  • Plot data and rtn, in that order, as two new plots on a 1x2 graphical window