I would like to create a gaussian curve between two values (which is the end point of two different calculations). I am aware that i require a bit more background info, but i wish to play with the result. So let us assume what is not known, the values in question may be 1.9 and 2.1.
My goals is to to draw a number randomly between those two, and be more biased to the mean than to the one or the other extreme as a start point for the next calculation.
Any help would be appreciated, thanks in advance!
UPDATE I:
for clarity,
both blue and black lines start at some origin, the calculation differs and the values at the end points are different. From only those two values, any amount of ppoints can be set up. n can be between 2 and 100 - it does not matter. The point is, to create a distribution like indicated by the bell shaped curve.
Following Severin Pappadeux's excellent suggestion, we now have defined n, which now leaves us only to define the distribution.
n=10
IH=1.9:0.01:2.1
v = 1.9 + ((2.1-1.9)/n) * IH(n)
bar(IH)
hold on
bar(n,v,'k')
UPDATE II: RESULTS!
As you can see, the curve multiplied into two curves, with each having a distribution of possible outcomes from which another calculation is started. The purpose was to be close to a setpoint. Im almost done, so
Big Thanks!
Might use Irwin-Hall from https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution
Basically,
Scaling to your [1.9...2.1] range
v = 1.9 + ((2.1-1.9)/n) * IH(n)
It is bounded, very easy to sample, and at large
n
it is pretty much gaussian. You could varyn
to get narrow or wide peakSampling, in some C pseudocode
UPDATE
translated to Octave
So sampling would be along the line (say, one million events, IH with 8 d.o.f)
Another update, added function QG, which generates desired random vector
Try to fill histrogram, along the lines