freealg.distributions.Wigner.sample#
- Wigner.sample(size, x_min=None, x_max=None, method='qmc', seed=None, plot=False, latex=False, save=False)#
Sample from distribution.
- Parameters:
- sizeint
Size of sample.
- x_minfloat, default=None
Minimum of sample values. If None, the left edge of the support is used.
- x_maxfloat, default=None
Maximum of sample values. If None, the right edge of the support is used.
- method{
'mc'
,'qmc'
}, default='qmc'
Method of drawing samples from uniform distribution:
'mc'
: Monte Carlo'qmc'
: Quasi Monte Carlo
- plotbool, default=False
If True, samples histogram is plotted.
- latexbool, default=False
If True, the plot is rendered using LaTeX. This option is relevant only if
plot=True
.- savebool, default=False
If not False, the plot is saved. If a string is given, it is assumed to the save filename (with the file extension). This option is relevant only if
plot=True
.
- Returns:
- snumpy.ndarray
Samples.
Notes
This method uses inverse transform sampling.
Examples