Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Randomly biased, random numbers.

by educated_foo (Vicar)
on Dec 06, 2013 at 03:19 UTC ( [id://1065884]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Randomly biased, random numbers.
in thread Randomly biased, random numbers.

I definitely do not want any formally defined distribution.
Do you have sample data you can perturb, mix, or otherwise use to generate test data?
I want lopsided distributions that are completely randomly generated.
Hm... Maybe transform your PRNG through a random, monotonic, nonlinear mapping? e.g. generate a piecewise-linear function (or spline) in each dimension with steps taken from the PRNG, then generate uniform random points and apply the function to them. I suspect a Real Statistician would scoff, but I am not such a person.

Replies are listed 'Best First'.
Re^4: Randomly biased, random numbers.
by BrowserUk (Patriarch) on Dec 06, 2013 at 03:57 UTC
    generate a piecewise-linear function (or spline) in each dimension with steps taken from the PRNG, then generate uniform random points and apply the function to them.

    That's sounds like a real possibility -- or rather looks like it having done a search for "spline" and seen a few images. I'm imagining sticking a few (2 or 3 or 4 decided at random) sticks, of random length, into a square of ground at randomly chosen points; and then draping a tarpaulin over them. The height of the tarpaulin at any given point then "influences" the randomly generated xy pairs such that they tend to concentrate around the sticks.

    I haven't a clue how I'd go about it though :( (Offers?:)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      You more or less have it.
      I haven't a clue how I'd go about it though :( (Offers?:)
      For my standard consulting rate? ;-)

      Basically, you want to take a uniform distribution between 0 and M, and map it to a non-uniform one between 0 and N, so that X+I < X+J when I < J. One way to do this is to generate a step-functionpiecewise linear function, then translate values through that step function. In Matlab, it looks something like this for a 10-step function:

      fx = [0,cumsum(unifrnd(0,1,1,10))]; tmp=unifrnd(1,10,1,1e5); ix=floor(tmp); dx=rem(tmp,1); values = (fx(ix) + (fx(ix+1)-fx(ix)).*dx)./fx(end-1);
      Using a spline would be more complicated, but would be smoother.
        In Matlab, it looks something like this for a 10-step function:

        Great, thanks. Now all I gotta do is translate that from matlab, a lingo I am not familiar with.

        Darn it. Fell at the first hurdle. I cannot sense of your parameters to unifrnd()?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1065884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-16 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found