-
Notifications
You must be signed in to change notification settings - Fork 16
Statistical methods
Gridpp supports a number of basic statistical methods for gridded forecasts. Many of these methods can be represented by a calibration curve.
The function apply_curve
performs this adjustment. The curve itself can be constructed by using various methods.
Quantile mapping uses the relationship between historical forecasts and a reference dataset. A curve is created by sorting the forecast and reference points.
gridpp.quantile_mapping(input, fcst, ref, policy)
where input
is either a scalar, a 1D vector, or a 2D vector, fcst
is a 1D vector of forecast samples, ref
is a 1D vector of reference samples, and policy
is an extrapolation policcy specifying how values are extrapolated outside the domain of fcst
. The following extrapolation policies are supported: gridpp.OneToOne
, a one-to-one line is used outside the domain); gridpp.MeanSlope
, the slope between the two extreme points on the curve is used to extrapolate; gridpp.NearstSlope
, the slope between the two lowest points is used below the curve (similarly for the two highest points); and gridpp.Zero
, a slope of 0 outside the curve.
Here is an example:
input = 275
fcst = [250, 270, 290, 310]
ref = [240, 275, 290, 305]
gridpp.quantile_mapping(input, fcst, ref, gridpp.OneToOne)