In-place resampling
UncertainData.Resampling.resample! — Functionresample!(v::AbstractArray{T, 1}, x::AbstractUncertainValue)
resample!(v::MVector{N, T}, x::AbstractUncertainValue) where {N, T}
resample!(v::FieldVector{N, T}, x::AbstractUncertainValue) where {N, T}
resample!(v::MVector{N, T}, x::Vararg{AbstractUncertainValue, N}) where {N, T}
resample!(v::FieldVector{N, T}, x::Vararg{AbstractUncertainValue, N}) where {N, T}
resample!(v::AbstractArray{T, 1}, x::UVAL_COLLECTION_TYPES) where T
resample!(v::AbstractArray{T, 2}, x::UVAL_COLLECTION_TYPES) where T
resample!(idxs::AbstractArray{T, 1}, vals::AbstractArray{T, 1},
x::AbstractUncertainIndexValueDataset) where T
resample!(idxs::AbstractArray{T, 2}, vals::AbstractArray{T, 2},
x::AbstractUncertainIndexValueDataset) where TResample a uncertain value x, or a collection of uncertain values x, into a pre-allocated container v.
Uncertain values
- If
xis a single uncertain value, andvis vector-like, then fillvwithNdraws ofx. Works with vectors of lengthN,MVector{N, T}s orFieldVector{N, T}s.
Uncertain collections
Uncertain collections may be a Vector{AbstractUncertainValue} of length N, an AbstractUncertainValueDataset, or an NTuple{N, AbstractUncertainValue}. See also UVAL_COLLECTION_TYPES.
- If
xis a collection of uncertain values andvis vector-like, then fillv[i]with a draw ofx[i]fori = 1:N. - If
xis a collection of uncertain values andvis a 2D-array, then fill thei-th column ofvwithlength(x)draws of thei-th uncertain value inx.
Uncertain index-value collections
- If two mutable vector-like containers,
idxsandvals, are provided along with an uncertain index-value datasetx, then fillidxs[i]with a random draw fromx.indices[i]and fillvals[i]with a random draw fromx.values[i]. - If two mutable matrix-like containers,
idxsandvalsare provided along with an uncertain index-value datasetx(where the number of columns in bothidxsandvalsmatcheslength(x)), then fill thei-th column ofidxswithsize(idxs, 1)draws fromx.indices[i], and fill thei-th column ofvalswithsize(idxs, 1)draws fromx.values[i].