Mathematics Proposal - Invitation to edit

26 views
Skip to first unread message

Richard Dosselmann (via Google Docs)

unread,
Apr 12, 2019, 12:10:13 AM4/12/19
to sg...@isocpp.org
doss...@cs.uregina.ca has invited you to edit the following document:
Google Docs: Create and edit documents online.
Google LLC, 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA
You have received this email because someone shared a document with you from Google Docs.
Logo for Google Docs

Eugenio Bargiacchi

unread,
Apr 15, 2019, 7:36:26 AM4/15/19
to Richard Dosselmann, sg...@isocpp.org
Thank you Richard for starting up this document.

I have a couple of comments regarding the distributions, which I'm
writing here as I feel putting them in the document directly would
have cluttered it.

First, I think we could push for more than just mean and standard
deviation. As the math behind the distributions we already have is
quite known, I feel it should be relatively easy to add pdf, cdf,
mode, variance, entropy, etc etc (basically all stats which can be
straightforwardly found in the Wikipedia entries about the
distributions). Does this make sense, or we want to start small just
in case?

Secondly, not all these quantities are necessarily defined for all the
distributions. For example, the Cauchy distribution has an undefined
mean. We need to decide what to do about these; should the undefined
functions just be missing?

Thirdly, I think we ought to make it possible to construct these
distributions in a constexpr manner, so that code that is based on
distributions which are known in advance does not have to compute them
at runtime. If I remember correctly, the reason why distributions are
not constexpr by default is that some of them store state in order to
be sampled from (for example std::normal_distribution). This makes
sense, but at the same time I think it would be nice to have a
mechanism to construct the distributions in a constexpr fashion if one
is only interested in the statistics functions rather than sampling.
I'm not sure whether this can be done, but I think we should try to
make this possible. Boost defines new constexpr classes which only
contain the stats; the problem that I have with that is that there is
no link between the "sampling" distributions (non constexpr) and the
"math" distributions (constexpr only), which I strongly dislike, as
for example it prevents obtaining statistics from a sampling class
constructed at runtime.

I can edit the document about these things, but I wanted to know your
opinions before just writing.

Best,
Eugenio

On 4/12/19, Richard Dosselmann (via Google Docs) <doss...@cs.uregina.ca> wrote:
> I've shared an item with you:
>
> Mathematics Proposal
> https://docs.google.com/document/d/1VAgcyvL1riMdGz7tQIT9eTtSSfV3CoCEMWKk8GvVuFY/edit?usp=sharing&ts=5cb00fa4
>
> It's not an attachment -- it's stored online. To open this item, just click
>
> the link above.
>
> --
> You received this message because you are subscribed to the Google Groups
> "SG19 - Machine Learning" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sg19+uns...@isocpp.org.
> To post to this group, send email to sg...@isocpp.org.
> Visit this group at https://groups.google.com/a/isocpp.org/group/sg19/.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/sg19/000000000000b7617d05864d7a88%40google.com.
>

Sebastian Messmer

unread,
Apr 15, 2019, 6:36:36 PM4/15/19
to Eugenio Bargiacchi, Richard Dosselmann, sg...@isocpp.org
On 4/15/19, 4:36 AM, "Eugenio Bargiacchi" <sval...@gmail.com> wrote:

First, I think we could push for more than just mean and standard
deviation. As the math behind the distributions we already have is
quite known, I feel it should be relatively easy to add pdf, cdf,
mode, variance, entropy, etc etc (basically all stats which can be
straightforwardly found in the Wikipedia entries about the
distributions). Does this make sense, or we want to start small just
in case?

While I'm generally in favor of adding these as well, I think the chance of getting it into the standard might be higher if it's fewer functions. We can always make it two papers. I'll defer to Michael Wong's opinion here, he has much more experience with the committee.

Secondly, not all these quantities are necessarily defined for all the
distributions. For example, the Cauchy distribution has an undefined
mean. We need to decide what to do about these; should the undefined
functions just be missing?

