Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweedieReserve : Error in summary.tweedie when rereserving = FALSE #74

Open
bru89dadou opened this issue May 4, 2020 · 0 comments
Open

Comments

@bru89dadou
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant