R 中的定量风险管理
Alexander McNeil
Professor, University of York
常见的收益($X_t$)定义
$X_t = Z_t - Z_{t-1}$(简单收益)
$X_t = \dfrac{Z_t - Z_{t-1}}{Z_{t-1}}$(相对收益)
在小变动时与相对收益非常接近:
sp500x <- diff(log(SP500))
head(sp500x, n = 3) # note the NA in first position
^GSPC
1950-01-03 NA
1950-01-04 0.011340020
1950-01-05 0.004736539
sp500x <- diff(log(SP500))[-1]
head(sp500x)
^GSPC
1950-01-04 0.011340020
1950-01-05 0.004736539
1950-01-06 0.002948985
1950-01-09 0.005872007
1950-01-10 -0.002931635
1950-01-11 0.003516944
plot(sp500x)

R 中的定量风险管理