[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] implementing distribution equation



  2. why is this code necessary?:
           a = a.collect { |el| el.linlin(min, max, 0, 1) };
          a = (a * size); // fixed resolution for now


  if you want to create an inversion of the data array (a),
it must be brought in a range that equals the range of the values it was cretaed from [0...99] -> [.....] .
  your formula returns values that do not match this range.


when would you want to invert the data array, for negative irpow values?

no, I mean invert the function:
y = f(x)
x = g(y) // the inversion function g.

in case of a data array:

[0,1,2,3,...n] -> [f(0),f(1)...f(n)]

the inversion allows to derive the index i from the result of f(i).
(using linear interpolation for noninteger values). This method assumes accumulative probabilities:
http://www.math.niu.edu/~rusin/known-math/95/random.distr


there ia an updated version on the swiki, with an example that allows you to check with a histogram in howfar the distribution works.

ttp://swiki.hfbk-hamburg.de:8888/MusicTechnology/709
--








.