# [Rd] .Random.seed (PR#911)

**e.zwane@fss.uu.nl
**
e.zwane@fss.uu.nl

*Thu, 12 Apr 2001 10:44:17 +0200 (MET DST)*

I am not sure whether this is really a bug, but seems to be as my program
works pretty well in S+, for small iterations.
I am creating a random sample from a chi^2 distribution with 23.5 df. Thus
I have to sample from a chi^2 with 23 or 24 df with probability 0.5. The
other alternative is to create a weighted version of the two distribution,
which is where my problem lies.
I use the following commands
while(iter<100){
old.seed<-.Random.seed
#sample from chi^2 23
set.seed(old.seed)
#sample from chi^2 24
#chi^2, 23.5 <- 0.5*(chi^2 23+chi^2 24)
iter+1
}
The unfortunate thing is that the ".Random.seed" is no longer random but
remains constant, and I want to find ways around this problem.
_______________________________________________________________________
Eugene ZWANE
Department of Methodology and Statistics
Postbus 80.140
3508 TC, Utrecht
The Netherlands
Tel: +31 (030) 253-7635
_______________________________________________________________________
The formulation of a problem is more often essential than its solution
which may be merely a matter of mathematical or experimental skill.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._