[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Generating random values having the probability density function
Hi
I'm a student doing my Master Thesis. I need to implement a function which
calculates (actually generates random value of I/S values given its
probability density function, f(x). How should the algorithm look like?
Can any one help me with checking my thoughts below?
I/S-values which is continuously distributed: f(x). It depends On N, number
of users in our system which can take discrete values. We must know the
typical values for I/S (we call it stochastic variable 'u').
f(x) means actually P(u=x), where x is an actual concrete value from the
values which the stochastic var u can take.
Then by assuming N form MIN to MAX (e.g.-1000) we can calculate
1. probabilities f1, f2,... fmax and store them in an array: P.
2. I/S values (i.e. concrete u's- u1..umax corresponding to
probabilities) and store them in array U.
The first question is which u's can we take? (Note that u is takes continuos
values)
Then second question is that we need to use random I/S- values from (U), but
according to their probabilities from P; How can it be done?
The main question is: Is the whole idea reasonable?
regards
// Kejvan
Chalmers University of Technology, Sweden