MathGroup Archive 2005

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

Search the Archive

Re: random matrix from row and column sums

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53831] Re: random matrix from row and column sums
  • From: "Valeri Astanoff" <astanoff at yahoo.fr>
  • Date: Sat, 29 Jan 2005 06:02:39 -0500 (EST)
  • References: <csinpt$njk$1@smc.vnet.net><200501200847.DAA04066@smc.vnet.net> <csqqs1$1mh$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Bob,

Your solution is by far faster than mine, but what kind of random is
it?

Consider this example :
[...]
In[9]:=
bob=Table[randomFill[{10,10,10,10,10},{10,10,10,10,10}],{100}]//Flatten;

In[10]:=
BinCounts[bob,{-1,10}]
Out[10]=
{1147,355,224,191,134,117,105,68,70,53,36}

In[11]:=
val=Table[rand[{10,10,10,10,10},{10,10,10,10,10}],{100}]//Flatten;

In[12]:=
BinCounts[val,{-1,10}]
Out[12]=
{348,613,740,445,226,102,24,2,0,0,0}

In[13]:=
rep=N[{Mean[#],Mode[#],Median[#],StandardDeviation[#],Skewness[#]}]&;

In[14]:=
rep[bob]
Out[14]=
{2.,0.,1.,2.64809,1.33292}

In[15]:=
rep[val]
Out[15]=
{2.,2.,2.,1.37228,0.525969}

With your fast but too much skewed solution 0 is three times
more likely to occur than 1 and five times more likely to occur than 2,

which is the mean (and is also the mode and median with my solution).
I wonder whether it is what the initial poster expected...


Valeri


  • Prev by Date: Re: position of letters in a string
  • Next by Date: Re: Solving matrix equation
  • Previous by thread: Re: Re: random matrix from row and column sums
  • Next by thread: Re: Re: random matrix from row and column sums