Tutorials › CAS Exam 8 - Advanced Ratemaking › Shape-Constrained Rating Effects

CAS Exam 8 · Predictor Design and Interactions · Tutorial 207 of 989

Shape-Constrained Rating Effects

Specify and interpret shape-constrained rating effects, and assess when a constraint is justified rather than an unsupported assumption.

Intermediate 12 min read

What You'll Learn

  • Distinguish a constraint on the log-linked predictor from one on the fitted rate
  • Express monotonicity as slope or basis-coefficient restrictions
  • Fit ordered Poisson rates when unconstrained estimates violate monotonicity
  • Construct a piecewise model with a justified turning point
  • Recognize when constraints can conceal genuine departures from an assumed shape

Why Constrain a Rating Effect?

A flexible continuous rating effect can follow patterns in the observed data, but it can also produce irregular relativities when the data are sparse or noisy. A shape constraint restricts the fitted effect to a pattern justified by the application, such as nondecreasing, nonincreasing, or decreasing and then increasing. It can stabilize estimates and keep the fitted curve consistent with established knowledge. It is not a substitute for checking whether that knowledge applies to the portfolio being rated.

The constraint concerns the modeled effect as the predictor changes, with other model terms held fixed. For example, requiring a frequency relativity to be nondecreasing in annual mileage means that the fitted frequency cannot fall as mileage increases, all else equal. It does not assert that every individual policyholder’s frequency rises with mileage, nor does it establish a causal relationship.

Definition: A shape constraint is a restriction on a fitted function that requires it to have a specified qualitative pattern over a stated predictor range. A function \(g(x)\) is nondecreasing on a range if \(g(x_1) \leq g(x_2)\) whenever \(x_1 < x_2\) in that range. It is nonincreasing if \(g(x_1) \geq g(x_2)\). These definitions allow flat portions; strict increase or decrease requires strict inequalities.

In a generalized linear model, the constraint may be stated on the linear predictor or on the response mean. For a standard log-link model, the inverse link is the exponential function, which is strictly increasing. Consequently, a nondecreasing linear predictor as a function of a rating variable produces a nondecreasing fitted mean, with other predictors fixed. That correspondence depends on the link being increasing; it should not be assumed for an arbitrary link.

Writing Shape Constraints for Continuous Effects

For a log-link model with expected response \(\mu(x)=\exp(\eta(x))\), a basic piecewise-linear effect with knot \(k\) can be written

$$ \eta(x)=\alpha+\beta_1x+\beta_2(x-k)_+, \qquad (x-k)_+=\max(0,x-k). $$

Before the knot, the slope of the log mean is \(\beta_1\). After the knot, it is \(\beta_1+\beta_2\). Thus, for this model to be nondecreasing across both segments, the restrictions are \(\beta_1 \geq 0\) and \(\beta_1+\beta_2 \geq 0\). Requiring just \(\beta_2 \geq 0\) is not enough: that restriction says the slope increases at the knot, not that either slope is nonnegative.

More generally, a differentiable effect \(\eta(x)\) is nondecreasing on an interval if its derivative is nonnegative throughout that interval. For a piecewise-linear effect, this reduces to requiring each segment slope to be nonnegative. With spline bases, restrictions are often imposed on derivatives or on a basis designed to be monotone. The signs of ordinary spline coefficients alone do not generally establish monotonicity.

One useful construction is \(\eta(x)=\alpha+\sum_j \gamma_j I_j(x)\), where each basis function \(I_j(x)\) is nondecreasing. If every \(\gamma_j \geq 0\), then \(\eta(x)\) is nondecreasing: for \(x_1<x_2\), each difference \(I_j(x_2)-I_j(x_1)\) is nonnegative, so their nonnegative weighted sum is also nonnegative. Under the log link, the fitted mean is therefore nondecreasing too. This is a sufficient construction, not the only way to impose the shape.

Why the Slope Restrictions Work

The piecewise-linear restrictions follow directly from comparing the fitted effects at two predictor values. On a segment with slope \(b\), for \(x_2>x_1\), the change in the linear predictor is \(b(x_2-x_1)\). If \(b \geq 0\), this change is nonnegative. Since the exponential function preserves order, the corresponding fitted means are ordered the same way.

$$ \frac{\mu(x_2)}{\mu(x_1)} =\exp\{\eta(x_2)-\eta(x_1)\} =\exp\{b(x_2-x_1)\}\geq 1 \quad\text{when }b\geq 0,\ x_2>x_1. $$

For a piecewise-linear curve, apply this argument separately on each segment. If every segment slope is nonnegative, moving from any \(x_1\) to any larger \(x_2\) accumulates only nonnegative changes, including when the path crosses a knot. The same reasoning applies to a nonincreasing effect with all segment slopes nonpositive.

Worked Example: Checking a Monotone Piecewise-Linear Frequency Effect

A hypothetical insurer models claim frequency with a Poisson GLM and log link. Holding other rating variables fixed, the fitted frequency at \(x=0\) is \(0.0400\) claims per exposure unit. The log-frequency effect is linear up to \(x=2\), with slope \(0.08\), and then has slope \(0.05\). Find the fitted frequencies at \(x=0,2,4\), and check whether the effect is nondecreasing.

