Command:
addFacDisc ( |
|
What:
Adds a new factor with a discrete distribution
to the configuration to be
used for the sample generation
Parameters:
name [char*] |
defines
the factor's name. It must begin with a letter and can contain only
letters and numbers, this parameter cannot be null! |
numIntervals [long] |
number
of discrete values that the discrete distribution can assume, it must
correspond to the number of rows of the intervals matrix |
intervals [matrix of double precision #] |
each row of the matrix contains the focal point and the probability value associated with |
note [char*] |
the
factor note is optional in Matlab |
Return:
error_code [int]: 1 if the operation has occurred without errors, 0 if an error has occurred
Examples:
addFacDisc('fac1',3,[ 1,0.4; 2,0.3; 3,0.3 ],'notefac1')
this command adds a new factor called fac1 with a discrete distribution, the factor can assume 3 values: 1, 2 and 3 respectively with probability 0.4, 0.3 and 0.3
About the
distribution:
The density function of
the Discrete distribution has the following expression:
Weighti is the weight of point i, the sum of all the weights must be equal to 1.
mean value: standard deviation:
mean value: standard deviation: