QuartileDeviation

QuartileDeviation[data]

gives the quartile deviation or semi-interquartile range of the elements in data.

QuartileDeviation[data,{{a,b},{c,d}}]

uses the quantile definition specified by parameters a, b, c, d.

QuartileDeviation[dist]

gives the quartile deviation or semi-interquartile range of the distribution dist.

Details

  • QuartileDeviation is a robust measure of dispersion, which means it is not very sensitive to outliers.
  • QuartileDeviation[data] is given by , where is given by Quartiles[data]. »
  • For MatrixQ data, quartile deviation is computed for each column vector with QuartileDeviation[{{x1,y1,},{x2,y2,},}] equivalent to {QuartileDeviation[{x1,x2,}],QuartileDeviation[{y1,y2,}]}. »
  • For ArrayQ data, quartile deviation is equivalent to ArrayReduce[QuartileDeviation,data,1]. »
  • QuartileDeviation[data,{{a,b},{c,d}}] uses computed as Quartiles[data, {{a,b},{c,d}}]. »
  • Common choices of parameters {{a,b},{c,d}} include:
  • {{0,0},{1,0}}inverse empirical CDF
    {{0,0},{0,1}}linear interpolation (California method)
    {{1/2,0},{0,0}}element numbered closest to p n
    {{1/2,0},{0,1}}linear interpolation (hydrologist method; default)
    {{0,1},{0,1}}meanbased estimate (Weibull method)
    {{1,-1},{0,1}}modebased estimate
    {{1/3,1/3},{0,1}}medianbased estimate
    {{3/8,1/4},{0,1}}normal distribution estimate
  • The default choice of parameters is {{1/2,0},{0,1}}. »
  • The data can have the following additional forms and interpretations:
  • Associationthe values (the keys are ignored) »
    SparseArrayas an array, equivalent to Normal[data] »
    QuantityArrayquantities as an array »
    WeightedDatabased on the underlying EmpiricalDistribution »
    EventDatabased on the underlying SurvivalDistribution »
    TimeSeries, TemporalData, vector or array of values (the time stamps ignored) »
    Image,Image3DRGB channel's values or grayscale intensity value »
    Audioamplitude values of all channels »
  • QuartileDeviation[dist] is given by InterquartileRange[dist]/2. »
  • For a random process proc, the quartile deviation function can be computed for slice distribution at time t, SliceDistribution[proc,t], as q^D[t]=QuartileDeviation[SliceDistribution[proc,t]]. »

Examples

open allclose all

Basic Examples  (2)

Quartile deviation for a list of exact numbers:

Quartile deviation of a parametric distribution:

Scope  (18)

Basic Uses  (8)

Exact input yields exact output:

Approximate input yields approximate output:

Compute results using other parametrizations:

Find the quartile deviation for WeightedData:

Find the quartile deviation for EventData:

Find the quartile deviation for TemporalData:

Find the quartile deviation for TimeSeries:

The quartile deviation depends only on the values:

Find the quartile deviation for data involving quantities:

Array Data  (5)

QuartileDeviation for a matrix gives columnwise ranges:

Quartile deviation for a tensor works across the first index:

Works with large arrays:

When the input is an Association, QuartileDeviation works on its values:

SparseArray data can be used just like dense arrays:

Find the quartile deviation of a QuantityArray:

Image and Audio Data  (2)

Channelwise quartile deviation value of an RGB image:

Quartile deviation intensity value of a grayscale image:

Quartile deviation amplitude of all amplitude values of all channels:

Distributions and Processes  (3)

Find the quartile deviation for a parametric distribution:

Quartile deviation for a derived distribution:

Data distribution:

Quartile deviation for a time slice of a random process:

Applications  (4)

Obtain a robust estimate of dispersion when extreme values are present:

Measures based on the Mean are heavily influenced by extreme values:

Identify periods of high volatility in stock data using a five-year moving quartile deviation:

Compute QuartileDeviation for slices of a collection of paths of a random process:

Choose a few slice times:

Plot of the quartile deviations for the selected times:

Find the quartile deviation of the heights for the children in a class:

Plot the quartile deviation respective of the median:

Properties & Relations  (3)

QuartileDeviation is half the difference of linearly interpolated Quantile values:

QuartileDeviation is half the difference between the first and third quartiles:

InterquartileRange is twice QuartileDeviation:

Also true for a distribution:

Possible Issues  (2)

QuartileDeviation requires numeric values in data:

The symbolic closed form may exist for some distributions:

QuartileDeviation is not the difference between the median and the first or the third quantiles:

The difference between the third and the first quantiles is given by InterquartileRange:

Neat Examples  (1)

The distribution of QuartileDeviation estimates for 20, 100 and 300 samples:

Wolfram Research (2007), QuartileDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/QuartileDeviation.html (updated 2023).

Text

Wolfram Research (2007), QuartileDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/QuartileDeviation.html (updated 2023).

CMS

Wolfram Language. 2007. "QuartileDeviation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/QuartileDeviation.html.

APA

Wolfram Language. (2007). QuartileDeviation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuartileDeviation.html

BibTeX

@misc{reference.wolfram_2023_quartiledeviation, author="Wolfram Research", title="{QuartileDeviation}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/QuartileDeviation.html}", note=[Accessed: 04-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_quartiledeviation, organization={Wolfram Research}, title={QuartileDeviation}, year={2023}, url={https://reference.wolfram.com/language/ref/QuartileDeviation.html}, note=[Accessed: 04-March-2024 ]}