Usually, I'd say they should not exist if they're not defined. But I'm not sure how this would work together with a potential Distribution concept? Are there plans for such a concept and does it make sense? If yes, will the concept require a mean method to be present?

Thirdly, I think we ought to make it possible to construct these
distributions in a constexpr manner, so that code that is based on
distributions which are known in advance does not have to compute them
at runtime. If I remember correctly, the reason why distributions are
not constexpr by default is that some of them store state in order to
be sampled from (for example std::normal_distribution). This makes
sense, but at the same time I think it would be nice to have a
mechanism to construct the distributions in a constexpr fashion if one
is only interested in the statistics functions rather than sampling.
I'm not sure whether this can be done, but I think we should try to
make this possible. Boost defines new constexpr classes which only
contain the stats; the problem that I have with that is that there is
no link between the "sampling" distributions (non constexpr) and the
"math" distributions (constexpr only), which I strongly dislike, as
for example it prevents obtaining statistics from a sampling class
constructed at runtime.

Fully agree on making these constexpr if we can. Keeping state shouldn't be an issue for constexpr in C++17.

Best
Sebastian


On 4/12/19, Richard Dosselmann (via Google Docs) <doss...@cs.uregina.ca> wrote:
> I've shared an item with you:
>
> Mathematics Proposal
> https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_document_d_1VAgcyvL1riMdGz7tQIT9eTtSSfV3CoCEMWKk8GvVuFY_edit-3Fusp-3Dsharing-26ts-3D5cb00fa4&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=JjgYvsu9MrGGUueQx61-XQ&m=Se63z-A19l8_3tD6eSn10nXoP3n1ld47QbY0CGez-lg&s=1h2fIoJxAWiA2ie4n0QszjvI5zGxMjHwVPmBmKUzI4I&e=
>
> It's not an attachment -- it's stored online. To open this item, just click
>
> the link above.
>
> --
> You received this message because you are subscribed to the Google Groups
> "SG19 - Machine Learning" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sg19+uns...@isocpp.org.
> To post to this group, send email to sg...@isocpp.org.
> Visit this group at https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_a_isocpp.org_group_sg19_&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=JjgYvsu9MrGGUueQx61-XQ&m=Se63z-A19l8_3tD6eSn10nXoP3n1ld47QbY0CGez-lg&s=Jyxlwja_FIZVORA0oNd0Qc1l7-JzajwRkHjD24TFVR8&e=.
> To view this discussion on the web visit
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_a_isocpp.org_d_msgid_sg19_000000000000b7617d05864d7a88-2540google.com&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=JjgYvsu9MrGGUueQx61-XQ&m=Se63z-A19l8_3tD6eSn10nXoP3n1ld47QbY0CGez-lg&s=69MGQfntM2bC7hGsjGl40POtcH0BrL2l_z5S1Kf2cc4&e=.
>

--
You received this message because you are subscribed to the Google Groups "SG19 - Machine Learning" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sg19+uns...@isocpp.org.
To post to this group, send email to sg...@isocpp.org.
Visit this group at https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_a_isocpp.org_group_sg19_&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=JjgYvsu9MrGGUueQx61-XQ&m=Se63z-A19l8_3tD6eSn10nXoP3n1ld47QbY0CGez-lg&s=Jyxlwja_FIZVORA0oNd0Qc1l7-JzajwRkHjD24TFVR8&e=.
To view this discussion on the web visit https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_a_isocpp.org_d_msgid_sg19_CAHfn-253D-252Bskinm5ZVEHSkOBOfmQvBv47-2DbKmYVRk9avshqasoa-252Biw-2540mail.gmail.com&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=JjgYvsu9MrGGUueQx61-XQ&m=Se63z-A19l8_3tD6eSn10nXoP3n1ld47QbY0CGez-lg&s=R6xP9fwRn8h20BChdUGbqsHoQPs5XSxzZqCSCeJughk&e=.


Reply all
Reply to author
Forward
0 new messages