R/PV_post_mood_pm.R

Defines functions PV_post_mood_pm

Documented in PV_post_mood_pm

PV_post_mood_pm=function(data,years=10){
  n=years
  m=2*n+2
  momenti=rep(NA,m)
  U=1+data
  u=mean(U)
  for (i in 1:m) momenti[i]=moment(U,
  central = FALSE, absolute = FALSE, order =i)
  PV=((momenti[n]-1)/(momenti[n+1]-momenti[n]))-
    ((momenti[2*n+1]-momenti[n]*momenti[n+1]-momenti[2*n]+(momenti[n])^2)/((momenti[n+1]-momenti[n])^2))+
    ((momenti[n]-1)/((momenti[n+1]-momenti[n])^3))*
    (momenti[2*n+2]-(momenti[n+1])^2+momenti[2*n]-(momenti[n])^2-2*((momenti[2*n+1])-momenti[n]*momenti[n+1]))
   return(PV)
}

Try the AnnuityRIR package in your browser

Any scripts or data that you put into this service are public.

AnnuityRIR documentation built on Nov. 17, 2017, 4:23 a.m.