# \#sampling

**URL:** https://discourse.julialang.org/tag/sampling/1601.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [\[Pre-ANN\] ARS.jl](https://discourse.julialang.org/t/pre-ann-ars-jl/131766)

<div class="topic-metadata">

**Author:** [@Eliassj](https://discourse.julialang.org/u/Eliassj)\
**Replies:** 4\
**Last updated:** [August 22, 2025, 10:31am UTC](https://discourse.julialang.org/t/pre-ann-ars-jl/131766 "2025-08-22T10:31:08Z")

</div>

Repo: GitHub - Eliassj/ARS.jl Docs: eliassj.github.io/ARS.jl/dev/ While working on another project I found that AdaptiveRejectionSampling.jl, while very good in other ways, did not allow for other numeric types than Fl…

---

## [\[ANN\] StreamSampling.jl - Sampling methods for data streams](https://discourse.julialang.org/t/ann-streamsampling-jl-sampling-methods-for-data-streams/108779)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 9\
**Last updated:** [August 15, 2025, 1:26pm UTC](https://discourse.julialang.org/t/ann-streamsampling-jl-sampling-methods-for-data-streams/108779 "2025-08-15T13:26:20Z")

</div>

Hi all! I’m happy to announce the new package IteratorSampling.jl, which can help to sample from arbitrary iterables in a single pass through the data. It is mainly based on the theory of reservoir sampling methods. Si…

---

## [Nyquist-Shannon sampling theorem question](https://discourse.julialang.org/t/nyquist-shannon-sampling-theorem-question/129892)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 7\
**Last updated:** [June 18, 2025, 9:07am UTC](https://discourse.julialang.org/t/nyquist-shannon-sampling-theorem-question/129892 "2025-06-18T09:07:37Z")

</div>

Hi, I always thought that sampling at Fs \>= 2Fmax is the thing to do when sampling a signal. But I came across a school document that says if Fmin is also given, the sampling rate should be Fs \>= 2(Fmax - Fmin). It pu…

---

## [Library hunt: adaptive sampling for parametric plots](https://discourse.julialang.org/t/library-hunt-adaptive-sampling-for-parametric-plots/128448)

<div class="topic-metadata">

**Author:** [@srs](https://discourse.julialang.org/u/srs)\
**Replies:** 9\
**Last updated:** [June 3, 2025, 11:36am UTC](https://discourse.julialang.org/t/library-hunt-adaptive-sampling-for-parametric-plots/128448 "2025-06-03T11:36:46Z")

</div>

Hey all, I’m looking for a library that can adaptively sample parametric plots (for reasonably well-behaved functions). I’m on the verge of writing a little library here but it seems like so many people would want this t…

---

## [Draw a random number through a probability distribution defined as an array](https://discourse.julialang.org/t/draw-a-random-number-through-a-probability-distribution-defined-as-an-array/129210)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 5\
**Last updated:** [May 21, 2025, 10:40am UTC](https://discourse.julialang.org/t/draw-a-random-number-through-a-probability-distribution-defined-as-an-array/129210 "2025-05-21T10:40:30Z")

</div>

If I have an NxM matrix with decimal values (normalised so that the sum is 1): prob\_dens::Matrix{Float64.Float64} is there a good way to randomly draw an index i,j with probability corresponding to the probability dist…

---

## [How to sample many ordered iid variables in turing](https://discourse.julialang.org/t/how-to-sample-many-ordered-iid-variables-in-turing/127205)

<div class="topic-metadata">

**Author:** [@swsw](https://discourse.julialang.org/u/swsw)\
**Replies:** 2\
**Last updated:** [March 24, 2025, 2:34pm UTC](https://discourse.julialang.org/t/how-to-sample-many-ordered-iid-variables-in-turing/127205 "2025-03-24T14:34:56Z")

</div>

Hi there, I’d like to sample many ordered iid varialbles but i find when the number of samples is large the efficiency gets very low. For the subsequent code it works when the number of variables is 30 or so but not whe…

---

## [\[ANN\] DynamicSampling.jl](https://discourse.julialang.org/t/ann-dynamicsampling-jl/123718)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 5\
**Last updated:** [December 12, 2024, 9:37pm UTC](https://discourse.julialang.org/t/ann-dynamicsampling-jl/123718 "2024-12-12T21:37:44Z")

</div>

Hi all, I’d like to share with you DynamicSampling.jl, a package I built which implements samplers that can be used to sample from a dynamic discrete distribution supporting removal, addition and sampling of elements in…

---

## [Fill SVector with uniformly sampled Float32 values](https://discourse.julialang.org/t/fill-svector-with-uniformly-sampled-float32-values/119386)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 5\
**Last updated:** [September 14, 2024, 6:57am UTC](https://discourse.julialang.org/t/fill-svector-with-uniformly-sampled-float32-values/119386 "2024-09-14T06:57:33Z")

</div>

There are quite a few topics on this, eg: Performance of generating uniform Float32 numbers Given the current default behavior hasn’t been fixed, I tried a few things. As a baseline, these all return Float64: Edit: Ba…

---

## [Allocation-free weighted samples](https://discourse.julialang.org/t/allocation-free-weighted-samples/119265)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 12\
**Last updated:** [September 12, 2024, 1:50pm UTC](https://discourse.julialang.org/t/allocation-free-weighted-samples/119265 "2024-09-12T13:50:12Z")

</div>

Given an SVector of weights, is there a way to take a single weighted sample without any allocations? Ie, these work great but require an allocation: x = \[1\] wts = @SVector rand(16) @btime wsample(1:16, $wts) @btime wsa…

---

## [Warmup, samples and discard\_adapt](https://discourse.julialang.org/t/warmup-samples-and-discard-adapt/118412)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [August 20, 2024, 10:42am UTC](https://discourse.julialang.org/t/warmup-samples-and-discard-adapt/118412 "2024-08-20T10:42:55Z")

</div>

Hello everyone, I want to know simple explanation of difference between warm up and samples and what happens when we do discard\_adapt = false. Below you can see plots for two different conditions with and without disca…

---

## [SIMD: Need some help to speed up sampling a code vector](https://discourse.julialang.org/t/simd-need-some-help-to-speed-up-sampling-a-code-vector/117075)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 28\
**Last updated:** [July 16, 2024, 9:44pm UTC](https://discourse.julialang.org/t/simd-need-some-help-to-speed-up-sampling-a-code-vector/117075 "2024-07-16T21:44:15Z")

</div>

This is part of my work to implement a GNSS receiver in real time (see GNSSReceiver.jl). One crucial part is the code generation that functions as a matched filter. The code is binary and can be modeled as code = Int3…

---

## [Random sampling with rand(Uniform(0,1), n)](https://discourse.julialang.org/t/random-sampling-with-rand-uniform-0-1-n/114962)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 4\
**Last updated:** [May 30, 2024, 12:07pm UTC](https://discourse.julialang.org/t/random-sampling-with-rand-uniform-0-1-n/114962 "2024-05-30T12:07:07Z")

</div>

Hello everyone, I’m trying to collect some random samples from Uniform distribution Uniform(0,1) . What I observe is that most of values are around 10^-1 range so like 0.1, 0.3, 0.7 something like that but it rarely hi…
