diff --git a/src/utils.jl b/src/utils.jl index d1657e4..a834476 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -24,18 +24,15 @@ end """ - scale_sobol_seq!(sequence::AbstractArray{<:Number, N}, dists::AbstractArray{Distribution, N}) + scale_sobol_seq!(sequence::AbstractArray{<:Number, N}, dists::AbstractArray{T, N}) Rescale a Sobol `sequence` of parameters from the 0-to-1 range to their corresponding univeariate distributions `dists`. """ -function scale_sobol_seq!(sequence::AbstractArray{<:Number, N1}, dists::AbstractArray{<:Distribution, N2}) where N1 where N2 +function scale_sobol_seq!(sequence::AbstractArray{<:Number, N1}, dists::AbstractArray{T, N2}) where T where N1 where N2 D = length(dists) # number of parameters for param in 1:D dist = dists[param] - if !(typeof(dist) <: UnivariateDistribution) - error("Distribution must be a subtype of UnivariateDistribution") - end sequence[:, [param, param + D]] = quantile.(dist, sequence[:, [param, param + D]]) end end