Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 2294 invoked from network); 27 Oct 2009 01:01:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 01:01:47 -0000 Received: (qmail 3464 invoked by uid 500); 27 Oct 2009 01:01:46 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 3341 invoked by uid 500); 27 Oct 2009 01:01:46 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 3331 invoked by uid 99); 27 Oct 2009 01:01:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 01:01:46 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phil.steitz@gmail.com designates 209.85.210.189 as permitted sender) Received: from [209.85.210.189] (HELO mail-yx0-f189.google.com) (209.85.210.189) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 01:01:41 +0000 Received: by yxe27 with SMTP id 27so11095286yxe.10 for ; Mon, 26 Oct 2009 18:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=PL+6N1k1nPIpGQLB7dDtPxrnN+de+wLIbSJ94QhVGls=; b=VVqUmGRR4w7gI7riD8ukoiIXd2vI9igN44prYY7+NzMcJWLrtKjU2leTMh4DBYev9P j8dVCUnYqHyzHc6sL9/uYFQYVKpkQwAYHoU1ZBY7R5gMzlsyXkFmSKB+CEaxVz1BAAa8 10akG7vJEJRYZd/tK4CsUCPCXBRCAQscxQ9bI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=ACUF2dpyPvlSEK5NvwJ5hg1eJnHit/xUEshWIFNTLQ/xvOKdvYmEED4mffLkwSDYaF dP9//hEmdBwPSbb2qBjtjxtLdyBhswYpKWyXJkf4Fio4JqLJd15rRcMONWWzjo0ZW4Sr CIO2zWJGMJ6WA1V5TNfjopiinPv3KVXPIq248= Received: by 10.90.37.8 with SMTP id k8mr5916700agk.19.1256605280555; Mon, 26 Oct 2009 18:01:20 -0700 (PDT) Received: from phil-steitzs-macbook-pro.local (c-68-82-187-235.hsd1.de.comcast.net [68.82.187.235]) by mx.google.com with ESMTPS id 21sm1571135yxe.19.2009.10.26.18.01.19 (version=SSLv3 cipher=RC4-MD5); Mon, 26 Oct 2009 18:01:19 -0700 (PDT) Message-ID: <4AE6465E.5040809@gmail.com> Date: Mon, 26 Oct 2009 21:01:18 -0400 From: Phil Steitz User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] Generate random data using the Inverse CDF Method? References: <3796c6d50910261509n70c5f326yd5ab9eef2b74c92c@mail.gmail.com> <4AE635AF.2050408@gmail.com> <4AE639E4.2080702@gmail.com> <3796c6d50910261711y279cfe05x992c716db723c91b@mail.gmail.com> <3796c6d50910261733v520c6f9bxef9e4e14ffc8f86@mail.gmail.com> In-Reply-To: <3796c6d50910261733v520c6f9bxef9e4e14ffc8f86@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mikkel Meyer Andersen wrote: > Ted: No, I mean with the discrete inverse cdf. But anyway. Thanks for > clarifying the points. > > Phil, if you're not convinced, I'll be happy to provide a > patch-draft/prototype of code so you can see exactly what I mean? > > If we were to put a generator in the distributions (for supporting the > specialised generators), should this method then just be parameterised > by a RandomGenerator? Or what would be a proper approach? That is part of the reason that I would rather see random data generation remain in the random package. That way the RandomGenerator can be easily configured. It is also better separation of concerns. There are lots of things that one can do with probability distributions, including generate random data following them. That does not mean all of these things should be in the distribution implementation classes. I now understand your point about a missing interface. I would be fine with adding a HasInverse or HasInverseCumulativeDistribution interface to mark invertible distributions and then adding a generic nextDeviate to RandomDataImpl. I am also open to deprecating RandomData/RandomDataImpl and refactoring the setup there. What I am -1 on is adding (potentially poor) random data generation to the distributions implementations. Phil > > 2009/10/27 Ted Dunning : >> That was Phil. (not that it matters) >> >> +1 for the idea of a default generator for all distributions that define a >> cumulative density. >> >> +1 as well for specialized implementations where possible that over-ride the >> default generator even if it exists. >> >> I can't imagine much dispute on either of these points because they satisfy >> the general principle of doing the best we can for all cases as well as for >> special cases. >> >> I also completely agree with Mikkel with not understanding why the >> generation of deviates is separated from the distribution. >> >> On Mon, Oct 26, 2009 at 5:11 PM, Mikkel Meyer Andersen wrote: >> >>> Ted, sorry hadn't seen your e-mail before sending mine. >>> >>> Yes, I agree in you point of having specialised good algorithms. But >>> in lack of such methods, I'd prefer being able to have a general >>> method, although it might be bad compared to a specialised one. >>> >>> 2009/10/27 Phil Steitz : >>>> Thanks. That's what I was missing. I would still rather see the >>>> implementations in the random package and for common distributions, >>>> e.g. Poisson, pick a method that is well-suited for the distribution. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org