[R-SIG-Mac] rnorm.halton

David Winsemius dwinsemius at comcast.net
Tue Sep 15 15:01:36 CEST 2009


I get very different output from the two versions of Mac OSX R as  
well. The 32 bit version puts out a histogram that has an expected,  
almost symmetric unimodal distribution. The 64 bit version created a  
bimodal distribution with one large mode near 0 and another smaller  
mode near 10E+37. Postcript output attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 64bit-halton.ps
Type: application/postscript
Size: 3802 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20090915/c87f5e55/attachment.ps>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 32bit-halton.ps
Type: application/postscript
Size: 3772 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20090915/c87f5e55/attachment-0001.ps>
-------------- next part --------------


Neither version seemed to change with repeated invocations which I  
thought odd in what I thought would be  graphic realization of random  
function, but then I don't know much about this area of statistics, so  
I don't know is the output is supposed to appear deterministic.

Running the suggested replacement causes an error on both 32 bit and  
64 bit machines:
 > hist(halton(n = 5000, dim = 1, norm=TRUE), main = "Normal Halton",
+ xlab = "x", col = "steelblue3", border = "white")
Error in hist(halton(n = 5000, dim = 1, norm = TRUE), main = "Normal  
Halton",  :
   could not find function "halton"

 > sessionInfo()
R version 2.9.1 Patched (2009-07-04 r48897)
x86_64-apple-darwin9.7.0

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] fOptions_290.75    fBasics_2100.77    MASS_7.2-47         
timeSeries_2100.83 timeDate_290.85
-- 
David



On Sep 15, 2009, at 1:46 AM, Christophe Dutang wrote:

> It does not solve your problem, but in the future, you should use the
> halton function, since Diethelm Wuertz and I decided it to move
> runif.halton (based on fortran code) to the randtoolbox package. In
> the man page, there is an example of plot:
>
> hist(halton(n = 5000, dim = 1, norm=TRUE), main = "Normal Halton",
> xlab = "x", col = "steelblue3", border = "white")
>
> But unfortunately, I do not have a 64 bit version of R, so I can not
> help you. Let me know if there is a problem with the fortran code.
>
> Christophe
>
> Le 15 sept. 09 ? 03:55, Anirban Mukherjee a ?crit :
>
>> Sorry, but of course.
>>
>> rnorm.halton should be "almost" identical to rnorm (rnorm gives draws
>> from a 0 mean, 1sd Normal). Halton sequences (amongst other things)
>> allow one to draw from the normal in a "more intelligent" fashion  
>> when
>> integrating. Using hist, you should see the classic "bell curve"
>> centered around 0. Almost identical to
>>
>> hist(rnorm(1000), plot=TRUE)
>>
>> The 32 bit "version" gives the bell curve. My 64 bit version gives a
>> totally different plot (nothing subtle) ... some times with only
>> positive values for all 100 draws. My 64 bit version of rnorm.halton
>> also often outputs a bunch of NaNs. If both your plots look like a
>> bell curve, the problem is on my machine/end.
>>
>> Thanks very much: do greatly appreciate it.
>>
>> Best,
>> Anirban
>>
>> On Mon, Sep 14, 2009 at 9:31 PM, Steve Lianoglou
>> <mailinglist.honeypot at gmail.com> wrote:
>>> Hi,
>>>
>>> On Mon, Sep 14, 2009 at 8:28 PM, Anirban Mukherjee <anirbanm at smu.edu.sg
>>>>
>>> wrote:
>>>> To add:
>>>>
>>>> If I try to install using the mac.binary, it tells me (on opening
>>>> the
>>>> 64 bit app) that the package is not installed for x64. And does not
>>>> let me load the library when using 64 bit mode. However, if I
>>>> install
>>>> the package from source, then it installs for x64, but gives me
>>>> weird
>>>> results.
>>>>
>>>> Again: would appreciate if some one could confirm so that I can
>>>> contact the authors and let them know. I do need Halton normals for
>>>> some thing I am working on, and I am sitting right on that
>>>> borderline
>>>> point where the memory constraints of the 32 bit app are making me
>>>> lose sleep ...
>>>
>>> I wouldn't know what to look for to tell you if it's going wrong or
>>> not.
>>>
>>> I have no idea about anything related to financial modeling and  
>>> don't
>>> have the fOptions package installed anyway.
>>>
>>> Perhaps if you post the two images you get:
>>> i. what you expect to see/what you get from 32bit
>>> ii. the wrong image that you're getting from the 64bit version
>>>
>>> One of us can confirm/deny that we get the same thing.
>>>
>>> Otherwise, I really can't give you an educated answer w/o having to
>>> looking into what this 'halton' stuff is anyway ...
>>>
>>> So .. help us help you :-)
>>>
>>> I'm not sitting at a 64 bit machine atm, so hopefully someone else
>>> can
>>> help you before I get back to school tomorrow ...
>>>
>>> -steve
>>>
>>> --
>>> Steve Lianoglou
>>> Graduate Student: Computational Systems Biology
>>> | Memorial Sloan-Kettering Cancer Center
>>> | Weill Medical College of Cornell University
>>> Contact Info: http://cbio.mskcc.org/~lianos/contact
>>>
>>
>>
>>
>> -- 
>> Anirban Mukherjee | Assistant Professor, Marketing | LKCSB, SMU
>> 5062 School of Business, 50 Stamford Road, Singapore 178899 |
>> +65-6828-1932
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> --
> Christophe Dutang
> Ph.D. student at ISFA, Lyon, France
> website: http://dutangc.free.fr
>
>
>
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-SIG-Mac mailing list