Learn R Programming

LIHNPSD (version 0.2.1)

TimeSeriesLogReturn: Convert price series to log-return series

Description

Convert daily price series to log-return series by a specified time interval

Usage

TimeSeriesLogReturn(pr, days)

Arguments

pr
Array of daily prices
days
Time interval, typically 1 for one day

Value

Examples

Run this code
  pr <- c( 100.0, 102.0, 106.0, 105.0 )
  logr <- TimeSeriesLogReturn(pr,1)

Run the code above in your browser using DataLab