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


Groups > comp.soft-sys.math.mathematica > #8217

Re: Probability

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Probability
Date 2012-01-27 11:19 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jfu17t$ccq$1@smc.vnet.net> (permalink)
References <201201260824.DAA23859@smc.vnet.net>

Show all headers | View raw


The timing difference is due to caching associated with NProbability;
however, there are much faster ways of obtaining your result.

Timing[1. - PDF[HypergeometricDistribution[58, 11727, 234546], 0]]

{0.010423, 0.948968}

Timing[1. - Probability[x == 0,
   x \[Distributed] HypergeometricDistribution[58, 11727, 234546]]]

{0.058417, 0.948968}

Now with NProbability

Timing[1 - NProbability[x == 0,
   x \[Distributed] HypergeometricDistribution[58, 11727, 234546]]]

{261.489, 0.948968}

The NProbability timing bill has been paid

Timing[NProbability[x > 0,
  x \[Distributed] HypergeometricDistribution[58, 11727, 234546]]]

{0.208077, 0.948968}


Bob Hanlon


On Thu, Jan 26, 2012 at 3:24 AM, Benedetto Bongiorno
<bongiob@sbcglobal.net> wrote:
> Can anyone test & explain why this function's timing is substantial longer
> the first time it is executed over subsequent times?
>
>
>
> Timing[NProbability[x>0,x=E9HypergeometricDistribution[58,11727,234546]]]
>
> {260.25,0.948968}
>
> Timing[NProbability[x>0,x=E9HypergeometricDistribution[58,11727,234546]]]
>
> {0.234,0.948968}
>
>
>
> I ran it on two different PC and the difference is the same.
>
>
>
> Mathematica V8.04
>
> Windows 7, Professional 64
>
>
>
> Benedetto Bongiorno CPA CRE
>
> Cell 214-707-6546
>
> Land 972-470-9138
>
> Fax 972-470-9748
>
> bongiob@sbcglobal.net
>
>
>
> This Email is covered by the Electronic Communications Privacy Act, 18
> U.S.C. Sections 2510-2521 and is legally privileged. The information
> contained in this Email is intended only for the use of the individual
> or entity named above. If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distributions
> or copying of this communication is strictly prohibited. If you have
> received this communication in error, please notify sender

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Probability Bob Hanlon <hanlonr357@gmail.com> - 2012-01-27 11:19 +0000

csiph-web