Method. Represent the effect with a hinge at \(k=2\): \(\eta(x)=\log(0.04)+0.08x-0.03(x-2)_+\). The hinge coefficient is \(-0.03\) because the slope after the knot must be \(0.08-0.03=0.05\). This is a hypothetical fitted model; it assumes the stated log-link structure and holds the other predictors fixed.

At \(x=0\), the hinge is zero and the baseline is \(0.04\), so the fitted frequency is \(0.0400\).

At \(x=2\), the hinge is still zero. The change in the linear predictor from \(x=0\) is \(0.08(2)=0.16\). Therefore, \(\mu(2)=0.04\exp(0.16)=0.04(1.1735109)=0.0469404\), or \(0.04694\) to five decimal places.

At \(x=4\), the hinge equals \(4-2=2\). The change in the linear predictor is \(0.08(4)-0.03(2)=0.32-0.06=0.26\). Thus, \(\mu(4)=0.04\exp(0.26)=0.04(1.2969301)=0.0518772\), or \(0.05188\) to five decimal places.

The two segment slopes are \(0.08\) and \(0.05\), both positive, so the curve is nondecreasing. The computed frequencies also satisfy \(0.04000 < 0.04694 < 0.05188\), which checks the result. Common mistake avoided: the hinge term changes the slope after \(x=2\); it does not replace the original slope. Using \(0.08-0.03\) for the whole range would miscalculate the frequency at \(x=2\).

Constraints as Part of Estimation

A constraint is ordinarily imposed while estimating the model, not by editing fitted values afterward. In a GLM, the model parameters are estimated to optimize the specified likelihood subject to restrictions such as \(C\beta \geq 0\). The resulting estimate is the best fit under both the likelihood and the restrictions. Simply rearranging fitted relativities after an unconstrained fit does not, in general, produce that constrained maximum-likelihood estimate.

Ordered groups provide a transparent illustration of the likelihood calculation, even when the eventual rating effect is represented continuously between selected predictor values. Suppose the observations in ordered groups have Poisson counts \(N_j\) and exposures \(E_j\). If the group rates \(\lambda_j\) are constrained to be nondecreasing, the fitted rates must satisfy \(\lambda_1 \leq \lambda_2 \leq \cdots\). When two adjacent unconstrained rates violate that order, their estimates may need to be pooled. For a pooled block, the Poisson maximum-likelihood rate is total count divided by total exposure.

Worked Example: Enforcing an Ordered Frequency Pattern

A hypothetical portfolio is divided into four ordered mileage bands for a Poisson frequency analysis. Each band has 100 exposure units. Claim counts are 10, 16, 12, and 22, respectively. Find the maximum-likelihood rates under the constraint that frequency is nondecreasing across the four bands.

Method. For a Poisson count with exposure \(E\) and rate \(\lambda\), the mean count is \(E\lambda\), and the unconstrained maximum-likelihood rate is count divided by exposure. The four unconstrained rates are \(10/100=0.10\), \(16/100=0.16\), \(12/100=0.12\), and \(22/100=0.22\). The middle two violate the required order because \(0.16>0.12\).

Pool the two violating middle bands. Their combined count is \(16+12=28\), and their combined exposure is \(100+100=200\). The common fitted rate for the pooled block is \(28/200=0.14\). The resulting four rates are \(0.10, 0.14, 0.14, 0.22\), which satisfy the constraint.

To see why the pooled value is the likelihood optimum for the block, write its log likelihood, omitting constants, as \(28\log(\lambda)-200\lambda\). Its derivative is \(28/\lambda-200\). Setting this equal to zero gives \(\lambda=28/200=0.14\), and the second derivative, \(-28/\lambda^2\), is negative. The pooled rate also fits between the unpooled neighboring rates: \(0.10\leq0.14\leq0.22\). Thus the result respects the constraint at both boundaries. Common mistake avoided: averaging the two rates without accounting for exposure would only be justified here because the two exposures are equal. With unequal exposures, pool total counts over total exposure.

Constraints Need a Justified Shape

A monotonicity restriction should reflect a defensible expectation over a specified range, not a preference for a tidy graph. Potential support may come from an operational mechanism, established underwriting practice, or credible evidence that the relationship has a known direction. The justification should also address the response being modeled: a pattern expected for claim frequency need not hold for severity or pure premium.

The assumption may fail in parts of the predictor range. For instance, experience could support a decrease up to a threshold and an increase afterward. A globally nondecreasing or nonincreasing model would suppress that pattern. A more appropriate model can allow a specified turning point, or the shape can be constrained only on the range where the assumption is defensible. Extrapolation beyond well-supported data deserves particular caution: a shape constraint controls direction, but does not make distant predictions reliable.

Worked Example: A Decrease-Then-Increase Effect

