simul simulates data for insurance applications allowing
hierarchical structures and separate models for the frequency and
severity of claims distributions.
Usage
simul(nodes, model.freq = NULL, model.sev = NULL, weights = NULL)
## S3 method for class 'portfolio'
print(x, ...)
Arguments
nodes
a named list giving the number of "nodes" at each level
in the hierarchy of the portfolio. The nodes are listed from top
(portfolio) to bottom (usually the years of experience).
model.freq
a named vector of expressions specifying the
frequency of claims model (see details); if NULL, only claim
amounts are simulated.
model.sev
a named vector of expressions specifying the severity
of claims model (see details); if NULL, only claim numbers
are simulated.
weights
a vector of weights.
x
a portfolio object.
...
potential further arguments required by generic.
Details
The order and the names of the elements in nodes,
model.freq and model.sev must match. At least one of
model.freq and model.sev must be non NULL.
nodes specifies the hierarchical layout of the portfolio. Each
element of the list is a vector of the number of nodes at a given
level. Vectors are recycled as necessary.
model.freq and model.sev specify the simulation models
for claim numbers and claim amounts, respectively. A model is
expressed in a semi-symbolic fashion using an object of mode
expression. Each element of the object
must be named and should be a complete call to a random number
generation function, with the number of variates omitted. Hierarchical
(or mixtures of) models are achieved by replacing one or more
parameters of a distribution at a given level by any combination of
the names of the levels above. If no mixing is to take place at a
level, the model for this level can be NULL.
The argument of the random number generation functions for the number
of variates to simulate must be named n.
Weights will be used wherever the name "weights" appears in a
model. It is the user's responsibility to ensure that the length of
weights will match the number of nodes when weights are to be
used. Normally, there should be one weight per node at the lowest
level of the model.
Data is generated in lexicographic order, that is by row in the output
matrix.
Value
An object of class"portfolio". A
print method for this class displays the models used in the
simulation as well as the frequency of claims for each year and entity
in the portfolio.
An object of class "portfolio" is a list containing the
following components:
data
a two dimension list where each element is a vector of
claim amounts;
weights
the vector of weights given in argument reshaped as a
matrix matching element data, or NULL;
classification
a matrix of integers where each row is a unique
set of subscripts identifying an entity in the portfolio
(e.g. integers i, j and k for data
X[ijkt]);
nodes
the nodes argument, appropriately recycled;
model.freq
the frequency model as given in argument;
model.sev
the severity model as given in argument.
It is recommended to manipulate objects of class "portfolio" by
means of the corresponding methods of functions aggregate,
frequency and severity.