Skip to main content
Install Relativities before running the synthetic examples. A filed table gives a factor at stated points, and the manual says to interpolate between them. interpolate! is that table read. It takes the table, the key, and three roundings:
The example rates a personal liability policy from the synthetic carrier Example Mutual. Its manual files an increased-limit factor at four limits and a deductible credit at four deductibles.

Rate a limit between two filed points

Save the rater as liability/rater.rsl:
liability/rater.rsl
Save each table beside it, with one row for each filed point:
liability/tables/LimitFactor.csv
liability/tables/DeductibleCredit.csv
Rate a limit of 365,000, which lies between the filed 300,000 and 500,000:
The limit factor is 1.3, between the filed 1.25 and 1.40. The annual premium is 120 × 1.3 = 156.

Declare the filed points

List the filed points as a values type in Types:
Key the table by that type:
  • Use IntValues for whole points and DecimalValues for points with decimals.
  • List two points or more.
  • Put the interpolated key last in dims. Each key before it reads its row as lookup! does.
  • Select a number column after the call, here .factor.

State the three roundings

Between two filed points p1 and p2 with values v1 and v2, the read does three calculations:
Each rounding is a pair of decimal places and a rounding mode. Write all three, as the manual states them. A read that omits one gets E-LOOKUP-SYNTAX. Check the limit of 365,000 by hand: At a filed point, the read returns the value in that row as filed.
The limit of 300,000 is a filed point, so its factor is 1.25 and its premium is 150.

Round only the result

Some manuals round only the interpolated value. Write exact for ratio: and step::
exact keeps the part as an exact fraction. result: always takes decimal places and a mode. A deductible of 2,000 lies two thirds of the way from 1,000 to 2,500:
The credit is 0.08 + 2/3 × (0.17 − 0.08) = 0.14. The premium is 120 × 1.3 × (1 − 0.14) = 134.16.

Keep the key inside the filed points

A passing check proves two facts for every request the rater accepts:
  • The key lies between the first filed point and the last.
  • The table has a row for each filed point. A missing row gets E-LOOKUP-GAP.
The manual decides what happens outside the filed points. Write its rule in one of two ways. Accept only the filed range. The limit input states the range of the filed points:
Hold the end values. The deductible input accepts 250 to 10,000, and the manual holds the end credits flat. The read clamps its key to the first and last points:
A deductible of 250 takes the credit filed at 500, and 10,000 takes the credit filed at 5,000.

A key outside the filed points

The rater wide/rater.rsl accepts limits up to 2,000,000 and reads the same table:
wide/rater.rsl
wide/tables/LimitFactor.csv
The message names the range of the key and the range of the filed points. Narrow the input, clamp the key, or write the filed rule for larger limits as its own calculation. E-INTERP-RANGE shows the corrected rater.

Interpolate on filed points only

The rater bands/rater.rsl declares the limits as bands and interpolates on them:
bands/rater.rsl
bands/tables/LimitFactor.csv
A band gives one factor to a whole interval, so lookup! reads it. To interpolate, declare the points with IntValues or DecimalValues, as liability/rater.rsl does. E-INTERP-KEY explains the message.