<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks. In this case I think something isn&#39;t right with [array random]. Using the same array, I get very different patterns with the two methods (see attached patch). The difference is obvious with a gaussian distribution, which looks skewed when generated with [array random].</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Best,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
Peiman</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
<br></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><br></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div>
<font face="comic sans ms, sans-serif"><b><a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> || <a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">RSS Feed</a> || <a href="http://spectralkimia.wordpress.com/" target="_blank">Concert News</a></b></font></div>
</div></div>
<br><br><div class="gmail_quote">On 22 November 2013 15:48, Miller Puckette <span dir="ltr">&lt;<a href="mailto:msp@ucsd.edu" target="_blank">msp@ucsd.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There could be something wrong.  But array_random_bang() (in x_array.c)<br>
cooks up a pseudorandom number from 0 to 1 (I believe) and then calls<br>
array_quantile_float() with it.  That&#39;s exactly what connecting random()<br>
to array_quantile in a patch should be doing.<br>
<br>
cheers<br>
<span class="HOEnZb"><font color="#888888">Miller<br>
</font></span><div class="im HOEnZb"><br>
On Fri, Nov 22, 2013 at 09:38:59AM +0000, peiman khosravi wrote:<br>
&gt; Thank you very much. That does the trick.<br>
&gt;<br>
&gt; Though, [array random] doesn&#39;t seem to be working as I expected. Am I right<br>
&gt; to think that it should produce the same result as [array quantile] fed<br>
&gt; with uniformly distributed random values? If so I&#39;m getting very different<br>
&gt; results here.<br>
&gt;<br>
&gt; Thanks<br>
&gt; Peiman<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">&gt; *<a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> &lt;<a href="http://www.peimankhosravi.co.uk" target="_blank">http://www.peimankhosravi.co.uk</a>&gt; || RSS Feed<br>

&gt; &lt;<a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">http://peimankhosravi.co.uk/miscposts.rss</a>&gt; || Concert News<br>
&gt; &lt;<a href="http://spectralkimia.wordpress.com/" target="_blank">http://spectralkimia.wordpress.com/</a>&gt;*<br>
&gt;<br>
&gt;<br>
&gt; On 22 November 2013 04:16, Miller Puckette &lt;<a href="mailto:msp@ucsd.edu">msp@ucsd.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; I think the patch is occasionally (once every 512 times on average) sending<br>
&gt; &gt; zero to &quot;array quantile&quot; which then outputs the index of the first nonzero<br>
&gt; &gt; number in the table -- in this case a point with probability about 1e-45.<br>
&gt; &gt;<br>
&gt; &gt; Maybe try random 1e8 (or so) and divide by 1e8 to get a more continuous,<br>
&gt; &gt; less grainy random sample out of the array.<br>
&gt; &gt;<br>
&gt; &gt; cheers<br>
&gt; &gt; Miller<br>
&gt; &gt;<br>
&gt; &gt; On Fri, Nov 22, 2013 at 01:51:19AM +0000, peiman khosravi wrote:<br>
&gt; &gt; &gt; Hello,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Has anyone got any experience with [array quantile]?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;m getting some strange results and I&#39;ve done everything I can think of.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;ve attached a patch that should clarify the problem. Basically,<br>
&gt; &gt; &gt; sometimes, not always, [array quantile] returns some weird numbers that I<br>
&gt; &gt; &gt; can&#39;t explain.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; And a related issue: array random doesn&#39;t seem to be doing what it should<br>
&gt; &gt; &gt; be doing. It returns very different values, compared with quantile fed<br>
&gt; &gt; with<br>
&gt; &gt; &gt; random values between 0 and 1. Again, there is an example of what I mean<br>
&gt; &gt; in<br>
&gt; &gt; &gt; the attached patch.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks<br>
&gt; &gt; &gt; Peiman<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; *<a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> &lt;<a href="http://www.peimankhosravi.co.uk" target="_blank">http://www.peimankhosravi.co.uk</a>&gt; || RSS Feed<br>

&gt; &gt; &gt; &lt;<a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">http://peimankhosravi.co.uk/miscposts.rss</a>&gt; || Concert News<br>
&gt; &gt; &gt; &lt;<a href="http://spectralkimia.wordpress.com/" target="_blank">http://spectralkimia.wordpress.com/</a>&gt;*<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt; &gt; &gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt; &gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
<br>
&gt; _______________________________________________<br>
&gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt; UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
</div></div></blockquote></div><br></div>