TrendAnalysis

vecxt_re.TrendAnalysis
object TrendAnalysis

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def fitSeverityTrend(years: IndexedSeq[Int], losses: IndexedSeq[Double]): SeverityTrendResult

Fit a severity trend: log(X) = β₀ + β₁·year + ε, by ordinary least squares.

Fit a severity trend: log(X) = β₀ + β₁·year + ε, by ordinary least squares.

Use on-levelled losses above a threshold that is fixed in on-levelled terms. A significant slope means the conditional severity above the threshold is not stationary: on-levelling has left (or introduced) a trend.

Note that with a fixed threshold, a pure scale trend in a Pareto tail is invisible here: above the threshold, the Pareto is scale free, so the trend appears only as a trend in the counts above the threshold. Check the frequency trend as well.

Value parameters

losses

the (on-levelled) loss amounts, all strictly positive, same length as years

years

the year of each loss

Attributes

Returns

SeverityTrendResult containing coefficients, standard errors, p-values and the implied annual trend

def fitSeverityTrendLeaveOneOut(years: IndexedSeq[Int], losses: IndexedSeq[Double]): IndexedSeq[Option[SeverityTrendResult]]

Refit fitSeverityTrend with each loss left out in turn.

Refit fitSeverityTrend with each loss left out in turn.

With small data volumes a single loss can move the trend by more than any plausible true trend. The spread of the leave-one-out trends shows how much the result depends on individual losses.

Attributes

Returns

one entry per loss, aligned with the inputs: the fit without that loss, or None where the remaining losses cannot be fitted (fewer than 3, or all in one year)

Extensions

Extensions

extension (nb: NegativeBinomial)
def fitTrend(years: IndexedSeq[Int], counts: IndexedSeq[Int]): TrendFitResult

Fit a Negative Binomial GLM trend model: log(μ) = β₀ + β₁·year

Fit a Negative Binomial GLM trend model: log(μ) = β₀ + β₁·year

Uses IRLS with the NB2 variance function (Var = μ + μ²/θ where θ = a). This accounts for overdispersion in count data.

Value parameters

counts

the count for each observation (same length as years)

years

the year for each observation

Attributes

Returns

TrendFitResult containing coefficients, standard errors, p-values, and goodness-of-fit statistics

extension (p: Poisson)
def fitTrend(years: IndexedSeq[Int], counts: IndexedSeq[Int]): TrendFitResult

Fit a Poisson GLM trend model: log(μ) = β₀ + β₁·year

Fit a Poisson GLM trend model: log(μ) = β₀ + β₁·year

Uses IRLS to fit the model and computes test statistics for assessing whether there is a statistically significant trend over time.

Value parameters

counts

the count for each observation (same length as years)

years

the year for each observation

Attributes

Returns

TrendFitResult containing coefficients, standard errors, p-values, and goodness-of-fit statistics