Skip to content
1

Internal Documentation

Documentation for ForecastEnsembles's internal interface.

Contents

Index

Internal API

ForecastEnsembles.QuantileDistribution Type
julia
QuantileDistribution(probs, vals)

A 1-D distribution reconstructed from the (probability, value) quantile pairs probs and vals. probs must be strictly increasing in (0,1); vals must be non-decreasing and the same length.

source
Distributions.cdf Method
julia
cdf(d::QuantileDistribution, x)

Return P(X ≤ x).

source
ForecastEnsembles.from_samples Function
julia
from_samples(df; task_id_cols = nothing,
              model_col = :model, sample_col = :sample, value_col = :predicted)
-> ForecastTable

Convert a sample-shaped frame (one row per draw) to a ForecastTable with output_type = :sample. Mirrors the input expected by lopensemble::mixture_from_samples.

source
ForecastEnsembles.from_scoringutils Function
julia
from_scoringutils(df; task_id_cols = nothing) -> ForecastTable

Convert a scoringutils::forecast_quantile-shaped frame (columns model, quantile_level, predicted, plus task vars) to a ForecastTable with output_type = :quantile.

source
Statistics.quantile Method
julia
quantile(d::QuantileDistribution, u)

Return the value of d at probability u ∈ (0,1).

source
Base.rand Function
julia
rand([rng::AbstractRNG,] s::Sampleable)

Generate one sample for s.

julia
rand([rng::AbstractRNG,] s::Sampleable, n::Int)

Generate n samples from s. The form of the returned object depends on the variate form of s:

  • When s is univariate, it returns a vector of length n.

  • When s is multivariate, it returns a matrix with n columns.

  • When s is matrix-variate, it returns an array, where each element is a sample matrix. rand([rng::AbstractRNG,] s::Sampleable, dim1::Int, dim2::Int...) rand([rng::AbstractRNG,] s::Sampleable, dims::Dims)

Generate an array of samples from s whose shape is determined by the given dimensions.

source
julia
rand(rng::AbstractRNG, d::UnivariateDistribution)

Generate a scalar sample from d. The general fallback is quantile(d, rand()).

source
julia
rand(::AbstractRNG, ::Distributions.AbstractMvNormal)

Sample a random vector from the provided multi-variate normal distribution.

source
julia
rand(::AbstractRNG, ::Sampleable)

Samples from the sampler and returns the result.

source
julia
rand(d::Union{UnivariateMixture, MultivariateMixture})

Draw a sample from the mixture model d.

julia
rand(d::Union{UnivariateMixture, MultivariateMixture}, n)

Draw n samples from d.

source
julia
rand(rng, d::QuantileDistribution, n)

Draw n samples from d by inverse-CDF sampling.

source