Learn R Programming

highfrequency (version 0.7.0.1)

makeReturns: Compute log returns

Description

Function returns an xts object with the log returns as xts object.

$$ \mbox{log return}_t = (\log(\mbox{PRICE}_{t})-\log(\mbox{PRICE}_{t-1})). $$

Usage

makeReturns(ts)

Arguments

ts

xts object

Value

an xts object containing the log returns.

Details

Note: the first (row of) observation(s) is set to zero.