Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: RandomReplacement

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51665] Re: RandomReplacement
  • From: sean kim <sean_incali at yahoo.com>
  • Date: Wed, 27 Oct 2004 23:44:42 -0400 (EDT)
  • Reply-to: sean_incali at yahoo.com
  • Sender: owner-wri-mathgroup at wolfram.com

hi andrej and everyone

I'm starting to think *maybe* the PackedArray isn't
the problem. To reproduce the problem...

In[1]:= SeedRandom[5];
Timing[First[real1=Table[Random[],{249}]]]
Developer`PackedArrayQ[real1] 

Out[2]= {0. Second,0.786599}
Out[3]= False

In[4]:= SeedRandom[5];
Timing[First[real2=Table[Random[],{250}]]]
Developer`PackedArrayQ[real2] 

Out[5]= {0. Second,0.786599}
Out[6]= True

and there it is. 

now... 

Quit

In[1]:= Needs["Statistics`ContinuousDistributions`"]; 
In[2]:= uni= UniformDistribution[0, 1]
Out[2]= UniformDistribution[0,1]

In[3]:= SeedRandom[5];
Timing[First[uni1=Table[Random[uni],{249}]]]
Developer`PackedArrayQ[uni1] 

Out[4]= {0. Second,0.786599}
Out[5]= False


In[6]:= SeedRandom[5];
Timing[First[uni2=Table[Random[uni],{250}]]]
Developer`PackedArrayQ[uni2] 

Out[7]= {0.01 Second,0.786599}
Out[8]= False

Without loading RandomReplacement, we see the
packedarray problem is no longer present if we change
way we use the Random. 

Needs["Statistics`ContinuousDistributions`"]; 
uni= UniformDistribution[0, 1]
Random[uni]

should be identical to Random[] ( according to help)

but once we load the RandomReplacement, 

Quit

In[1]:= <<RandomReplacement.m
In[2]:= SeedRandom[5];
Timing[First[real3=Table[Random[],{249}]]]
Developer`PackedArrayQ[real3] 

Timing[First[real4=Table[Random[],{250}]]]
Developer`PackedArrayQ[real4] 

Out[3]= {0. Second,0.66205}
Out[4]= False
Out[5]= {0. Second,0.793703}
Out[6]= True

problem with packedarray is still there.

but the package *does* solve the problems reported in
posts, 

http://groups.google.com/groups?hl=en&lr=&newwindow=1&safe=off&threadm=b8vrqe%24dit%241%40smc.vnet.net&rnum=3&prev=/groups%3Fhl%3Den%26lr%3D%26newwindow%3D1%26safe%3Doff%26q%3Drandom%2Bcorrelation%26meta%3Dgroup%253Dcomp.soft-sys.math.mathematica

and 

http://groups.google.com/groups?hl=en&lr=&newwindow=1&safe=off&threadm=a61v9o%24gq4%241%40smc.vnet.net&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26newwindow%3D1%26safe%3Doff%26q%3Drandom%2Bfishy%26meta%3Dgroup%253Dcomp.soft-sys.math.mathematica

while the PackedAray problem persists.  


Using, 

Needs["Statistics`ContinuousDistributions`"]; 
uni= UniformDistribution[0, 1]
Random[uni]

in the above cases, doesn't get fix the probloem btw. 


and if it's "getting around the packedArray" that's
slowing things down, perhaps there is no need for that
step? ( since the current package doesn't get around
it)

I don't know. 

wanted to hear everyone's thoughts on it.

 
sean 



	
		
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail


  • Prev by Date: orthogonal 4d rotational matrices in Mathematica
  • Next by Date: Re: Another bizarre phenomenon
  • Previous by thread: Re: Re: RandomReplacement
  • Next by thread: Re: RandomReplacement