Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9352

Re: RandomDirichlet?

Date 2011-11-01 22:09 -0400
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: RandomDirichlet?
References <CAD575DC.8551%bravegag@hotmail.com>
Message-ID <4eb0a64d$0$294$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 11/1/2011 5:09 AM, Giovanni Azua wrote:
> I need to generate random TPCH workloads but I don't want a Uniform
> distribution where Q1, RF1, RF2 would be equally probable i.e. using new
> Random().nextInt(..)
>
> I instead would like to draw samples from a Dirichlet distribution which
> would give a very skewed PD depending on the input alphas (which specify how
> skewed I want the PD to be). The Matlab code would be exactly:
>
> function r = dirichlet_sample(a,n)
> p = length(a);
> r = gamrnd(repmat(a,n,1),1,n,p);
> r = r ./ repmat(sum(r,2),1,p);
> End
>
> But there is no "gamrnd" RandomGamma in Java nor RandomDirichlet. Before I
> spend time writing this, can anyone advice for a low-footprint library
> implementing those functions?

http://acs.lbl.gov/software/colt/
http://acs.lbl.gov/software/colt/api/cern/jet/random/Gamma.html

could be worth a try.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

RandomDirichlet? Giovanni Azua <bravegag@hotmail.com> - 2011-11-01 10:09 +0100
  Re: RandomDirichlet? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-01 07:50 -0400
    Re: RandomDirichlet? Giovanni Azua <bravegag@hotmail.com> - 2011-11-01 19:50 +0100
  Re: RandomDirichlet? Wojtek <nowhere@a.com> - 2011-11-01 04:54 -0700
  Re: RandomDirichlet? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-01 06:11 -0700
    Re: RandomDirichlet? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-01 06:16 -0700
    Re: RandomDirichlet? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-01 20:23 -0400
      Re: RandomDirichlet? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-02 01:39 -0700
        Re: RandomDirichlet? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-02 08:17 -0400
  Re: RandomDirichlet? Arne Vajhøj <arne@vajhoej.dk> - 2011-11-01 22:09 -0400

csiph-web