Exercise

# Extreme values in volatile time series

When you take a long series of iid data, such as several thousand observations, and select a small subset of the most extreme observations, like less than 100, then these extremes appear at random and the spaces or gaps between the extremes follow a distribution that is very close to exponential. When we carry out the same exercise for a volatile financial log-return series then the extremes appear in clusters during periods of high volatility. This is another feature of real log-return data that we need to take account of when building models.

In this exercise, you will investigate the irregular time series `djx_extremes`

which contains the 100 most extreme negative log-returns of the Dow Jones index between 1985 and 2015. You will compare it with `iid_extremes`

which contains the 100 most extreme values in an iid series of the same length as `djx_extremes`

. To do this, you will use the object `exp_quantiles`

, which contains 100 theoretical quantiles of the standard exponential distribution. These can be used to construct a Q-Q plot of each dataset against the exponential reference distribution.

The `djx_extremes`

, `iid_extremes`

, and `exp_quantiles`

objects are available in your workspace.

Instructions

**100 XP**

- Partition the plotting area into a row of 3 panels (this has been done for you)
- Use
`plot()`

and`type = "h"`

to plot`djx_extremes`

. - Use
`time()`

and`diff()`

in succession to compute the spaces between the dates of the extremes and assign them to`djx_spaces`

. - Use
`hist()`

and`as.numeric()`

in succession to make a histogram of`djx_spaces`

after coercing the data to numeric values. - Use the appropriate function to make a Q-Q plot of
`djx_spaces`

against the exponential quantiles in`exp_quantiles`

. - Carry out the previous 4 steps for
`iid_extremes`

: plot the raw data with same`type`

parameter, compute the spaces as`iid_spaces`

, make a histogram, and make a Q-Q plot.