% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/600_catxl.R
\name{catxl}
\alias{catxl}
\title{Applies CatXL Layers to a YLT}
\usage{
catxl(longylt, limit, deductible, nrst, premium, rst_premium_pc)
}
\arguments{
\item{longylt}{A longylt in \code{yltsim} format}

\item{limit}{A vector of limits for the CatXL layers.}

\item{deductible}{A vector of deductibles for the CatXL layers.}

\item{nrst}{A vector giving the numbers of reinstatements in each layer}

\item{premium}{The overall premium (can be set to 0)}

\item{rst_premium_pc}{The reinstatement premium, as a percentage}
}
\value{
A list containing 3 data frames:
\itemize{
\item \code{summary}AAL ann average annual premium for each layer
\item \code{shortrecord}Diagnostics by year by layer
\item \code{longrecord}Diagnostics by event (aka claim) by layer
}
}
\description{
Reads a YLT generated by \code{yltsim} format and applies CatXL layers,
to generate multiple outputs and diagnostics.
}
\details{
Based on the description of catXL pricing given at:
}
\examples{
#
# 1 create an example ELT
#
nevents=1000
totalannualrate=3
evid=c(1:nevents)
mloss=(c(1:nevents)^2)/100 #max is 10k
mrate=rep(totalannualrate/nevents,nevents)
elt=data.frame(evid,mrate,mloss)
#
# 2 example 1
#
message("**************************************************************")
message("Example 1: 2 years of simulation, 2 layers, detailed outputs  ")
message("**************************************************************")
#
# 3 simulate a 2 year YLT
#
nyears=2
set.seed(3)
ylt=yltsim(nyears=nyears,elt)
#
# 4 set up 2 catXL layers
#
limit=c(2000,4000)
deductible=c(1000,3000)
nrst=c(2,2)
premium=1000
rst_premium_pc=c(80,90)
#
# 5 analyze the catXL
#
catxlresults=catxl(ylt,limit,deductible,nrst,premium,rst_premium_pc)
#
# 6 look at the results
#
message("\nsummary:")
print(catxlresults$summary)
message("\nshortrecord:")
print(catxlresults$shortrecord)
message("\nlongrecord:")
print(catxlresults$longrecord)
#
# 7 example 2
#
message("**************************************************************")
message("Example 2: 1k years of simulation, 1 layer, summary outputs")
message("**************************************************************")
nyears=100
#
# 8 simulate 2x 1k YLTs to investigate convergence
#
set.seed(1);ylt1=yltsim(nyears=nyears,elt)
set.seed(2);ylt2=yltsim(nyears=nyears,elt)
#
# 9 set up 1 catXL layer this time
#
limit=c(2000)
deductible=c(1000)
nrst=c(1)
premium=1000
rst_premium_pc=c(80)
#
# 10 analyze the catXL and look at the summary results
#
message("\nylt1 summary:")
print(catxl(ylt1,limit,deductible,nrst,premium,rst_premium_pc)$summary)
message("\nylt2 summary:")
print(catxl(ylt2,limit,deductible,nrst,premium,rst_premium_pc)$summary)
}
\seealso{
\code{yltsim}, to generate the required YLT input
}
\author{
Stephen Jewson \email{stephen.jewson@gmail.com}
}
