returns: Calculate returns
Description
Calculate returns
Usage
returns(x, type = "r", n = 1)
Arguments
type
'r' = x[t] / x[t-n] - 1
, 'l' = ln( x[t] / x[t-n] )
Value
Vector of same length as x with absent returns converted to 0 for relative and 1 for logarithmic.