search for: infvect

Displaying 1 result from an estimated 1 matches for "infvect".

Did you mean: infect
2002 Jun 05
0
data manipulation, tapply
...e history would precede each scenario. Easy to code, but not too efficient. A single scenario version might look something like this: MakePremium <- function(mcrent,hisrent,mcinf,hisinf,current) { rentvect <- c(hisren,mcren) lv <- length(rentvect) rentvect <- rentvect[(lv-10):lv] infvect <- c(hisinf,mcinf) lv <- length(infvect) infvect <- infvect[(lv-9):lv] infvect <- c(1,infvect) realrent_mean(rentvect/cumprod((lv))) return(current/realrent) } (should) produces a current rent/moving average ratio. I initially jotted down this function with the inten...