WebCab Probability and Statistics Web Services for .NET v3.3 Demo

RandomVariables.AddRandomVariable Method 

Sets a (discrete) random variable to the internal table of random variables.

public void AddRandomVariable(
   double[] values,
   int[] occurrences
);

Parameters

values
This is an array of doubles where each double corresponds to a value of an outcome recorded of the experiment considered.
occurrences
The 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.

Remarks

That is, within this XML Web service 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[]).

Example

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.

Recording the Values of the Random Variable

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.

See Also

RandomVariables Class | DiscreteProbability Namespace