Index
Abstract Quantile Matching model
Types
QuantileMatching.AbstractQuantileMatchingModel — TypeAbstractQuantileMatchingModelAbstract type containing the concrete types EmpiricalQuantileMatchingModel and ParametricQuantileMatchingModel.
QuantileMatching.EmpiricalQuantileMatchingModel — TypeEmpiricalQuantileMatchingModel{T}Structure containing the different distributions for performing empirical quantile matching.
Details
targetsample: target sample (local-scale sample for the calibration period)actualsample: actual sample (large-scale sample for the calibration period)projsample: projected sample (large-scale sample for the projected period)nbins: number of bins used to compute the transfert functionextrapolation: extrapolation method when large-scale values lies outside the range of the local-scale values.
It should be an Interpolations.BoundaryCondition type like for example Interpolations.Flat() and Interpolations.Line().
If extrapolation = Interpolations.Flat(), there is no extrapolation of the local-scale quantile. The post-processed value is either the minimum or the maximum of the local-scale values.
If extrapolation = Interpolations.Line(), post-processed quantiles beyond the range of the local-scale values are extrapolated using a linear model.
If the projsample is not provided, the quantile matching model is assumed to be stationary and the actual distribution is post-processed.
See also ParametricQuantileMatchingModel
QuantileMatching.ParametricQuantileMatchingModel — TypeParametricQuantileMatchingModel{T}Structure containing the different distributions for performing parametric quantile matching.
Details
targetdist: target distribution (local-scale distribution for the calibration period)actualdist: actual distribution (large-scale distribution for the calibration period)projdist: projected distribution (large-scale distribution for the projected period)
If the projdist is not provided, the quantile matching model is assumed to be stationary and the actual distribution is post-processed.
See also EmpiricalQuantileMatchingModel
Methods
Base.match — Functionmatch(qmm::AbstractQuantileMappingModel, x::Vector{<:Real})Match the values in x according to the model qmm.
Details
The function uses the cdf-t method proposed by Michelangeli et al. (2009).
This is a type-stable function. This is why it takes a vector as argument and returns a vector. For matching a scalar value x, wrap it in the vector [x].
Reference
Michelangeli, P.-A., Vrac, M., and Loukos, H. (2009), Probabilistic downscaling approaches: Application to wind cumulative distribution functions, Geophys. Res. Lett., 36, L11708, doi:10.1029/2009GL038401.
Base.match — Methodmatch(pqm::ParametricQuantileMatchingModel{Stationary}, x::Real)Parametric quantile matching of the actual value x according to the parametric quantile matching model pqm.
Note
If x is outside the support of the actual distribution and the target distribution is unbounded, the function returns an infinite value.
QuantileMatching.projcdf — Methodprojcdf(nspqm::ParametricQuantileMatchingModel, x::Real)Compute the post-processed cdf of the projections using the cdf-t approach.
See also projquantile.
QuantileMatching.projquantile — Methodfunction projquantile(nspqm::ParametricQuantileMatchingModel, p::Real)Compute the quantile function corresponding to the projection cdf.
See also projcdf.
Functions
QuantileMatching.censor — Methodcensor(y::Vector{<:Real}, u::Real ; fillvalue::Real=0)Return the vector for which the value below u are filled with fillvalue and where u is substracted from the remaining values.
See also pwet and wet_threshold.
QuantileMatching.ecdf — Methodecdf(y::Vector{<:Real})::Tuple{Vector{<:Real}, Vector{<:Real}}Compute the empirical cumulative distribution function using the Gumbel formula.
Details
The empirical quantiles are computed using the Gumbel plotting positions as as recommended by Makkonen (2006).
Example
julia> (x, F̂) = Extremes.ecdf(y)Reference
Makkonen, L. (2006). Plotting positions in extreme value analysis. Journal of Applied Meteorology and Climatology, 45(2), 334-340.
QuantileMatching.eqm — Methodeqm(y::Vector{<:Real}, x::Vector{<:Real})Return the corrected values of the actual sample x relative to the target sample y by empirical quantile matching.
Details
The quantile matching is done in two steps. The first step is to adjust the proportion of wet days and the second step is to correct for non-zero values.
QuantileMatching.pqm — Methodpqm(pd::Type{<:ContinuousUnivariateDistribution}, y::AbstractVector{<:Real}, x::AbstractVector{<:Real})Return the corrected values of the actual sample x relative to the target sample y by parametric quantile matching specified by pd.
Details
The quantile matching is done in two steps. The first step is to adjust the proportion of wet days and the second step is to correct for non-zero values using the specified distribution.
QuantileMatching.pwet — Functionpwet(y::Vector{<:Real}, threshold::Real=0.)Compute the proportion of values of y greater than threshold.
See also censor and wet_threshold.
QuantileMatching.wet_mean — Functionwet_mean(y::Vector{<:Real}, threshold::Real=zero(eltype(y)))Compute the mean of the elements of y exceeding the threshold threshold.
See also wet_quantile and wet_sum.
QuantileMatching.wet_quantile — Functionwet_quantile(y::Vector{<:Real}, p::Real; threshold::Real=zero(eltype(y)))Compute the empirical quantile of order p of the values y exceeding the threshold threshold.
QuantileMatching.wet_sum — Functionwet_sum(y::Vector{<:Real}, threshold::Real=zero(eltype(y)))Compute the sum of the elements of y exceeding the threshold threshold.
See also wet_mean and wet_quantile.
QuantileMatching.wet_threshold — Methodwet_threshold(y::AbstractVector{<:Real}, p::Real)Find the threshold for which the proportion of y values above this threshold is p.