google-code-export / chainladder

Automatically exported from code.google.com/p/chainladder
0 stars 0 forks source link

Cannot use package with annual-quarterly triangles #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put through data with annual-quarterly information, or any case where origin 
period and development period are different.
2. While functions like "as.triangle" would work, others (eg MackChainLadder) 
wouldn't work with origin period and development period being different.

What is the expected output? What do you see instead?
An error is produced:
Error in checkTriangle(Triangle) : 
  Number of origin periods, 22, is less than the number of development periods, 85.

What version of the product are you using? On what operating system?
Package version 0.1.7,R version 3.0.2.

Please provide any additional information below.

N/A

Original issue reported on code.google.com by miriam.m...@gmail.com on 23 Jul 2014 at 4:06

GoogleCodeExporter commented 9 years ago
You have to create an artifical triangle with the same number of rows and 
columns. In your case you have to add additional rows with NA. The help file to 
the qpaid in the ChainLadder package gives you an example how to achieve this:

library(ChainLadder)
dim(qpaid)
n <- ncol(qpaid)
Paid <- matrix(NA, n, n)
Paid[seq(1,n,4),] <- qpaid
M <- MackChainLadder(Paid)
plot(M)

Original comment by markus.g...@googlemail.com on 24 Jul 2014 at 6:37

GoogleCodeExporter commented 9 years ago
Thank you Markus, I've now got it to work with the code you posted.

Original comment by miriam.m...@gmail.com on 28 Jul 2014 at 1:34

GoogleCodeExporter commented 9 years ago

Original comment by markus.g...@googlemail.com on 28 Jul 2014 at 1:39