triangles-class: S4 Class "triangles"

triangles-classR Documentation

S4 Class "triangles"

Description

This is a S4 class that has "list" in the data part. This class is created to facilitate validation and extraction of data.

Objects from the Class

Objects can be created by calls of the form new("triangles", ...), or use as(...,"triangles"), where ... is a "list".

Slots

.Data:

Object of class "list"

Extends

Class "list", from data part. Class "vector", by class "list", distance 2.

Methods

Mse

signature(ModelFit = "GMCLFit", FullTriangles = "triangles"): See Mse

Mse

signature(ModelFit = "MCLFit", FullTriangles = "triangles"): See Mse

[

signature(x = "triangles", i = "missing", j = "numeric", drop = "logical"): Method for primitive function "[" to subset certain columns. If drop=TRUE, rows composed of all "NA"s are removed. Dimensions are not dropped.

[

signature(x = "triangles", i = "missing", j = "numeric", drop = "missing"): Method for primitive function "[" to subset certain columns, where rows composed of all "NA"s are removed. Dimensions are not dropped.

[

signature(x = "triangles", i = "numeric", j = "missing", drop = "logical"): Method for primitive function "[" to subset certain rows. If drop=TRUE, columns composed of all "NA"s are removed. Dimensions are not dropped.

[

signature(x = "triangles", i = "numeric", j = "missing", drop = "missing"): Method for primitive function "[" to subset certain rows, where columns composed of all "NA"s are removed. Dimensions are not dropped.

[

signature(x = "triangles", i = "numeric", j = "numeric", drop = "missing"): Method for primitive function "[" to subset certain rows and columns. Dimensions are not dropped.

[<-

signature(x = "triangles", i = "numeric", j = "numeric", value = "list"): Method for primitive function "[<-" to replace one cell in each triangle with values specified in value.

coerce

signature(from = "list", to = "triangles"): Method to construct a "triangles" object from "list".

dim

signature(x = "triangles"): Method to get the dimensions. The return value is a vector of length 3, where the first element is the number of triangles, the sencond is the number of accident years, and the third is the number of development years.

cbind2

signature(x = "triangles", y="missing"): Method to column bind all triangles using cbind internally.

rbind2

signature(x = "triangles", y="missing"): Method to row bind all triangles using rbind internally.

Author(s)

Wayne Zhang actuary_zhang@hotmail.com

See Also

See also MultiChainLadder

Examples

data(auto)

# "coerce"
auto <- as(auto,"triangles")  # transform "list" to be "triangles"

# method for "["
auto[,4:6,drop=FALSE] # rows of all NA's not dropped
auto[,4:6]			# drop rows of all NA's

auto[8:10, ,drop=FALSE] #columns of all NA's not dropped
auto[8:10, ] 			#columns of all NA's  dropped

auto[1:2,1]

# replacement method
auto[1:2,1] <- list(1,2,3)
auto[1,2]
   
dim(auto)

cbind2(auto[1:2,1])
rbind2(auto[1:2,1])

ChainLadder documentation built on Sept. 11, 2024, 8:35 p.m.