Utilities
A place to store useful functions that didn't fit elsewhere
PostForecasts.getmodel — Function
getmodel([::Type{<:AbstractFloat}=Float64,] ::Val, params...)Helper function that dispatches the model based on the model name passed as Val.
Available methods
getmodel([type,] Val(:qra), n, m, prob)for Quantile Regression Averaginggetmodel([type,] Val(:cp), n)for Conformal Predictiongetmodel([type,] Val(:hs), n)for Conformal Prediction Prediction with non-symmetric errors (a.k.a. Historical Simulation)getmodel([type,] Val(:idr), n, m)for Isotonic Distributional Regressiongetmodel([type,] Val(:normal))for Normal distribution of errorsgetmodel([type,] Val(:zeronormal))for Normal distribution of errors with fixed mean equal to 0
where n is the length of the training window, m is the number of regressors and prob is the probability (scalar value or vector).
Return an appropriate PostModel.
PostForecasts.nreg — Function
nreg(m::PostModel)Return the number of regressors of model m.
PostForecasts.matchwindow — Function
matchwindow(m::PostModel, window::Integer)Return true if window matches the specification of model m, otherwise return false.
PostForecasts.checkmatch — Function
checkmatch(fs::AbstractVector{T}; checkpred::Bool=false) where T<:Union{PointForecasts, QuantForecasts}Check if Forecasts in fs correspond to the same timeseries, i.e.:
- all their
identifiers match - all their
observations match.
Additionally, provided that checkpred=true, check if:
- their number of forecasts match
- their
probabilities match.
The function checkmatch can also be called by passing PointForecasts or QuantForecasts objects as consecutive arguments, e.g. checkmatch(f1, f2, f3) is equivalent to checkmatch([f1, f2, f3]).
Return true or throw an ArgumentError if any of the requirements above is not met.