UISH

Urban Intelligence Science Hub for City Network

Scaling functions

What scaling functions are for

In the Validation dashboard each statistical index contributes to a synthetic score through a weighted average. The catch is that indices do not vary linearly in meaning: going from \(R=0.90\) to \(R=0.95\) is a far bigger quality jump than \(0.50\) to \(0.55\). A scaling function reshapes the index goodness before weighting, so the score better reflects actual merit.

The computation has two stages:

  1. Raw → goodness \([0,1]\): the index is oriented and normalized (1 = best).
  2. Goodness → goodness: the scaling function \(g\) reshapes the value. With fixed endpoints \(g(0)=0\), \(g(1)=1\) the weight stays the cap of the contribution and the weights still sum to 100.

The default function is linear \(g(x)=x\): until another curve is assigned, the score is identical to the "classic" one.

Dependence on the extremes

Which curves make sense for an index depends on its theoretical domain (minimum, maximum) and its optimum. If one extreme is at infinity you cannot "rescale linearly": you need an asymptotic function. Hence four classes:

ClassWhenVariableTypical indices
finiteboth extremes finite\(x\in[0,1]\) (already-normalized goodness)R, R², Spearman, IOA, POD, CSI, FAR
one tailone extreme at \(\infty\), optimum at the finite end\(u=|val-target|/s\)RMSE, MAE, CRMSE, NME, KGE, NSE, HSS
two tailsinterior optimum + at least one extreme at \(\infty\)\(d=(val-target)/s\)MB, NMB, std_ratio
saturatingbetter = \(+\infty\)\(u=val/s\)MI (mutual information)

The scale \(s\) of the asymptotic functions is the "characteristic" error the index is judged against. For those in physical units (RMSE, CRMSE, MAE, MB) it is the RMSE/MAE reference chosen in the dashboard: the observed median of the station at hand, or the limit value from the WHO or from one of the two European directives. For percentage indices (NMB, NME, MFB, MFE) it is 100%; for dimensionless ones (\(\sigma_m/\sigma_o\), KGE, NSE, HSS, mutual information) it is 1. So \(u=1\) means "error equal to one characteristic scale".

The second stage's scale is the same that normalises the first, and this is not a convenience: were they different, switching the curve from linear to asymptotic would also switch the yardstick, and the scores of the two configurations would no longer be comparable. Changing the reference, on the other hand, moves the yardstick of both stages together — which is why the selector acts on the whole column of scores, not only on the linear one.

Function families (interactive)

The blue line is the curve; the dashed diagonal (where present) is the linear reference. Drag the sliders to see it change.

Finite domain — \(x\in[0,1]\)
Linear default

\( g(x)=x \)

No deformation: classic behaviour.

Power

\( g(x)=x^{\gamma} \)

\(\gamma>1\) rewards excellence only; \(\gamma<1\) rewards "getting off the floor".

Exponential (emphasis)

\( g(x)=\dfrac{e^{kx}-1}{e^{k}-1} \)

Strongly emphasizes the top (\(k>0\)) or the bottom (\(k<0\)).

Logarithmic

\( g(x)=\dfrac{\ln(1+kx)}{\ln(1+k)} \)

Diminishing returns: rewards the first improvements.

Logistic (threshold)

\( g(x)=\dfrac{1}{1+e^{-k(x-x_0)}} \)

S-curve around a threshold \(x_0\): "good / not good".

One-tail asymptotic — \(u=|val-target|/s\)
Rational

\( g(u)=\dfrac{1}{1+u} \)

Asymptote at 0, slow tail: lenient on outliers.

Rational squared

\( g(u)=\dfrac{1}{1+u^{2}} \)

Good compromise: \(u=1\Rightarrow 0.5\). Recommended default for errors.

Exponential

\( g(u)=e^{-u} \)

Fast tail: strongly penalizes large errors.

Hill

\( g(u)=\dfrac{1}{1+u^{n}} \)

Soft threshold tunable with \(n\).

Hyperbolic tangent

\( g(u)=1-\tanh(u) \)

Steep decay with an asymptote at 0.

Stretched exponential (Kohlrausch)

\( g(u)=e^{-u^{\beta}} \)

Generalizes the exponential (\(\beta=1\)): \(\beta<1\) lengthens the tail, \(\beta>1\) shortens it.

Saturating — \(u=val/s\)
Saturating

\( g(u)=\dfrac{u}{1+u} \)

Grows and saturates to 1: for indices where "bigger is better" (MI).

Two-tail asymptotic — \(d=(val-target)/s\)
Gaussian

\( g(d)=e^{-d^{2}} \)

Symmetric bell, gentle near the optimum.

Lorentzian

\( g(d)=\dfrac{1}{1+d^{2}} \)

Like the Gaussian but with fatter tails.

Sech squared

\( g(d)=1-\tanh^{2}(d) \)

Bell with exponential tails.

Hyperbolic tangent (signed)

\( g(d)=\tanh(d) \)

Asymmetric penalty. The curve is drawn over the whole \([-1,1]\) range, but in the score goodness lives in \([0,1]\): the negative branch is clamped to zero. Use it when a deviation is tolerable one way and not the other (an underestimate to penalise, an overestimate to ignore), not to carry a signed value into the weighted mean — being a mean of goodness values, a negative one would make it uninterpretable.

Which function for which index

Guidelines (linear is always allowed as default):

IndexDomainSuitable functionsSuggested
R, R², Spearman, IOAfinitepower, logistic, exponentialpower \(\gamma\approx2\) (rewards high values)
POD, CSIfinitepower, logisticlogistic (operational threshold)
FARfinitepower, logisticpower
RMSE, MAE, CRMSE, NMEone tailrational, rational², exponential, Hill, \(1-\tanh\)rational² (\(u=1\Rightarrow0.5\))
KGE, NSE, HSSone tail (on \(1-val\))rational, exponentialrational²
MB, NMBtwo tailsGaussian, Lorentzian, sech²Gaussian
std_ratiotwo tails (optimum 1)Gaussian, LorentzianGaussian
MIsaturatingsaturating\(u/(1+u)\)

The curve chosen for each (pollutant×index) pair is set in the Validation dashboard, in the weights panel. The technical detail (table tbl_weight_func, parser) is in the Technical overview.

Keywords: scaling functions, weights, statistical indices, score, validation

Moreno Comelli, Ugo Cortesi, Valentina Colcelli & Alessandra Langella, CNR-IFAC, 2022-2026


Code & Design by CNR-IFAC - Core by PortLab