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.
| [reply] |
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. | [reply] [d/l] |
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.
| [reply] |