For a hypothetical book, an actuary has a defensible reason to model frequency as decreasing with equipment age up to 30 years and increasing thereafter. Assume a Poisson GLM with log link. With other predictors fixed, set the fitted frequency at age 0 to \(0.12\), use slope \(-0.01\) through age 30, and use slope \(0.005\) after age 30. Calculate the fitted frequencies at ages 20, 30, and 40 and check the specified shape.

Method. A continuous piecewise-linear log-frequency effect with a knot at 30 is \(\eta(x)=\log(0.12)-0.01x+0.015(x-30)_+\). The coefficient \(0.015\) changes the slope from \(-0.01\) to \(-0.01+0.015=0.005\). This assumes the turning point and directions are appropriate for the hypothetical application.

At age 20, the hinge is zero and the predictor change from age 0 is \(-0.01(20)=-0.20\). The frequency is \(0.12\exp(-0.20)=0.12(0.8187308)=0.0982477\), or \(0.0982\) to four decimal places.

At age 30, the hinge remains zero. The predictor change is \(-0.01(30)=-0.30\), giving \(0.12\exp(-0.30)=0.12(0.7408182)=0.0888982\), or \(0.0889\) to four decimal places.

At age 40, the hinge is \(40-30=10\). The predictor change is \(-0.01(40)+0.015(10)=-0.40+0.15=-0.25\). Equivalently, relative to age 30, the change is \(0.005(10)=0.05\). The fitted frequency is \(0.12\exp(-0.25)=0.12(0.7788008)=0.0934561\), or \(0.0935\) to four decimal places.

The values decrease from \(0.0982\) to \(0.0889\) through age 30, then rise to \(0.0935\) at age 40. Common mistake avoided: applying the post-knot slope to the entire age range gives the wrong value. After age 30, the slope applies only to the additional years beyond the knot.

Practical Checks and Common Traps

A constrained fitted curve should be reviewed as a model assumption, not merely as a successful optimization. Confirm the predictor’s direction and units, the range over which the restriction applies, and whether the constraint is on the linear predictor, response mean, or another quantity. Then inspect fitted values across the range and compare the constraint with the observed data and relevant business knowledge.

  • Confusing curvature with direction. A positive second derivative or a slope that increases at a knot does not imply a nondecreasing function. Check the slope itself on every segment.
  • Constraining the wrong scale. Under a log link, the log mean and mean have the same monotonic direction because the exponential is increasing. That need not hold for a nonmonotone inverse link.
  • Assuming constraints are harmless. A constraint can reduce variance when it is appropriate, but can introduce systematic bias when the true effect violates it.
  • Treating a constrained fit as proof of domain knowledge. The optimizer will satisfy the imposed restrictions whether or not the restrictions are substantively correct.
  • Ignoring the supported range. A monotone curve may continue in the same direction beyond observed data while its magnitude is poorly determined.
Key takeaway: State the shape, response scale, predictor range, and substantive justification before imposing a restriction. Translate the shape into valid parameter or derivative constraints, estimate under those constraints, and check that the fitted curve remains credible for its intended rating use.

Check Your Understanding

Work each problem before checking its final answer. Frequencies are modeled with a Poisson GLM and log link unless stated otherwise.

  1. A log-frequency effect has slope \(0.04\) up to \(x=5\), then slope \(-0.01\) after \(x=5\). Is it nondecreasing across both segments? State the two slope restrictions needed for nondecreasing behavior. (Answer: No; the segment slopes are \(0.04\) and \(-0.01\), so the second segment decreases. Both slopes must be nonnegative.)
  2. A fitted frequency at \(x=0\) is \(0.05\). A piecewise-linear log effect has slope \(0.03\) through \(x=4\) and slope \(0.01\) after \(x=4\). Find the frequency at \(x=6\), to five decimal places, and state whether the effect is nondecreasing. (Answer: \(0.05\exp(0.03(4)+0.01(2))=0.05\exp(0.14)=0.05751\); yes, both slopes are positive.)
  3. Three ordered bands have exposures 50, 100, and 50, and counts 4, 15, and 5. Find the nondecreasing Poisson rates. (Answer: The unconstrained rates are \(0.08, 0.15, 0.10\); pool the last two, giving \(20/150=0.1333\), so the constrained rates are \(0.08, 0.1333, 0.1333\).)
  4. A log-frequency curve has slope \(-0.02\) up to \(x=10\) and slope \(0.01\) thereafter. The frequency at \(x=0\) is \(0.20\). Find the frequency at \(x=15\), to four decimal places, and identify the shape. (Answer: The predictor change is \(-0.02(10)+0.01(5)=-0.15\), so the frequency is \(0.20\exp(-0.15)=0.1721\); the curve decreases then increases.)
  5. Explain why a nonnegative coefficient on a hinge term \((x-k)_+\) alone does not ensure a nondecreasing two-segment log effect \(\eta(x)=\alpha+\beta_1x+\beta_2(x-k)_+\). (Answer: The slopes are \(\beta_1\) before the knot and \(\beta_1+\beta_2\) after it. Nondecrease requires both \(\beta_1\geq0\) and \(\beta_1+\beta_2\geq0\); the sign of \(\beta_2\) alone does not ensure either condition.)
Clinical Biostats