POV-Ray : Newsgroups : povray.advanced-users : Stochastics expertise needed : Re: Stochastics expertise needed Server Time
17 May 2024 01:48:16 EDT (-0400)
  Re: Stochastics expertise needed  
From: lelama
Date: 27 Aug 2016 07:05:01
Message: <web.57c172d08629941b7a63dc9f0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 27.08.2016 um 11:26 schrieb lelama:
>
> >> Hm... this still leaves me with a quest for an easy-to-generate random
> >> distribution in the range [0..1) with a nicely configurable peak at 0,
> >> and an easy-to-compute probability density function.
> >>
> >> I guess I want the derivative of the probability density function to be
> >> zero at the peak, and ideally also at 1.
> >
> > Hi,
> >
> > There is a proposal at the end of my previous message. Using uniform
> > distribution for y,t,d and throwing away some "bad" points, you get
> > whatever distribution you want. If you don't like the piecewised
> > affine d that I suggested (the derivative of the density probabilty is not zero
> > at y=1, so maybe not suitable for you), you can choose any positive function d
> > instead with the same construction.
>
> The monte-carlo approach of generating arbitrarily distributed random
> numbers is only practical if the points to throw away are reasonably
> few, in other words if d(y)>>0 for most of the function. Unfortunately
> that's specifically not the case I'm aiming for -- I want d(y)>>0 only
> in a small portion near y=0.


Hmm, Yes, I see your objection.

A possibility then is to divide the surface under the graph of the function d
into smaller parts. For instance, in the piecewise affine case, the area under
the graph can be decomposed as a union of a rectangle R with measure r and a
triangle T with measure t . It is not too hard to make a uniform distribution
for points in R and an other uniform distribution for points in T.

Let t0,r0 be integers such that (t0,r0) is a vector proportional to the
measusrements (t,r) of the triangle and the rectangle.

Then choosing alternativly t points in the Triangle and r points in the
Rectangle with the uniform distributions discussed above yield the required
distribution without the problem you mentioned.

hth,
Laurent.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.