Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Median
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Derivation of the asymptotic distribution ==== {{unsourced section|date=November 2023}} We take the sample size to be an odd number <math> N = 2n + 1 </math> and assume our variable continuous; the formula for the case of discrete variables is given below in {{slink||Empirical local density}}. The sample can be summarized as "below median", "at median", and "above median", which corresponds to a trinomial distribution with probabilities <math> F(v) </math>, <math> f(v) </math> and <math> 1 - F(v) </math>. For a continuous variable, the probability of multiple sample values being exactly equal to the median is 0, so one can calculate the density of at the point <math> v </math> directly from the trinomial distribution: <math display="block"> \Pr[\operatorname{med}=v] \, dv = \frac{(2n+1)!}{n!n!} F(v)^n (1 - F(v))^n f(v)\, dv.</math> Now we introduce the beta function. For integer arguments <math> \alpha </math> and <math> \beta </math>, this can be expressed as <math> \Beta(\alpha,\beta) = \frac{(\alpha - 1)! (\beta - 1)!}{(\alpha + \beta - 1)!} </math>. Also, recall that <math> f(v)\,dv = dF(v) </math>. Using these relationships and setting both <math> \alpha </math> and <math> \beta </math> equal to <math>n+1</math> allows the last expression to be written as <math display="block"> \frac{F(v)^n(1 - F(v))^n}{\Beta(n+1,n+1)} \, dF(v) </math> Hence the density function of the median is a symmetric beta distribution [[pushforward measure|pushed forward]] by <math>F</math>. Its mean, as we would expect, is 0.5 and its variance is <math> 1/(4(N+2)) </math>. By the [[chain rule]], the corresponding variance of the sample median is <math display="block">\frac{ 1 }{ 4(N + 2) f(m)^2 }.</math> The additional 2 is negligible [[limit (mathematics)|in the limit]]. =====Empirical local density===== In practice, the functions <math> f </math> and <math> F </math> above are often not known or assumed. However, they can be estimated from an observed frequency distribution. In this section, we give an example. Consider the following table, representing a sample of 3,800 (discrete-valued) observations: {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;" ! {{mvar|v}} !! 0 !! 0.5 !! 1 !! 1.5 !! 2 !! 2.5 !! 3 !! 3.5 !! 4 !! 4.5 !! 5 |- ! {{math|''f''(''v'')}} | 0.000 || 0.008 || 0.010 || 0.013 || 0.083 || 0.108 || 0.328 || 0.220 || 0.202 || 0.023 || 0.005 |- ! {{math|''F''(''v'')}} | 0.000 || 0.008 || 0.018 || 0.031 || 0.114 || 0.222 || 0.550 || 0.770 || 0.972 || 0.995 || 1.000 |} Because the observations are discrete-valued, constructing the exact distribution of the median is not an immediate translation of the above expression for <math> \Pr(\operatorname{med} = v) </math>; one may (and typically does) have multiple instances of the median in one's sample. So we must sum over all these possibilities: <math display="block"> \Pr(\operatorname{med} = v) = \sum_{i=0}^n \sum_{k=0}^n \frac{N!}{i!(N-i-k)!k!} F(v-1)^i(1 - F(v))^kf(v)^{N-i-k} </math> Here, ''i'' is the number of points strictly less than the median and ''k'' the number strictly greater. Using these preliminaries, it is possible to investigate the effect of sample size on the standard errors of the mean and median. The observed mean is 3.16, the observed raw median is 3 and the observed interpolated median is 3.174. The following table gives some comparison statistics. {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;" ! {{Diagonal split header|Statistic|Sample size}} !! 3 !! 9 !! 15 !! 21 |- ! Expected value of median | 3.198 || 3.191 || 3.174 || 3.161 |- ! Standard error of median (above formula) | 0.482 || 0.305 || 0.257 || 0.239 |- ! Standard error of median (asymptotic approximation) | 0.879 || 0.508 || 0.393 || 0.332 |- ! Standard error of mean | 0.421 || 0.243 || 0.188 || 0.159 |} The expected value of the median falls slightly as sample size increases while, as would be expected, the standard errors of both the median and the mean are proportionate to the inverse square root of the sample size. The asymptotic approximation errs on the side of caution by overestimating the standard error.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Median
(section)
Add topic