Opened 8 years ago
Last modified 5 years ago
#11572 new enhancement
Add new continuous probability distributions
Reported by: | Kamhamea | Owned by: | amhou |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | statistics | Keywords: | |
Cc: | Merged in: | ||
Authors: | Mato Nagel | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
There are many continuous probability distributions available on GSL that have not yet been wrapped into Sage. This ticket is for doing this.
Attachments (2)
Change History (12)
Changed 8 years ago by
comment:1 Changed 8 years ago by
- Description modified (diff)
comment:2 follow-up: ↓ 3 Changed 8 years ago by
- Component changed from PLEASE CHANGE to statistics
- Owner changed from tbd to amhou
- Type changed from PLEASE CHANGE to enhancement
One minor, but important, comment - you seem to have subsumed the patch at #9080 in this patch. You should instead apply that patch to your Sage, and then create your new patch on top of that one. That not only makes it easy on the release manager, but also allows the author of the patch at #9080 his due credit :)
A very minor comment - you should set up your HG defaults so that instead of # User mato.nagel@gmx.net
it gives something like Mato Nagel <mato.nagel@gmx.net>
, or something similar. There should be something about this in the developer guide.
Also, a point of information related to your email to sage-devel; although you add tests for the new distributions, that wouldn't remove the need for #11514. It would be a good step in that direction, though!
More substantively, I think (my opinion only) that based on the discussion about this on sage-devel, the binomial and other "discrete" distributions should somehow be separated, if only for user convenience. It sounded from your email like this wasn't the final patch anyway, so it's not a big deal yet, but just recording this here for completeness.
Thanks for taking a stab at this! It's certainly sorely needed - as you say, GSL has lots of things for us. (So does Scipy, for that matter.)
comment:3 in reply to: ↑ 2 ; follow-up: ↓ 5 Changed 8 years ago by
you seem to have subsumed the patch at #9080 in this patch. You should instead apply that patch to your Sage, and then create your new patch on top of that one.
Well, that's exactly what I did. Only I transferred the changes of that patch into my patch by my merge software line by line. It is not the way it is meant to be done, is it? I'm quite unfamiliar with mercurial version control system. So to say I'm unable to rewind that patch. Of course I didn't meant to spoil the credits of patch #9080 developer. As you can see I didn't change his name in the header.
A very minor comment - you should set up your HG defaults
Maybe I can do that :)
Also, a point of information related to your email to sage-devel; although you add tests for the new distributions, that wouldn't remove the need for #11514. It would be a good step in that direction, though!
To be honest I don't know exactly what is meant by that. Please give some example. but you'd better do that at #11514.
More substantively, I think (my opinion only) that based on the discussion about this on sage-devel, the binomial and other "discrete" distributions should somehow be separated, if only for user convenience.
This needs rethinking. Two points to mention:
- From a programmers perspective, it is too much redundancy. The implementation of discrete and continuous distribution is almost the same except plotting. Well we can create a base class that implements all functionality except plotting and help. Still I believe its superfluous work.
- From a user perspective, especially a newcommer's, it is not likely that he/she knows, for instance, that binomial distribution is a discrete one and that an other class has to be used. So we may create frustration at this end too. Besides R doesn't make the distinction either
comment:4 Changed 8 years ago by
I added two notebook worksheets to test these new probability distributions.
http://www.sagenb.org/home/pub/2887
http://www.sagenb.org/home/pub/2886/
comment:5 in reply to: ↑ 3 Changed 8 years ago by
- Description modified (diff)
- Summary changed from Add new probabillity dsitributions to Add new continuous probabillity dsitributions
Replying to Kamhamea:
you seem to have subsumed the patch at #9080 in this patch. You should instead apply that patch to your Sage, and then create your new patch on top of that one.
Well, that's exactly what I did. Only I transferred the changes of that patch into my patch by my merge software line by line. It is not the way it is meant to be done, is it?
The way I do it is to do
sage: hg_sage.import_patch("The original patch name.patch")
Then do my own changes, then do
sage: hg_sage.diff() # gives me all the changes I've made to look at sage: hg_sage.ci() # I "commit" the patch sage: hg_sage.export(tip,"name I want to give the new patch")
This allows the original patch to stay the same. I strongly suggest reading the Sage development guide; it is pretty comprehensive, because we have so many new contributors.
I'm quite unfamiliar with mercurial version control system. So to say I'm unable to rewind that patch. Of course I didn't meant to spoil the credits of patch #9080 developer. As you can see I didn't change his name in the header.
No, of course you didn't. It takes a while to get used to this, for sure. You can do
sage: hg_sage.rollback() sage: hg_sage.revert(options="--all")
to undo your patch. Then you can reimport the other patch correctly, then start making your changes again.
To be honest I don't know exactly what is meant by that. Please give some example. but you'd better do that at #11514.
Yes, you are right.
More substantively, I think (my opinion only) that based on the discussion about this on sage-devel, the binomial and other "discrete" distributions should somehow be separated, if only for user convenience.
This needs rethinking. Two points to mention:
- From a programmers perspective, it is too much redundancy. The implementation of discrete and continuous distribution is almost the same except plotting. Well we can create a base class that implements all functionality except plotting and help. Still I believe its superfluous work.
This is exactly what is done for most Sage modules. We create a base class that does everything that is the same, and then rewrite or overload methods that are different. That would be fine. What I think would be not so good is to try to do the same thing for discrete distributions as for continuous ones, because there should be some differences. Unless you can find a way to preserve backward compatibility while doing R's pattern.
But that could be a different ticket. Better to get this new and useful functionality in, rather than have a long discussion and then a year from now people still can't use all these GSL distributions easily wrapped!
- From a user perspective, especially a newcommer's, it is not likely that he/she knows, for instance, that binomial distribution is a discrete one and that an other class has to be used. So we may create frustration at this end too. Besides R doesn't make the distinction either
If someone doesn't know this, they perhaps shouldn't be using probability distributions! More seriously, the best way to deal with this is good documentation at the top of the file, so that it is easy to find in the reference manual.
How about this. Can we make this ticket be about adding new continuous distributions (so not binomial), and then continue the discussion about the rest on a different ticket? I feel like the consensus on sage-devel was in having this mathematically-inspired distinction, but it shouldn't hold up getting in the new distributions. At that location we can also discuss what these things should be named.
comment:6 Changed 8 years ago by
- Summary changed from Add new continuous probabillity dsitributions to Add new continuous probability distributions
Changed 8 years ago by
comment:7 Changed 6 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:8 Changed 5 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:9 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:10 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4
Patch adds a list of probability distributions