ldhmm.ts_log_rtn {ldhmm}R Documentation

Get log-returns from historic prices of an index

Description

This utility returns the dates and log-returns of an index available in the package. Note that the data is static. A limited set of live daily time series can be appended from FRED, e.g. SPX, VIX, DJIA.

Usage

ldhmm.ts_log_rtn(
  symbol = "spx",
  start.date = "1950-01-01",
  end.date = "2015-12-31",
  on = "weeks",
  fred.data = FALSE
)

Arguments

symbol

character, specify the symbol of the index, default is spx. If fred.data is true, the program can infer FRED symbol as upper case of symbol.

start.date, end.date

Date or character of ISO format (YYYY-MM-DD), to specify the date range, default is from 1950-01-01 to 2015-12-31. Set start.date and end.date to NULL or "" if you wish to get the entire time series.

on

character, specify the interval, days, weeks, months. Default is weeks.

fred.data

logical, specify whether to append daily time series data from FRED, default is FALSE.

Value

list of three vectors: d is the dates and x is log-returns and p is prices

Author(s)

Stephen H. Lihn

Examples

a <- ldhmm.ts_log_rtn()

[Package ldhmm version 0.6.1 Index]