<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small"><span style="font-family:Arial,Helvetica,sans-serif">On Sat, Feb 5, 2022 at 3:55 PM Daniel Carrera <<a href="mailto:dcarrera@gmail.com">dcarrera@gmail.com</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><a href="https://postimg.cc/zV34pv0F" target="_blank">https://postimg.cc/zV34pv0F</a><br></div></div><div class="gmail_quote"><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small">Unfortunately, it doesn't seem to be space-filling. It looks like you have reinvented Sierpiński's gasket.</div></div></div>
</blockquote></div><br clear="all"><div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Incidentally, my own idea of using multiple barycenters doesn't work either. It gives points very clustered in the center of the simplex.</div></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">I did find a solution that works great for a 2D simplex, but I don't see an obvious way to generalize it. We begin by generating a pair of points (u,v) from the 2D Sobol sequence. We want to map these to (x,y) inside the simplex in a way that retains at least some of the uniformity guarantees of the Sobol sequence. The simplex is defined by the boundary:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">x + y < 1</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">That means for x = 0 there are more possible values of y than for x = 0.9, so we should produce more values close to x=0. This is a familiar problem in the context of drawing random numbers and it has a known solution.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Let `y = f(x) = 1 - x` be (not normalized) the probability of generating the value `x`. The cumulative distribution is:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">F(x) = x - x^2/2</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Normalize it to `F(x) = 2x - x^2` so that we have the property that `F(0) = 0` and `F(1) = 1`. So we can let F(x) be equal to the first Sobol number:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">F(x) = u</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">=> x = 1 - sqrt(1 - u)</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">This gives an `x` with the correct probability distribution and we are free to draw `y` randomly between 0 and (1-x). We accomplish that with the second Sobol number:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">=> y = (1 - x)*v</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">The result is a nicely uniform distribution of points without the clustering that you'd expect from random points:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><a href="https://postimg.cc/XBbnD7fQ">https://postimg.cc/XBbnD7fQ</a></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">There's probably a way to generalize these ideas to higher dimensions.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Cheers,</div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="trebuchet ms, sans-serif">Dr. Daniel Carrera</font></div><div dir="ltr"><font face="trebuchet ms, sans-serif">Postdoctoral Research Associate</font></div><div><font face="trebuchet ms, sans-serif">Iowa State University</font></div></div></div></div></div></div></div></div></div></div></div>