Learn R Programming

DCL (version 0.1.2)

Aggregate: Switch to a higher level of aggregation

Description

From the input run-off triangle (weekly, monthly, quarterly, etc.) the function creates another triangle on a higher level of aggregation.

Usage

Aggregate(triangle, freq = 4)

Arguments

triangle

The original run-off (incremental) triangle. It should be a squared matrix (let denote by m its dimension m).

freq

The frequency to be considered in the aggregation. The default value is 4, to be used to construct a yearly run-off triangle from a quarterly triangle

Value

A run-off triangle in the specified higher level of aggregation.

Details

If the input triangle does not consist of complete periods (for example a quarterly triangle with only three quarters in the last year), then the last (lower level) periods will been removed to get full aggregated periods.

See Also

get.incremental,get.cumulative,Plot.triangle

Examples

Run this code
# NOT RUN {
## A dummy example: a run-off triangle with 5*4=20 quarters
m<-20
my.square<-matrix(1,m,m)
# Now my.triangle is a quarterly triangle (the upper left triangle from my.square)
my.triangle<-my.square
my.triangle[row(my.square)+col(my.square)>(m+1)]<-NA
my.yearly.triangle<-Aggregate(my.triangle)
list(original=my.triangle,yearly=my.yearly.triangle)

# }

Run the code above in your browser using DataLab