IniziaInizia gratis

Testing normality for longer time horizons

As returns are added together over longer time periods, a central limit effect takes place and returns tend to become more normal.

In this exercise, you will use aggregation functions that you learned in the first chapter to aggregate the data in djx_d, containing the daily log-returns for 29 of the Dow Jones stocks for the period 2000-2015. Then, you'll apply the Jarque-Bera test to the daily, weekly and monthly returns. djx_d is loaded in your workspace.

Questo esercizio fa parte del corso

Quantitative Risk Management in R

Visualizza il corso

Istruzioni dell'esercizio

  • Calculate weekly and monthly log-returns of djx_d and assign to djx_w and djx_m, respectively.
  • Fill in apply() to calculate the p-value of the Jarque-Bera test for each of the Dow Jones daily return series in djx_d.
  • Do the same for the weekly equity returns in djx_w.
  • Do the same for the monthly equity returns in djx_m.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Calculate weekly and monthly log-returns from djx_d
djx_w <- ___(___)
djx_m <- ___(___)

# Calculate the p-value for each series in djx_d
apply(___, 2, function(v){jarque.test(v)$p.value})

# Calculate the p-value for each series in djx_w
apply(___, 2, function(v){jarque.test(v)$p.value})

# Calculate the p-value for each series in djx_m
apply(___, 2, function(v){jarque.test(v)$p.value})
Modifica ed esegui il codice