MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica 7 weirdness

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94632] Re: Mathematica 7 weirdness
  • From: antononcube at gmail.com
  • Date: Thu, 18 Dec 2008 07:21:29 -0500 (EST)
  • References: <C7EFEF88-F3D3-4E38-87D4-E481FFF62029@mimuw.edu.pl>

NIntegrate has a generator for the Hammersley sequence (working on all
platforms).

The code below can be used to generate Hammersley sequence points:

Clear[HammersleyPoints];
HammersleyPoints[dim_, n_] :=
 Block[{pnts, x, xs},
  xs = Array[x, dim];
  pnts =
   Reap[NIntegrate[Total[xs], Evaluate[ Sequence @@ Map[{#, 0, 1} &,
xs]],
      Method -> {MonteCarlo,
        Method -> {MonteCarloRule, PointGenerator ->
NIntegrate`Hammersley,
          Points -> n}}, MaxPoints -> n, MaxRecursion -> 0,
      EvaluationMonitor :> Evaluate[Sow[xs]]]][[2, 1]];
  Drop[pnts, 2]
  ];

pnts = HammersleyPoints[3, 2023];
pnts // Length

Graphics3D[Point[pnts], AspectRatio -> 1]

Anton Antonov
Wolfram Research, Inc.

On Dec 17, 6:34 am, Andrzej Kozlowski <a... at mimuw.edu.pl> wrote:
> On 17 Dec 2008, at 01:35, Darren Glosemeyer wrote:
>
>
>
>
>
> > Andrzej Kozlowski wrote:
> >> On 16 Dec 2008, at 15:42, Andrzej Kozlowski wrote:
>
> >>> Here is a (slightly modified) example from the  
> >>> RandomNumberGeneration tutorial, which comes as part of the  
> >>> documentation:
>
> >>> BlockRandom[
> >>> SeedRandom[Method -> {"MKL", Method -> {"Niederreiter",  
> >>> "Dimension" -
> >>>> 2}}];
>
> >>> RandomReal[1, {2, 2}]]
>
> >>> The problem is that as well as the expected output we get an  
> >>> error  message:
>
> >>> SeedRandom::nogen:MKL is not one of the built-in random number  
> >>> generators Lattice, Congruential, MersenneTwister, Rule30CA,  
> >>> Rule50025CA, ExtendedCA, or Legacy.  A defined generator must be =
 
> >>> represented by a symbol. >>
>
> >>> One possible reason is that I am using Mac OS X and the  
> >>> documentation says:
>
> >>> The  "MKL" method uses the random number generators provided in  
> >>> Intel's MKL libraries. The MKL libraries are platform dependent.  
> >>> The  "MKL" method is available on Microsoft Windows (32-bit, 64- =
 
> >>> bit), Linux x86 (32-bit, 64-bit), and Linux Itanium systems.
>
> >>> Intel Macs are not mentioned, but since, other than producing the  
> >>> error message, the generator works fine, this should count as a  
> >>> serious omission (if not exactly a bug) which should be corrected  
> >>> as  soon as possible.
>
> >>> Andrzej Kozlowski
>
> >> On second thoughts, since all that is needed is
>
> >> Off[SeedRandom::"nogen"]
>
> >> probably I should have written "not very serious omission"  ;-)
>
> >> Andrzej Kozlowski
>
> > I checked with a colleague who uses an Intel Mac and he verified  
> > that the number generator is falling back to the default method.  
> > While numbers are generated, the numbers generated will not have the =
 
> > low discrepancy properties of Niederreiter numbers.
>
> > Darren Glosemeyer
> > Wolfram Research
>
> Yes, one can actually clearly see that this must be so just by looking =
 
> at the picture :-(
>
> This is very disappointing. I was planning to low discrepancy number  
> in a series of presentations which aim at popularizing Mathematica  
> with the Japanese finance community, but it now seems I will have to  
> settle for Monte-Carlo methods only (since I do not want to use  
> Windows or Linux). Is this something that could be easily (and  
> quickly) fixed? In particular, can it be done by WRI alone or does it  
> need help from Apple (if it is the latter I doubt the fix will come  
> soon).
>
> Andrzej Kozlowski



  • Prev by Date: Re: Need Help
  • Next by Date: Re: "The requested evaluator is not currently defined"
  • Previous by thread: Re: Re: Mathematica 7 weirdness
  • Next by thread: Re: Did I trash Mathematica installation? -- CleanSlate caveat