Programmer Guide/Command Reference/EVAL/median: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 2: Line 2:
Compute median or quantiles of a vector ''x''.
Compute median or quantiles of a vector ''x''.


The quantile '''q<sub>p</sub>''' can be defined as the propability '''p''' of: <code>an element of x is lower than '''q<sub>p</sub>'''</code>. The value p must be in the range 0 to 1. The special quantile q<sub>0.5</sub> is also called '''median'''.
The quantile '''q<sub>p</sub>''' can be defined as the probability '''p''' of: <code>an element of x is lower than '''q<sub>p</sub>'''</code>. The value '''p''' must be in the range 0 to 1. The special quantile q<sub>0.5</sub> is also called '''median'''.
 
----
;Usage 1: '''<code>median(''x''<sub>vector</sub> {, ''p''<sub>scalar</sub> })'''
;''x'': data vector
;''p'': the propability; 0 < ''p'' < 1 (default=0.5)
;Result 1: Returns the ''p''-quantile (scalar) of ''x''.
----
;Usage 2: '''<code>median(''x''<sub>vector</sub> , ''p''<sub>vector</sub> })'''
;''x'': data vector
;''p'': vector with propability values
;Result 1: Returns a vector containing the quantiles for all probabilities p[i].
 
;See also: [[Programmer_Guide/Command_Reference/EVAL/avr|avr]], [[Programmer_Guide/Command_Reference/EVAL/sort|sort]], [[Programmer_Guide/Command_Reference/EVAL/hist|hist]]
 
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Revision as of 16:41, 8 April 2011

Compute median or quantiles of a vector x.

The quantile qp can be defined as the probability p of: an element of x is lower than qp. The value p must be in the range 0 to 1. The special quantile q0.5 is also called median.


Usage 1
median(xvector {, pscalar })
x
data vector
p
the propability; 0 < p < 1 (default=0.5)
Result 1
Returns the p-quantile (scalar) of x.

Usage 2
median(xvector , pvector })
x
data vector
p
vector with propability values
Result 1
Returns a vector containing the quantiles for all probabilities p[i].
See also
avr, sort, hist

<function list>

Navigation menu

Personal tools