R/rollVsBM.R

Defines functions rollVsBM

rollVsBM = function(Ra, Rb, width = 12, FUN = "ActivePremium"){
  f = match.fun(FUN)
  Ra = na.omit(Ra)
  Rb = Rb[index(Ra)]
  if(indexClass(Ra) != "Date"){
    indexClass(Ra) = "Date"
    indexClass(Rb) = "Date"
  }
  roll = apply.rolling(Ra, 
                       width = width, 
                       FUN = function(Ra)f(Ra, Rb))
  
  
  
}
bplloyd/CoreHF documentation built on July 26, 2017, 10:01 p.m.