Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Giovanni Azua Newsgroups: comp.lang.java.programmer Subject: RandomDirichlet? Date: Tue, 01 Nov 2011 10:09:32 +0100 Lines: 24 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net IjTMsI9mnZiKD6Y40jukIw42KDM1eo8yA0DlGL0iZmoKhqlrXw Cancel-Lock: sha1:TRgkeb3t78k4zQQ6aVexXrwHDss= User-Agent: Microsoft-Entourage/12.31.0.110725 Thread-Topic: RandomDirichlet? Thread-Index: AcyYdfegYCfNJx971kmIB/vYAIgt+g== Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9332 Hello, 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? TIA, Best regards, Giovanni