Learn R Programming

ChainLadder (version 0.1.1-5)

plot.MunichChainLadder: ~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

plot.MunichChainLadder(x, myUnit = 1000, mfrow = c(2, 2), Currency = "�")

Arguments

x
~~Describe x here~~
myUnit
~~Describe myUnit here~~
mfrow
~~Describe mfrow here~~
Currency
~~Describe Currency here~~

Value

  • ~Describe the value returned If it is a LIST, use
  • comp1Description of 'comp1'
  • comp2Description of 'comp2'
  • ...

Details

~~ If necessary, more details than the description above ~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, myUnit = 1000, mfrow = c(2, 2), Currency = "�") 
{
    op = par(mfrow = mfrow)
    n <- ncol(x[["MCLPaid"]])
    barplot(t(as.matrix(data.frame(Paid = x[["MCLPaid"]][, n]/myUnit, 
        Incurred = x[["MCLIncurred"]][, n]/myUnit))), beside = TRUE, 
        legend.text = c("MCL Paid", "MCL Incurred"), names.arg = c(1:n), 
        xlab = "origin year", ylab = paste(Currency, myUnit), 
        main = "Munich Chain Ladder Results")
    barplot(t(as.matrix(data.frame(SCL.PI = 100 * x[["MackPaid"]]$FullTriangle[, 
        n]/x[["MackIncurred"]]$FullTriangle[, n], MCL.PI = 100 * 
        x[["MCLPaid"]][, n]/x[["MCLIncurred"]][, n]))), beside = TRUE, 
        legend.text = c("SCL P/I", "MCL P/I"), names.arg = c(1:n), 
        xlab = "origin year", ylab = "%", main = "Munich Chain Ladder Results")
    plot(x[["PaidResiduals"]][left.tri(x[["PaidResiduals"]])] ~ 
        x[["QinverseResiduals"]][left.tri(x[["QinverseResiduals"]])], 
        xlim = c(-2, 2), ylim = c(-2, 2), xlab = "Paid residuals", 
        ylab = "Incurred/Paid residuals", main = "Paid residual plot")
    abline(v = 0)
    abline(h = 0)
    abline(a = 0, b = x[["lambdaP"]], col = "red")
    plot(x[["IncurredResiduals"]][left.tri(x[["IncurredResiduals"]])] ~ 
        x[["QResiduals"]][left.tri(x[["QResiduals"]])], xlim = c(-2, 
        2), ylim = c(-2, 2), xlab = "Incurred residuals", ylab = "Paid/Incurred residuals", 
        main = "Incurred residual plot")
    abline(v = 0)
    abline(h = 0)
    abline(a = 0, b = x[["lambdaI"]], col = "red")
    par(op)
  }

Run the code above in your browser using DataLab