Exercise

# Aggregating log-return series

In statistics, **aggregate data** are data combined from several measurements. You just learned that you can compute compute weekly, monthly and quarterly log-returns by summing daily log-returns with the corresponding `apply.weekly()`

, `apply.monthly()`

and `apply.quarterly()`

functions.

For example, you can use the following code to form the quarterly returns for a univariate time series `data`

and multivariate time series `mv_data`

:

```
> # apply.quarterly(x, FUN, ...)
> data_q = apply.quarterly(data, sum)
> mv_data_q = apply.quarterly(mv_data, colSums)
```

In this exercise, you will practice aggregating time series data using these functions and plotting the results. The data `DJ`

and `DJ_const`

are available in your workspace, as are the objects `djx`

, which contains daily log-returns of the Dow Jones index from 2000-2015, and `djreturns`

, which contains the daily log-returns for the first four `DJ_const`

stocks from 2000-2015. Use `plot`

for univariate time series and `plot.zoo`

for multivariate time series.

Instructions

**100 XP**

- Plot the object
`djx`

. - In one line, plot the weekly log-returns of
`djx`

with vertical bars. - Plot the monthly log-returns of
`djx`

with vertical bars. - Plot the object
`djreturns`

using`plot.zoo`

. - Plot the monthly log-returns for
`djreturns`

with vertical bars using`plot.zoo`

.