Displaying 1 result from an estimated 1 matches for "realrent_mean".
2002 Jun 05
0
data manipulation, tapply
...thing 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 intention of using a tapply to
create scenario by scenario calculations, but suddenly realize that tapply
doesn't really see...