OpenMath Content Dictionary: s_data1

Canonical URL:
http://www.openmath.org/cd/s_data1.ocd
CD File:
s_data1.ocd
CD as XML Encoded OpenMath:
s_data1.omcd
Defines:
mean, median, mode, moment, sdev, variance
Date:
2001-03-12
Version:
2
Review Date:
2003-04-01
Status:
official
Uses CD:
relation1, fns2, arith1, set1, arith1, list1, set1, alg1, fns1

This CD holds the definitions of the basic statistical functions used on sample data. It is intended to be `compatible' with the MathML elements representing statistical functions, though it does not cover the concept of random variable which is mentioned in MathML.


mean

This symbol represents an n-ary function denoting the mean of its arguments. That is, their sum divided by their number.

Commented Mathematical property (CMP):
The mean of n arguments is their sum divided by their number
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="fns2" name="apply_to_list"/>
      <OMS cd="s_data1" name="mean"/>
      <OMV name="L"/>
    </OMA>
    <OMA>
      <OMS cd="arith1" name="divide"/>
      <OMA>
        <OMS cd="fns2" name="apply_to_list"/>
	<OMS cd="arith1" name="plus"/>
	<OMV name="L"/>
      </OMA>
      <OMA>
        <OMS cd="set1" name="size"/>
	<OMV name="L"/>
      </OMA>
    </OMA>
  </OMA>
</OMOBJ>

eq (apply_to_list (mean, L) , divide (apply_to_list (plus, L) , size ( L) ) )

Example:
The mean of {1,2,3} is 3
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="s_data1" name="mean"/>
      <OMI> 1 </OMI> <OMI> 2 </OMI> <OMI> 3 </OMI>
    </OMA>
    <OMI> 3 </OMI>
  </OMA>
</OMOBJ>

eq (mean ( 1 , 2 , 3 ) , 3 )

Signatures:
sts


[Next: sdev] [Last: moment] [Top]

sdev

This symbol represents a function requiring two or more arguments, denoting the sample standard deviation of its arguments. That is, the square root of (the sum of the squares of the deviations from the mean of the arguments, divided by the number of arguments). See CRC Standard Mathematical Tables and Formulae, editor: Dan Zwillinger, CRC Press Inc., 1996, (7.7.11) section 7.7.1.

Commented Mathematical property (CMP):
The square of the standard deviation of n arguments is the sum of the squares of the differences from their mean divided by the number of arguments.
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="arith1" name="power"/>
      <OMA>
        <OMS cd="fns2" name="apply_to_list"/>
	<OMA>
	  <OMS cd="s_data1" name="sdev"/>
	  <OMV name="L"/>
	</OMA>
      </OMA>
      <OMI> 2 </OMI>
    </OMA>
    <OMA>
      <OMS cd="arith1" name="divide"/>
      <OMA>
        <OMS cd="fns2" name="apply_to_list"/>
	<OMS cd="arith1" name="plus"/>
	<OMA>
	  <OMS cd="list1" name="map"/>
	  <OMBIND>
	    <OMS cd="fns1" name="lambda"/>
	    <OMBVAR>
	      <OMV name="x"/>
	    </OMBVAR>
	    <OMA>
	      <OMS cd="arith1" name="power"/>
	      <OMA>
	        <OMS cd="arith1" name="minus"/>
		<OMV name="x"/>
		<OMA>
		  <OMS cd="s_data1" name="mean"/>
		  <OMV name="L"/>
		</OMA>
	      </OMA>
	      <OMI> 2 </OMI>
	    </OMA>
	  </OMBIND>
	  <OMV name="L"/>
	</OMA>
      </OMA>
      <OMA>
        <OMS cd="set1" name="size"/>
	<OMA>
	  <OMS cd="fns2" name="apply_to_list"/>
	  <OMS cd="set1" name="set"/>
	  <OMV name="L"/>
	</OMA>
      </OMA>
    </OMA>
  </OMA>
</OMOBJ>

eq (power (apply_to_list (sdev ( L) ) , 2 ) , divide (apply_to_list (plus, map (lambda [ x ] . (power (minus ( x, mean ( L) ) , 2 ) ) , L) ) , size (apply_to_list (set, L) ) ) )

Example:
This is an example to denote the standard deviation of a set of data
<OMOBJ>
  <OMA>
    <OMS cd="s_data1" name="sdev"/>
    <OMF dec="3.1"/> <OMF dec="2.2"/> <OMF dec="1.8"/> <OMF dec="1.1"/>
    <OMF dec="3.3"/> <OMF dec="2.4"/> <OMF dec="5.5"/> <OMF dec="2.3"/>
    <OMF dec="1.7"/> <OMF dec="1.8"/> <OMF dec="3.4"/> <OMF dec="4.0"/>
    <OMF dec="3.3"/>
  </OMA>
</OMOBJ>

sdev ( 3.1 , 2.2 , 1.8 , 1.1 , 3.3 , 2.4 , 5.5 , 2.3 , 1.7 , 1.8 , 3.4 , 4.0 , 3.3 )

Signatures:
sts


[Next: variance] [Previous: mean] [Top]

variance

This symbol represents a function requiring two or more arguments, denoting the variance of its arguments. That is, the square of the standard deviation.

Commented Mathematical property (CMP):
The variance of n arguments is the square of the standard deviation of those arguments.
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="fns2" name="apply_to_list"/>
      <OMA>
        <OMS cd="s_data1" name="variance"/>
	<OMV name="L"/>
      </OMA>
    </OMA>
    <OMA>
      <OMS cd="arith1" name="power"/>
      <OMA>
        <OMS cd="fns2" name="apply_to_list"/>
	<OMA>
	  <OMS cd="s_data1" name="sdev"/>
	  <OMV name="L"/>
	</OMA>
      </OMA>
      <OMI> 2 </OMI>
    </OMA>
  </OMA>
</OMOBJ>

eq (apply_to_list (variance ( L) ) , power (apply_to_list (sdev ( L) ) , 2 ) )

Example:
This is an example to denote the variance of a set of data
<OMOBJ>
  <OMA>
    <OMS cd="s_data1" name="variance"/>
    <OMF dec="3.1"/> <OMF dec="2.2"/> <OMF dec="1.8"/> <OMF dec="1.1"/>
    <OMF dec="3.3"/> <OMF dec="2.4"/> <OMF dec="5.5"/> <OMF dec="2.3"/>
    <OMF dec="1.7"/> <OMF dec="1.8"/> <OMF dec="3.4"/> <OMF dec="4.0"/>
    <OMF dec="3.3"/>
  </OMA>
</OMOBJ>

variance ( 3.1 , 2.2 , 1.8 , 1.1 , 3.3 , 2.4 , 5.5 , 2.3 , 1.7 , 1.8 , 3.4 , 4.0 , 3.3 )

Signatures:
sts


[Next: mode] [Previous: sdev] [Top]

mode

This symbol represents an n-ary function denoting the mode of its arguments. That is the value which occurs with the greatest frequency.

Commented Mathematical property (CMP):
The mode of n arguments is that value which occurs with the greatest frequency.
Example:
The mode of {1,1,2} is 1
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="s_data1" name="mode"/>
      <OMI> 1 </OMI> <OMI> 1 </OMI> <OMI> 2 </OMI>
    </OMA>
    <OMI> 1 </OMI>
  </OMA>
</OMOBJ>

eq (mode ( 1 , 1 , 2 ) , 1 )

Signatures:
sts


[Next: median] [Previous: variance] [Top]

median

This symbol represents an n-ary function denoting the median of its arguments. That is, if the data were placed in ascending order then it denotes the middle one (in the case of an odd amount of data) or the average of the middle two (in the case of an even amount of data).

Example:
The median of {1,2,3} is 2
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="s_data1" name="median"/>
      <OMI> 1 </OMI> <OMI> 2 </OMI> <OMI> 3 </OMI>
    </OMA>
    <OMI> 2 </OMI>
  </OMA>
</OMOBJ>

eq (median ( 1 , 2 , 3 ) , 2 )

Signatures:
sts


[Next: moment] [Previous: mode] [Top]

moment

This symbol is used to denote the i'th moment of a set of data. The first argument should be the degree of the moment (that is, for the i'th moment the first argument should be i), the second argument should be the point about which the moment is being taken and the rest of the arguments are treated as the data. For n data values x_1, x_2, ..., x_n the i'th moment about c is (1/n) ((x_1-c)^i + (x_2-c)^i + ... + (x_n-c)^i). See CRC Standard Mathematical Tables and Formulae, editor: Dan Zwillinger, CRC Press Inc., 1996, section 7.7.1.

Example:
This is an example to denote the 2'nd moment of a set of data about the origin.
<OMOBJ>
  <OMA>
    <OMS cd="s_data1" name="moment"/>
    <OMI> 2 </OMI>
    <OMS cd="alg1" name="zero"/>
    <OMF dec="3.1"/> <OMF dec="2.2"/> <OMF dec="1.8"/> <OMF dec="1.1"/>
    <OMF dec="3.3"/> <OMF dec="2.4"/> <OMF dec="5.5"/> <OMF dec="2.3"/>
    <OMF dec="1.7"/> <OMF dec="1.8"/> <OMF dec="3.4"/> <OMF dec="4.0"/>
    <OMF dec="3.3"/>
  </OMA>
</OMOBJ>

moment ( 2 , zero, 3.1 , 2.2 , 1.8 , 1.1 , 3.3 , 2.4 , 5.5 , 2.3 , 1.7 , 1.8 , 3.4 , 4.0 , 3.3 )

Signatures:
sts


[First: mean] [Previous: median] [Top]