getrtn.bmk: getrtn.bmk

Description Usage Arguments Value Author(s) See Also Examples

Description

get the benchmark return series corresponding to the specific rtn series.

Usage

1
getrtn.bmk(rtn, bmk, date_start_pad, drop = FALSE)

Arguments

rtn

an xts,timeSeries or zoo object of portfolio returns.

bmk

a character string, giving the stockID of the benchmark index,eg. "EI000300".

date_start_pad

a Date value, indicating the start point of the first rtn period. If missing, padded by an approximate value.

Value

a xts object, giving the rtn series of the benchmark

Author(s)

Ruifei.Yin

See Also

Other LSH-frame building functions: addrtn.hedge, getrtn.LBH, getrtn.LSH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# -- daily rtn
dates <- getRebDates(as.Date("2011-03-01"),as.Date("2011-04-20"),rebFreq = "day")
TS <- getTS(dates,stocks = "EQ000002")
TSR <- getTSR(TS)
rtn <- xts::xts(TSR$periodrtn,TSR$date_end)
re <- getrtn.bmk(rtn,"EI000300")
# -- IF00 as bmk
re_IF <- getrtn.bmk(rtn,"IF00")
# -- none daily rtn
dates <- getRebDates(as.Date("2010-03-01"),as.Date("2011-04-20"),rebFreq = "month")
TS <- getTS(dates,stocks = "EQ000002")
TSR <- getTSR(TS)
rtn <- xts::xts(TSR$periodrtn,TSR$date_end)
re <- getrtn.bmk(rtn,"EI000300")
re2 <- getrtn.bmk(rtn,"EI000300",date_start_pad=as.Date("2010-03-01"))

raphael210/RFactorModel documentation built on May 26, 2019, 11:06 p.m.