-
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.
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)
278.75