Trend#

class chainladder.Trend(trends=0.0, dates=None, axis='origin')[source]#

Estimator to create and apply trend factors to a Triangle object. Allows for compound trends as well as storage of the trend matrix to be used in other estimators, such as CapeCod.

Parameters:
trends: list-like

The list containing the annual trends expressed as a decimal. For example, 5% decrease should be stated as -0.05

dates: list of date-likes

A list-like of (start, end) dates to correspond to the trend list.

axis: str (options: [‘origin’, ‘valuation’])

The axis on which to apply the trend

Attributes:
trend_:

A triangle representation of the trend factors

fit(X, y=None, sample_weight=None)[source]#

Fit the model with X.

Parameters:
X: Triangle-like

Data to which the model will be applied.

y: Ignored
sample_weight: Ignored
Returns:
self: object

Returns the instance itself.

transform(X, y=None, sample_weight=None)[source]#

If X and self are of different shapes, align self to X, else return self.

Parameters:
X: Triangle

The triangle to be transformed

Returns:
X_new: New triangle with transformed attributes.

Inherited Methods

Trend.fit_transform

Fit to data, then transform it.

Trend.get_metadata_routing

Get metadata routing of this object.

Trend.get_params

Get parameters for this estimator.

Trend.set_output

Set output container.

Trend.set_params

Set the parameters of this estimator.

Trend.to_json

Serializes triangle object to json format

Trend.to_pickle

Serializes triangle object to pickle.