ChainLadder icon indicating copy to clipboard operation
ChainLadder copied to clipboard

tweedieReserve : Error in summary.tweedie when rereserving = FALSE

Open bru89dadou opened this issue 5 years ago • 0 comments

Hello,

When rereserving = FALSE is specifying , summary.tweedie does not work.

This is due to the fact that in the second part of the code of the summary.tweedie function (this part is applied if rereserving = FALSE) we have

else{
    out<- list(    
      Reserve=data.frame(
        IBNR=c(mean(res$distr.res_ult),
               sd(res$distr.res_ult),
               #sd(res$distr.res_ult)/mean(res$distr.res_ult),
               quantile(res$distr.res_ult,q)
        )
      ),
      Diagnostic=c(GLMReserve=res$GLMReserve,
                   "mean(IBNR)"=mean(res$distr.res_ult))
    )
  }
  
  rownames(out$Prediction) <- c("mean", "sd", paste0(q*100, "%"))          
  print(out)
}

Therefore there is an error because out$Prediction does not exist.

It is easily fixed by changing for example :

Reserve=data.frame(
        IBNR=c(mean(res$distr.res_ult),
               sd(res$distr.res_ult),
               #sd(res$distr.res_ult)/mean(res$distr.res_ult),
               quantile(res$distr.res_ult,q)
        )

by

Prediction=data.frame(
        IBNR=c(mean(res$distr.res_ult),
               sd(res$distr.res_ult),
               #sd(res$distr.res_ult)/mean(res$distr.res_ult),
               quantile(res$distr.res_ult,q)
        )

Thank you in advance for your opinion.

bru89dadou avatar May 04 '20 10:05 bru89dadou