<< NARVAL_F_RVector NARVAL NARVAL_F_RandWtRepl >>

NARVAL >> NARVAL > NARVAL_F_RandDist

NARVAL_F_RandDist

Generate a random value in respect with a given distribution.

Calling Sequence

[n] = NARVAL_F_RandDist(i,v)

Parameters

i :

vector of values.

v :

vector of their occurence probability.

n :

random value.

Description

NARVAL_F_RandDist generates a random value n in respect with a given distribution v connected to a range of values i.

Examples

i=[1 2 3 4 5];//values
v=[4 7 8 19 3];//occurrence vector
//probabilities
//sum(v)=41 --> 100/100
//i=1 --> 4/41
//i=2 --> 7/41
//i=3 --> 8/41
//i=4 --> 19/41
//i=5 --> 3/41
[n]=NARVAL_F_RandDist(i,v);//application of NARVAL_F_RandDist
n

Authors

Foued Melakessou

Contact

Dr. Foued Melakessou

Research Associate

Interdisciplinary Centre for Security, Reliability and Trust

Room F106

University of Luxembourg

6, rue Coudenhove Kalergi

L-1359 Luxembourg-Kirchberg

E-mail: foued.melakessou@uni.lu

Tel: (+352) 46 66 44 5346

Home Page


<< NARVAL_F_RVector NARVAL NARVAL_F_RandWtRepl >>