Quantitative Risk Management in R
Alexander McNeil
Professor, University of York
Common definitions of returns ($X_t$)
$X_t = Z_t - Z_{t-1}$ (simple returns)
$X_t = \dfrac{Z_t - Z_{t-1}}{Z_{t-1}}$ (relative returns)
Very close to relative returns for small changes:
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)
Quantitative Risk Management in R