#' @title LoB.Backtest
#' @description It computes the percentile of the observed data vs the distribution generated by AY and totals.
#' @param Reservest.D Total reserves sampled by the model.
#' @param Reservest.D.Vector Total reserves by AY sampled by the model.
#' @param Reserves.Validation Actual reserve.
#' @return Percentile of the observed data vs the distribution generated by AY and totals.
#' @import keras
#' @import abind
#' @export
#'
LoB.Backtest=function(Reservest.D,Reservest.D.Vector,Reserves.Validation){
dimension=dim(Reservest.D.Vector)[1];Out=0
for (i in 2:dimension){
Dist=ecdf(Reservest.D.Vector[i,])
Out[i]=Dist(Reserves.Validation[i])
}
Dist=ecdf(Reservest.D)
Out[i+1]=Dist(sum(Reserves.Validation))
return(Out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.