Questions tagged [sampling]

The tag has no usage guidance.

11 questions
Filter by
Sorted by
Tagged with
68 views

Sampling an inequality over multi-dimensional space

Let's say I have two functions $f(x,y,z), g(x,y,z)$. I would like to know the probability that $f(x,y,z) < g(x,y,z)$ over some defined, numerical ranges of $x, y, z$. Any thoughts on how to do it ...
165 views

Plot, sampling, and why it does not display for some ranges

The following gives an empty plot on V12 under Windows 10: ...
246 views

Why does plot not show where Piecewise function is not zero?

From my user point view this looks like bug. But I am not an expert. f[x_?NumericQ]:=Piecewise[{{1,x==1},{0,True}}]; Plot[f[x],{x,0,1}] Does not show ...
82 views

Random sampling of a discrete distribution in NetGraph

Within a NetGraph I would like to use the output of a softmax layer, interpreted as a probability distribution, to sample a "next token". Since this is done inside an RNN structure, I cannot do this ...
82 views

Multiple unique random samples?

I'm trying to produce $n$ random samples from a list, but not all samples, and I'd like the samples to not repeat in the same execution of the command. If I'm not mistaken, something like ...
153 views

How to generate a matrix with certain conditions

I want to generate a $n \times n$ matrix. I want the diagonal entries to be all 0 I want a random choice of matrix elements with 0 or 1. The probability of having a 1 as a matrix element is $1/m$ and ...
53 views

How do I extract data points from an audio plot at a constant spaced time interval?

AudioPlot[Audio[File["Downloads/1_mp3.wav"]]] data = Cases[AudioPlot[Audio[File["Downloads/1_mp3.wav"]]], Line[x_] :> x, Infinity] This code can extract data ...
41 views

ProbabilityDistribution fails for square root

I would like to sampling data from a distribution Sqrt[x^2 + y^2]. I used the code as follows: ...
71 views

Speeding up Module

I am working on the Ising 2D model in Mathematica and this is currently my Metropolis sampling function: ...