Sets a (discrete) random variable to the internal table of random variables.
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.That is, within this class we will allow a number of random variables to be set and stored within an internal table where each ``row'' corresponds to a (discrete) random variable. These ``rows'' with the table adjoined to the table using this method or inserted at an arbitrary row using (int, double[], double[]).
To add the following random variable: f(0) = 5
, f(1) = 3
,
f(2) = 5
; to the internal table (or collection) of random variables. We
would first need to identify that there are two possible outcomes of the experiment namely
3
and 5
, with 1
and 2
occurrences
respectively. then we would call this method with the parameters: id = {3, 5}
,
occurrences = {1, 2}
(i.e. one 3
and two 5
's occur
during the experiment.
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