対数リターンの集計

Rで学ぶ定量的リスク管理

Alexander McNeil

Professor, University of York

対数リターンの集計

  • ただ足し合わせるだけです。
  • $(X_t)$ はリスク要因値 $(Z_t)$ から算出した日次の対数リターンとします
  • 取引週の対数リターンは各取引日の合計:

$$\ln(Z_{t+5}) - \ln(Z_t) = \sum_{i=1}^{5} X_{t+i} $$

  • 他の期間でも同様
Rで学ぶ定量的リスク管理

Rでの対数リターンの集計

  • xts パッケージで、apply.weekly() 内で sum() を使い、月次には apply.monthly() を使います
sp500x_w <- apply.weekly(sp500x, sum)
head(sp500x_w, n = 3)
                 ^GSPC
1950-01-09  0.02489755
1950-01-16 -0.02130264
1950-01-23  0.01189081

$$ $$ $$ $$

sp500x_m <- apply.monthly(sp500x, sum)
head(sp500x_m, n = 3)
                 ^GSPC
1950-01-31 0.023139508
1950-02-28 0.009921296
1950-03-31 0.004056917
Rで学ぶ定量的リスク管理

Let's practice!

Rで学ぶ定量的リスク管理

Preparing Video For Download...