Prophet Modelling Technique (3): Calculation Looping
In my previous post about using enumerations in Prophet, I referenced "calculation looping" in one of the illustrations. That got me thinking—not all Prophet users may be familiar with this concept. After all, not every Prophet model uses the calculation looping technique.
Let’s take a closer look at what calculation looping is, how it works, and why it’s useful—especially when you're dealing with different sets of assumptions in a single run.
What Is “Looping” in Prophet?
Broadly speaking, looping is one of several calculation techniques available in Prophet. Some of the most commonly used techniques include:
- Calculation Looping
- Rebasing
- Dynamic Run
Among these, calculation looping is generally the simplest form. In plain terms, if a model uses calculation looping, Prophet repeats its calculations multiple times within the same run.
Here's how it works:
- The number of loops is defined by the variable NUM_CLCLOOPS. Prophet will repeat calculations that many times.
- During each loop, the variable CALC_LOOP (i.e., the counter) automatically updates—starting from 1 and increasing with each iteration.
- If you want to preserve the result of a variable from a specific loop and avoid it being overwritten in the next loop, you can use the NO_CALC function.
Why Use Calculation Looping?
The biggest advantage of calculation looping is that it allows you to reuse the same set of variables for different purposes—like applying different assumption sets—all within a single run.
Let’s say you’re calculating reserves using the Gross Premium Valuation ("GPV") method. With calculation looping, you can reuse the same variables—for premiums, expenses, claims, surrenders, and so on—to calculate:
- Best Estimate Reserves
- Statutory Reserves
- Capital Reserves for RBC
This means you don’t need to duplicate variables for each scenario, and you don’t have to convert everything into array variables just to handle different reserve bases.
Reducing Errors and File Size
This approach also helps improve consistency. Under GPV, your valuation and projection scenarios should use the same variable logic. By running all scenarios in one place, you minimize the chance of discrepancies between them.
There’s a bonus, too: Prophet models that use calculation looping often produce smaller result files, because only the results from the last loop are stored—unless you specifically set up variables with CALC_LOOP and NO_CALC to retain intermediate results.
A Tip for Prophet Users in Malaysia
If you’re a Prophet user working with RBC2 requirements, calculation looping can be especially powerful. Instead of setting up multiple separate runs for each RBC2 stress scenario, you can perform them all in a single run, using different loops to handle the different stress cases.
And let’s be honest—there are a lot of runs to deal with under RBC2. So anything that helps streamline the process is worth considering.
Related Posts:
- Prophet Modelling Technique (1): Enumerations
- Prophet Modelling Technique (2): New Business Processing
- Prophet Modelling Technique (3): Calculation Looping
- Prophet Modelling Technique (4): SPCODE
Comments
Post a Comment