blangSDK icon indicating copy to clipboard operation
blangSDK copied to clipboard

add pareto distribution

Open gsgarbi opened this issue 6 years ago • 3 comments

gsgarbi avatar Nov 21 '18 13:11 gsgarbi

Thanks again, let me know when the conflicts are resolved.

alexandrebouchard avatar Nov 23 '18 18:11 alexandrebouchard

Alright, will do! Thanks!

On Mon, Nov 26, 2018, 14:47 Alexandre Bouchard <[email protected] wrote:

@alexandrebouchard requested changes on this pull request.

Thanks! Some minor changes proposed.

In src/main/java/blang/distributions/Pareto.bl https://github.com/UBC-Stat-ML/blangSDK/pull/113#discussion_r236457562:

@@ -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 https://github.com/UBC-Stat-ML/blangSDK/pull/113#discussion_r236457993:

@@ -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 https://github.com/UBC-Stat-ML/blangSDK/pull/113#pullrequestreview-178537713, or mute the thread https://github.com/notifications/unsubscribe-auth/AlAAF14VolVwivqamPCMPIp1C679mIC9ks5uzG-VgaJpZM4YtFcb .

gsgarbi avatar Nov 26 '18 23:11 gsgarbi

Once the conflicts above are resolved and my above comments addressed I'm happy to merge that pull request.

alexandrebouchard avatar Jun 22 '19 20:06 alexandrebouchard