【问题标题】:How to create samples using sampling technique from existing arrays?如何使用现有阵列的采样技术创建样本?
【发布时间】:2021-04-25 17:32:38
【问题描述】:

我有两个数组如下图,

x = collect(range(1, 10, length=10))
y = colelct(range(1, 10, length=10))

我想知道如何使用他们的算法将它们转换为SobolUniform 样本。

谢谢,期待建议!

【问题讨论】:

  • 请澄清“将数组转换为 Sobol 或统一样本”是什么意思
  • 对于 Sobol 采样,请查看 Sobol.jl 包。

标签: julia sample sampling


【解决方案1】:

您是否尝试从1:10 中(统一地)采样值?如果是这样,您可以将集合传递给rand

julia> rand(1:10, 5)
5-element Vector{Int64}:
 10
  5
  5
  8
  8

对于您在上面给出的x,那就是

julia> x = collect(range(1, 10, length=10)) ;

julia> rand(x, 5)
5-element Vector{Float64}:
 2.0
 4.0
 6.0
 7.0
 3.0

我不确定 Sobol 采样。

【讨论】:

    猜你喜欢
    • 2015-02-08
    • 1970-01-01
    • 2019-12-13
    • 1970-01-01
    • 2020-02-15
    • 1970-01-01
    • 1970-01-01
    • 2020-03-12
    • 1970-01-01
    相关资源
    最近更新 更多