Inserts a new (discrete) random variable into the internal random variable table at the index
th position.
i
-th term of this array is the number of occurrences in which the experiment takes the value of the i
-th term of the values
array during the cause of the experiment.The table containing the random variables contains ``rows'' which correspond to each of the random variables. Now a random variable can be inserted into an arbitrary location of this table using this method or can be adjoined using the method AddRandomVariable.
Say for example we have already set an internal table of 5
random
variables by calling the method AddRandomVariable,
and we wish to add another random variable to the table within the 3
-rd
position. Moreover, we wish to set a random variable R
, given by:
R(1) = 5
, i.e. the outcome of 1
, occurs 5
times during the experiment.
R(2) = 3
, i.e. the outcome of 2
, occurs 3
times during the experiment.
In order to set this random variable within the table of random variables you
will need to pass the following parameters: 3
for the index to specify
the position within the table in which the random variables should be added,
{1,2}
to specify the possible values of the outcomes of the experiments
and {5,3}
, to specify the number of occurrences in which these outcomes
occur during the experiment considered.
Note that though there is always an integer number of possible outcomes of the experiment which the random variable describes, it is important that the absolute values associated with these events is recorded. Since otherwise the information allowing the evaluation, for example of the mean and variance of the random variable will be lost.
RandomVariables Class | WebCab.Libraries.Statistics.DiscretePrb Namespace