8
8
Discrete Gaussian Samplers over the Integers
9
9
10
10
This class realizes oracles which returns integers proportionally to
11
- `\e xp( -( x-c) ^ 2/( 2σ ^ 2)) `. All oracles are implemented using rejection sampling.
11
+ `\e xp( -( x-c) ^ 2/( 2 \s igma ^ 2)) `. All oracles are implemented using rejection sampling.
12
12
See :func:`DiscreteGaussianDistributionIntegerSampler. __init__` for which algorithms are
13
13
available.
14
14
@@ -18,7 +18,7 @@ AUTHORS:
18
18
19
19
EXAMPLES:
20
20
21
- We construct a sampler for the distribution `D_{3,c}` with width `σ =3` and center `c=0`::
21
+ We construct a sampler for the distribution `D_{3,c}` with width `\s igma =3` and center `c=0`::
22
22
23
23
sage: from sage. stats. distributions. discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler
24
24
sage: sigma = 3. 0
@@ -169,19 +169,19 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject):
169
169
INPUT:
170
170
171
171
- ``sigma`` -- samples `x` are accepted with probability proportional to
172
- `\e xp( -( x-c) ²/ ( 2σ² )) `
172
+ `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) `
173
173
174
174
- ``c`` -- the mean of the distribution. The value of ``c`` does not have
175
175
to be an integer. However, some algorithms only support integer-valued
176
176
``c`` ( default: ``0``)
177
177
178
- - ``tau`` -- samples outside the range `( ⌊c⌉-⌈στ ⌉,... ,⌊c⌉+ ⌈στ ⌉) ` are
178
+ - ``tau`` -- samples outside the range `( ⌊c⌉-⌈\s igma \t au ⌉,... ,⌊c⌉+ ⌈\s igma \t au ⌉) ` are
179
179
considered to have probability zero. This bound applies to algorithms which
180
180
sample from the uniform distribution ( default: ``6``)
181
181
182
182
- ``algorithm`` -- see list below ( default: ``'uniform+ table'`` for
183
- `σt ` bounded by ``DiscreteGaussianDistributionIntegerSampler. table_cutoff`` and
184
- ``'uniform+ online'`` for bigger `στ `)
183
+ `\s igma \t au ` bounded by ``DiscreteGaussianDistributionIntegerSampler. table_cutoff`` and
184
+ ``'uniform+ online'`` for bigger `\s igma \t au `)
185
185
186
186
- ``precision`` -- either ``'mp'`` for multi-precision where the actual
187
187
precision used is taken from sigma or ``'dp'`` for double precision. In
@@ -191,27 +191,27 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject):
191
191
192
192
- ``'uniform+ table'`` -- classical rejection sampling, sampling from the
193
193
uniform distribution and accepted with probability proportional to
194
- `\e xp( -( x-c) ²/ ( 2σ² )) ` where `\e xp( -( x-c) ²/ ( 2σ² )) ` is precomputed and
194
+ `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` where `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` is precomputed and
195
195
stored in a table. Any real-valued `c` is supported.
196
196
197
197
- ``'uniform+ logtable'`` -- samples are drawn from a uniform distribution and
198
- accepted with probability proportional to `\e xp( -( x-c) ²/ ( 2σ² )) ` where
199
- `\e xp( -( x-c) ²/ ( 2σ² )) ` is computed using logarithmically many calls to
198
+ accepted with probability proportional to `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` where
199
+ `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` is computed using logarithmically many calls to
200
200
Bernoulli distributions. See [DDLL2013 ]_ for details. Only
201
201
integer-valued `c` are supported.
202
202
203
203
- ``'uniform+ online'`` -- samples are drawn from a uniform distribution and
204
- accepted with probability proportional to `\e xp( -( x-c) ²/ ( 2σ² )) ` where
205
- `\e xp( -( x-c) ²/ ( 2σ² )) ` is computed in each invocation. Typically this
204
+ accepted with probability proportional to `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` where
205
+ `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` is computed in each invocation. Typically this
206
206
is very slow. See [DDLL2013 ]_ for details. Any real-valued `c` is
207
207
accepted.
208
208
209
209
- ``'sigma2+ logtable'`` -- samples are drawn from an easily samplable
210
- distribution with `σ = k·σ_2 ` with `σ_2 = \s qrt{1/( 2\l og 2) }` and accepted
211
- with probability proportional to `\e xp( -( x-c) ²/ ( 2σ² )) ` where
212
- `\e xp( -( x-c) ²/ ( 2σ² )) ` is computed using logarithmically many calls to Bernoulli
210
+ distribution with `\s igma = k\c dot \s igma_2 ` with `\s igma_2 = \s qrt{1/( 2\l og 2) }` and accepted
211
+ with probability proportional to `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` where
212
+ `\e xp( -( x-c) ^ 2/ ( 2 \s igma ^ 2 )) ` is computed using logarithmically many calls to Bernoulli
213
213
distributions ( but no calls to `\e xp`) . See [DDLL2013 ]_ for details. Note that this
214
- sampler adjusts `σ ` to match `k·σ_2 ` for some integer `k`.
214
+ sampler adjusts `\s igma ` to match `k\c dot \s igma_2 ` for some integer `k`.
215
215
Only integer-valued `c` are supported.
216
216
217
217
EXAMPLES::
@@ -224,7 +224,7 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject):
224
224
sage: DiscreteGaussianDistributionIntegerSampler( 3. 0, algorithm='uniform+ logtable')
225
225
Discrete Gaussian sampler over the Integers with sigma = 3. 000000 and c = 0. 000000
226
226
227
- Note that ``'sigma2+ logtable'`` adjusts `σ `::
227
+ Note that ``'sigma2+ logtable'`` adjusts `\s igma `::
228
228
229
229
sage: DiscreteGaussianDistributionIntegerSampler( 3. 0, algorithm='sigma2+ logtable')
230
230
Discrete Gaussian sampler over the Integers with sigma = 3. 397287 and c = 0. 000000
0 commit comments