Difference between revisions of "Mid"

Line 1: Line 1:
 
[[category:Evaluation Functions]]
 
[[category:Evaluation Functions]]
 
[[category:Statistical Functions]]
 
[[category:Statistical Functions]]
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
  
==Mid(X)==
+
==Mid(x)==
Evaluates «X» in [[Evaluation Modes|Mid-Mode]].
+
Evaluates «x» in [[Evaluation Modes|Mid-Mode]].
 +
 
 +
Whenever an expression or subexpression is evaluated, it is evaluated either in ''Mid-mode'' or ''Sample-mode'', in which sample-mode carries through information about uncertainty whereas mid-mode does not. The article on [[Evaluation Modes]] explains this in detail. <code>[[Mid]](x)</code> forces the evaluation of «x» to occur in Mid-mode even when the current evaluation mode is sample-mode.
 +
 
 +
The <code>[[Sample]](x)</code> function does the opposite -- forcing «x» to be evaluated in sample mode.
 +
 
 +
Distribution functions return their median value in Mid-mode, or a Monte Carlo when evaluated in Sample-mode.
 +
 
 +
<code>[[Mid]](x)</code> is also used as an ''meta-expression'' in a [[MultiTable]] to show the computed value of «x».
 +
 
 +
== Examples ==
 +
 
 +
Suppose <code>x := Uniform(1,1)^2</code>
 +
:<code>[[Mid]](x) &rarr; 0</code>
 +
:<code>[[Median]](x) &rarr; 0.25</code>
 +
:<code>[[Mean]](x) &rarr; 0.3333</code>
 +
When [[Mid]] is evaluated, the median value of <code>Uniform(-1,1)</code> is used, which is 0. As seen, this is not equivalent to the median of «x» when uncertainty is properly accounted for.
  
 
== See Also ==
 
== See Also ==

Revision as of 00:45, 25 March 2016


Mid(x)

Evaluates «x» in Mid-Mode.

Whenever an expression or subexpression is evaluated, it is evaluated either in Mid-mode or Sample-mode, in which sample-mode carries through information about uncertainty whereas mid-mode does not. The article on Evaluation Modes explains this in detail. Mid(x) forces the evaluation of «x» to occur in Mid-mode even when the current evaluation mode is sample-mode.

The Sample(x) function does the opposite -- forcing «x» to be evaluated in sample mode.

Distribution functions return their median value in Mid-mode, or a Monte Carlo when evaluated in Sample-mode.

Mid(x) is also used as an meta-expression in a MultiTable to show the computed value of «x».

Examples

Suppose x := Uniform(1,1)^2

Mid(x) → 0
Median(x) → 0.25
Mean(x) → 0.3333

When Mid is evaluated, the median value of Uniform(-1,1) is used, which is 0. As seen, this is not equivalent to the median of «x» when uncertainty is properly accounted for.

See Also

Comments


You are not allowed to post comments.