Displaying 1 result from an estimated 1 matches for "mcinf".
Did you mean:
mainf
2002 Jun 05
0
data manipulation, tapply
...the full
10 years worth of data.
One way to go would be to prepend the history to the mc data 50000 times so
that the 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)...