Evaluation modes
(in progress)
Every validly defined variable or expression, x, in Analytica has a Mid value , also known as its "deterministic" value. Analytica computes the Mid value by fixing any probability distribution in the definition of x, and in any of its predecessor variables, at its Mid values, usually the median of the distribution. The Mid value provides fast evaluation, ignoring any uncertainties. Any probability distribution returns a single value, usually the median, when evaluated in Mid mode. (A multivariate distribution returns an array of Mid values.)
Any variable or expression that contains a probability distribution, or that has one or more predecessor variables containing a probability distribution, also has a Prob value, also known as a probabilistic or sample value. The Prob value is a random sample from the probability distribution for the variable. The sample is indexed by the system index Run -- numbered from 1 to Samplesize. Samplesize is the number of samples set in the Uncertainty dialog box (available from Result menu).
You control the evaluation mode when viewing a Result -- Table or Graph -- by selecting the Uncertainty view: If you select Mid, it will evaluate the variable (and any of its predecessors if necessary) in Mid mode, and display the Mid value of the result. If you select another Uncertainty view (Mean, Stats, Bands, PDF or Prob Mass, CDF or Cum Prob, or Sample), it will try to evaluate the variable, and its predecessors, in Prob mode. If it can, it will display the resulting uncertain quantity using the uncertainty view you selected. If neither the variable nor its predecessors contain any probability distribution, it will not have a Prob value. In this case, Analytica will give you a warning message, and show the Mid result.
There are some subtleties to these two evalation modes, Mid and Prob: Any statistical Function -- such as Mean, Sdeviation, Correlation -- will usually evaluate its parameter(s), and any predecessors, in Prob mode, even if it appears in an expression being evaluated in Mid mode. A statistical function estimates its value from a Prob value (or two Prob values, in the case of Correlation, and related functions). If you define
X := Mean(Y) Y := Normal(2, 1)
If you evaluate x in Mid mode, the statistical function Mean(y) will evaluate y in Prob mode. So, the Mid value of x will be an estimate of the mean of y, based on a Monte Carlo sample which is the Prob value of Y. Thus, evaluating any variable containing a statistical function will cause a Prob mode evaluation of any variable appearing in its parameter(s), or predecessors of those variables. The result of a statistical function is a Mid value, not a probability distribution. In the example above, X has a Mid value, equal to the mean of Y, but no Prob value.
Conversely, the function Mid(X) always evaluates its parameter X in Mid mode, even when Mid(X) is evaluated in Prob mode. For example
X := Mid(Y) Y := Uniform(10, 20)
In this case, evaluating X, causes Y to be evaluated in Mid mode, returning the median of y (15).
A is a function that returns a median value when evaluated in Mid-mode, and a sample array indexed by the Run Index when evaluated in Sample-mode.
Enable comment auto-refresher