Transform Reference

Financial & Statistical Verbs

Time value of money calculations (compound interest, loan payments, future/present value) and statistical functions.

Time Value of Money

VerbSyntaxDescriptionTry It
compound%compound @principal @rate @periodsFuture value: P * (1 + r)^n Try
discount%discount @fv @rate @periodsPresent value: FV / (1 + r)^n Try
pmt%pmt @principal @rate @periodsPayment for loan Try
fv%fv @payment @rate @periodsFuture value of annuity Try
pv%pv @payment @rate @periodsPresent value of annuity Try
npv%npv @rate @cashflowsNet present value Try

Statistics (Array-Based)

VerbSyntaxDescriptionTry It
std%std @array.fieldStandard deviation (population) Try
median%median @array.fieldMedian value Try
mode%mode @array.fieldMost frequent value Try
percentile%percentile @array.field @pctNth percentile (0-100) Try
correlation%correlation @arr1 @arr2Pearson correlation Try
movingAvg%movingAvg @array ##windowSizeRolling window average (partial window at start) Try

Reference

Moving Average (movingAvg) — Rolling Window

Computes a rolling (moving) average over an array of numeric values. Returns an array of the same length as the input.

  • Window size must be a positive integer (≥ 1).
  • Partial windows are used at the start — the first element averages just itself, the second averages elements 0–1, etc., until the full window size is reached.
  • Non-numeric values in the array are treated as 0.
  • Returns null if input is not an array or window size is invalid.

Example: %movingAvg [10, 20, 30, 40, 50] ##3[10, 15, 20, 30, 40]

Examples

Financial/statistical examples
; Time value of money
future_value = %compound ##10000 #0.05 ##10          ; 10000 * 1.05^10 -> 16288.95

; Statistics
volatility = %std @claims.amount                     ; Standard deviation
median_premium = %median @policies.premium           ; Middle value
q3 = %percentile @values ##75                        ; 75th percentile

; Rolling average
smoothed = %movingAvg @dailyValues ##3               ; 3-period rolling avg