檢驗外匯報酬的常態性
到目前為止,本章的練習已經檢查了股票指數報酬與單一股票報酬的常態性。
為了鞏固這些概念,你將把相同的想法套用到匯率對數報酬。資料集 fx_d 包含 2001–2015 年間 EUR/USD、GBP/USD 與 JPY/USD 匯率的每日對數報酬;資料集 fx_m 則包含對應的每月對數報酬。兩者都是多變量資料,已載入到你的工作空間。
哪一個每月對數報酬序列看起來最接近常態?
本練習屬於課程
R 的量化風險管理
練習說明
- 使用合適的繪圖函式,將
fx_d的每日匯率對數報酬序列繪圖。 - 使用
apply()對fx_d中每個序列進行 Jarque-Bera 檢定。 - 使用相同的繪圖函式,並加上參數
type = "h",將fx_m的每月對數報酬序列繪圖。 - 使用
apply()對fx_m中每個序列進行 Jarque-Bera 檢定。 - 使用
apply()對fx_m中每個序列配適 Student t 分配,並取得參數估計值。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Plot the daily log-return series in fx_d
___(___)
# Apply the Jarque-Bera test to each of the series in fx_d
___(___)
# Plot the monthly log-return series in fx_m
___(___)
# Apply the Jarque-Bera test to each of the series in fx_m
___(___)
# Fit a Student t distribution to each of the series in fx_m
apply(___, ___, function(v){fit.st(v)$par.ests})