-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pareto distribution #113
base: master
Are you sure you want to change the base?
Conversation
Thanks again, let me know when the conflicts are resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some minor changes proposed.
// support: (scale, \infty) | ||
|
||
model Pareto { | ||
random RealVar realization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments for each random/param (see other built-in examples)
public static double pareto(Random random, double scale, double shape) | ||
{ | ||
double result = new ParetoDistribution(generator(random), scale, shape).sample(); | ||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify to
return new ParetoDistribution(generator(random), scale, shape).sample();
I think this pattern in this file is an artifact of some past debugging session. They could actually all be simplified.
Alright, will do! Thanks!
…On Mon, Nov 26, 2018, 14:47 Alexandre Bouchard ***@***.*** wrote:
***@***.**** requested changes on this pull request.
Thanks! Some minor changes proposed.
------------------------------
In src/main/java/blang/distributions/Pareto.bl
<#113 (comment)>:
> @@ -0,0 +1,23 @@
+package blang.distributions
+// Pareto distribution
+// support: (scale, \infty)
+
+model Pareto {
+ random RealVar realization
Please add comments for each random/param (see other built-in examples)
------------------------------
In src/main/java/blang/distributions/Generators.java
<#113 (comment)>:
> @@ -28,6 +29,14 @@ public static double halfstudentt(Random random, double nu, double sigma) {
double t = studentt(random, nu);
return Math.abs(t) * sigma;
}
+
+ /** */
+ public static double pareto(Random random, double scale, double shape)
+ {
+ double result = new ParetoDistribution(generator(random), scale, shape).sample();
+ return result;
Simplify to
return new ParetoDistribution(generator(random), scale, shape).sample();
I think this pattern in this file is an artifact of some past debugging
session. They could actually all be simplified.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#113 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AlAAF14VolVwivqamPCMPIp1C679mIC9ks5uzG-VgaJpZM4YtFcb>
.
|
Once the conflicts above are resolved and my above comments addressed I'm happy to merge that pull request. |
No description provided.