You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Excellent idea. . I’ve got a 1.2/2.0 branch in preparation.
But one must then ask: what distribution! There is no finite interval to
select uniformly for naturals or integers. We could have it just be the
same range as a 64bit word or 128 bit word would be ... but that seems
unsatisfactory.
@ndmitchell using maxBound :: Int sounds extremely wrong. I would expect something with more of a Gaussian-style shape with a fairly large standard deviation for Integer, and probably half of that for Natural.
@treeowl perhaps, all I'm saying is they should be consistent. I would like the random Integer to never overflow all my memory though, so it needs a limit of some kind.
Ah, I suppose it does, for such practical reasons. But maxBound :: Int seems way too small. If the standard deviation is something like maxInt ^ n for some small n (to pick something pretty arbitrary), then you could cut off at some sensible multiple of that without losing much. What I really don't know is whether there is a good principled choice of distribution.
My current plan is to have the default natural interval be word 64.
Defaults are well, defaults. And for infinite structures there’s no good
answer for computations that finish in finite time. Hence markov chains and
approximations algorithms
The main bottle neck at the moment is figuring out how to make some needed
systematic changes while making sure the breakages are all tolerable and
happen just once.
On Mon, Feb 18, 2019 at 2:14 AM David Feuer ***@***.***> wrote:
Ah, I suppose it does, for such practical reasons. But maxBound :: Int
seems way too small. If the standard deviation is something like maxInt ^
n for some small n (to pick something pretty arbitrary), then you could
cut off at some sensible multiple of that without losing much. What I
really don't know is whether there *is* a good principled choice of
distribution.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#44 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAQwsKkKLzdpqsErvf_zs3v5p_AOfr7ks5vOlLPgaJpZM4P82t8>
.
More color :
The current random instance / type class only supports / makes sense for
uniform distributions on finite width intervals that have a finite number
of points contained in those intervals. Anything else can’t Be an
instance.
On Mon, Feb 18, 2019 at 12:28 PM Carter Schonwald <
[email protected]> wrote:
My current plan is to have the default natural interval be word 64.
Defaults are well, defaults. And for infinite structures there’s no good
answer for computations that finish in finite time. Hence markov chains and
approximations algorithms
The main bottle neck at the moment is figuring out how to make some needed
systematic changes while making sure the breakages are all tolerable and
happen just once.
On Mon, Feb 18, 2019 at 2:14 AM David Feuer ***@***.***>
wrote:
> Ah, I suppose it does, for such practical reasons. But maxBound :: Int
> seems way too small. If the standard deviation is something like maxInt
> ^ n for some small n (to pick something pretty arbitrary), then you
> could cut off at some sensible multiple of that without losing much. What I
> really don't know is whether there *is* a good principled choice of
> distribution.
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#44 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAAQwsKkKLzdpqsErvf_zs3v5p_AOfr7ks5vOlLPgaJpZM4P82t8>
> .
>
There is a new instance UniformRange Natural. I don't know if adding instance Random Natural is a good idea. The broken instance for Integer is already there, so we'll keep it for backwards compatibility, but adding new broken instances doesn't feel right. In any case Natural can now be generated with uniformR and uniformRM
Activity
cartazio commentedon Oct 17, 2017
ndmitchell commentedon Oct 17, 2017
If you don't do what you do for
Integerit would be massively confusing. And forIntegeryou usemaxBound :: Int- which seems at least consistent.treeowl commentedon Feb 18, 2019
@ndmitchell using
maxBound :: Intsounds extremely wrong. I would expect something with more of a Gaussian-style shape with a fairly large standard deviation forInteger, and probably half of that forNatural.ndmitchell commentedon Feb 18, 2019
@treeowl perhaps, all I'm saying is they should be consistent. I would like the random Integer to never overflow all my memory though, so it needs a limit of some kind.
treeowl commentedon Feb 18, 2019
Ah, I suppose it does, for such practical reasons. But
maxBound :: Intseems way too small. If the standard deviation is something likemaxInt ^ nfor some smalln(to pick something pretty arbitrary), then you could cut off at some sensible multiple of that without losing much. What I really don't know is whether there is a good principled choice of distribution.cartazio commentedon Feb 18, 2019
cartazio commentedon Feb 19, 2019
parent cfdfe6f
parent cfdfe6f
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
lehins commentedon Jun 23, 2020
There is a new
instance UniformRange Natural. I don't know if addinginstance Random Naturalis a good idea. The broken instance forIntegeris already there, so we'll keep it for backwards compatibility, but adding new broken instances doesn't feel right. In any caseNaturalcan now be generated withuniformRanduniformRM