triangles-class | R Documentation |
This is a S4 class that has "list" in the data part. This class is created to facilitate validation and extraction of data.
Objects can be created by calls of the form new("triangles", ...)
, or use as(...,"triangles")
, where ...
is a "list".
.Data
:Object of class "list"
Class "list"
, from data part.
Class "vector"
, by class "list", distance 2.
signature(ModelFit = "GMCLFit", FullTriangles = "triangles")
: See 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
.
signature(from = "list", to = "triangles")
: Method to construct a "triangles" object from "list".
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.
signature(x = "triangles", y="missing")
: Method to column bind all triangles using cbind
internally.
signature(x = "triangles", y="missing")
: Method to row bind all triangles using rbind
internally.
Wayne Zhang actuary_zhang@hotmail.com
See also MultiChainLadder
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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.