R/LoB.Backtest.R

Defines functions LoB.Backtest

Documented in LoB.Backtest

#' @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)
}
EduardoRamosP/MackNet documentation built on Sept. 26, 2020, 9:21 a.m.