SlideShare a Scribd company logo
Proofs of some elementary facts on the weighted
nearest rank
Vasilis. Anagnostopoulos
April 20, 2021
Abstract
In this note we prove two remarkable properties of the nearest rank
when weights are employed. We use elementary properties to provide
proofs and show that nearest rank is competitive to other percentile
methods in simplicity. The properties also prove its consistency both
when the weights are integral or not. It supports the material presented
in a article about weighted medians in medium.
As explained in The nearest rank method, nearest rank is a good com-
promise in finding the percentile and asymptotically they are the same. The
definition also extends naturally for the weighted case we are interested in.
To this end, lets craft a ”math friendly definition” that will be convenient
enough to help us prove theorems. Suppose we are given a series of weighted
values, say {(x1, w1), . . . , (xm, wm)}. Since this series could model prices
(x) and quantities (w) it is natural to assume that the weights are positive.
Also we make the assumption that the series is sorted in increasing prices
so that cumulative distribution function can be defined. To summarize, the
constraints on this series take the form:
wi ≥ 0 ∀i (1)
wi ≥ wi−1 ∀i ≥ 1 (2)
Now we are ready to give the definitions.
Definition 0.1 (Nearest Rank). We define the weighted q-nearest rank
index as
mq = min{i :
Pi
j=1 wj
Pm
j=1 wj
≥ q} (3)
and the weighted q-nearest rank is
xmq . (4)
1
Remark. It is an easy task to prove that the definition given here and the
one in Wikipedia are equivalent. Just match the definitions for the case
where wi = 1 ∀i.
We will find out that these definitions, even though they deviate some-
how from the common median (q-percentile), they satisfy some very desir-
able properties.
1 The invariant property of nearest rank for inte-
gral weights
In this section we prove the first interesting property of nearest rank. If the
weights are integral and we ”explode” the sequence then, the nearest rank
calculated by definition 0.1 is the same whether we apply it on the original
or the exploded sequence. Consider as above a sequence of integral weighted
samples satisfying (1) and (2). Its exploded version is just the same sequence
with every value appearing as many times as its weight. In other words we
replace this sequence
{(x1, w1), (x2, w2), . . . , (xm, wm)} (5)
with
{(x1, 1), . . . , (x1, 1)
| {z }
w1
, (x2, 1), . . . , (x2, 1)
| {z }
w2
, . . . , (xm, 1), . . . , (xm, 1)
| {z }
wm
} (6)
or equivalently
{x1, . . . , x1
| {z }
w1
, x2, . . . , x2
| {z }
w2
, . . . , xm, . . . , xm
| {z }
wm
} (7)
The ”conditions” (1) and (2) are satisfied for the exploded sequence too.
Theorem 1.1. Exploded and unexploded sequences have the same nearest
rank.
Proof. Smart counting is at the core of this theorem. Suppose the calculation
on the ”exploded sequence gives an index nq. Suppose that the x value at
this position, has index m0
q in the 1, . . . , m interval. What we are trying to
prove is that
m0
q = mq. (8)
Please, take your time to understand why. Now, by definition for the
exploded sequence
2
Pnq
j=1 1
Pm
j=1 wj
≥ q (9)
and consequently
Pm0
q
j=1 wj
Pm
j=1 wj
≥ q ⇒ m0
q ≥ mq (10)
by the minimality of mq. On the other hand, again by definition of the
exploded sequence, the condition
Pmq
j=1 wj
Pm
j=1 wj
≥ q (11)
implies
nq
X
j=1
1 ≤
mq
X
j=1
wj. (12)
As a matter of fact we have the margin to increase nq until we change
x. This means
m0
q ≤ mq (13)
and the theorem is proved.
2 Nearest rank is accessible through samples
While the previous theorem was more or less expected the next property is
unexpected and makes it super useful for non-integral weights. Suppose we
would like to find the nearest rank of the following sequence satisfying (1)
and (2)
{(x1, w1), (x2, w2), . . . , (xm, wm)} (14)
with nearest rank xmq . We add just another constraint now. the weights
are positive probabilities. The weights now, sum to 1
m
X
i=1
wi = 1 (15)
Suppose now we create another sequence
{(x1, w0
1), (x2, w0
2), . . . , (xm, w0
m)} (16)
3
with weights
w0
i = [Nwi]. (17)
In the equation above the reader can identify [.] as the integer part. The
hope is that in the limit of infinite N the previous theorem applies.
By the properties of the integer part
[x] ≤ x < [x] + 1 (18)
and consequently (as the original weights sum to 1)
N − m <
m
X
i=1
[Nwi] ≤ N.
The new weights now do not sum to N, possibly something less but the
error is bounded by m. In order to correct this shortcoming we add 1’s
to the first w0
i until we get to N. This amounts to selecting a decreasing
sequence of 0/1 numbers, say ki such that
w00
i = [Nwi] + ki. (19)
sums to N. Let the nearest rank of this sequence with weights w00 be
xm(N,q) .
We also need a very technical assumption that will help convergence.
Definition 2.1 (Admissible q). We say that q is admissible for the weights
when
q 6=
k
X
i=1
wi for all k. (20)
We can state our theorem.
Theorem 2.1. Non integral nearest rank is accessible through integral com-
putations when weights are probabilities and the q is admissible for them.
In other words
lim
N→∞
xm(N,q)
N
= xmq (21)
Proof. Smart counting is crucial here too. We also make use of 18.
By definition
4
mq
X
i=1
wi ≥ q ⇒ (22)
mq
X
i=1
(1 + [Nwi]) ≥ Nq ⇒ (23)
m +
mq
X
i=1
(ki + [Nwi]) ≥ Nq ⇒ (24)
Pmq
i=1 w00
i
Pm
i=1 w00
i
≥ q −
m
N
. (25)
In a similar way,
Pm(N,q)
i=1 w00
i
Pm
i=1 w00
i
≥ q ⇒ (26)
m(N,q)
X
i=1
(ki + [Nwi]) ≥ Nq ⇒ (27)
m +
m(N,q)
X
i=1
Nwi ≥ Nq ⇒ (28)
m(N,q)
X
i=1
wi ≥ q −
m
N
. (29)
We cannot have an infinite N such that m(N, q) < mq. This can be see
from 27 because then
mq−1
X
i=1
wi ≥
m(N,q)
X
i=1
wi ≥ q −
m
N
. (30)
By taking the limits
mq−1
X
i=1
wi ≥ q (31)
which contradicts the minimality of mq. Consequently from a N0 on-
wards
m(N, q) ≥ mq. (32)
Also we can see from 23 that
5
m(N, q) > mq + 1. (33)
cannot happen for infinite N . So, from a N0 onwards
either m(N, q) = mq or m(N, q) = mq + 1. (34)
This is where admissibility comes into play. Suppose that m(N, q) =
mq + 1, again for infinite N. By the minimality of m(N, q) and 23 we have
q −
m
N
≤
Pmq)
i=1 w00
i
Pm
i=1 w00
i
< q. (35)
By taking the limits
Pmq)
i=1 w00
i
Pm
i=1 w00
i
= q (36)
which contradicts the admissibility.
The technical assumption come into play in order to select one of the
two possible cases. Otherwise the integral median would oscillate. Take for
example the value 3 and 4 with weights 1
2 respectively. It is not difficult to
see that
m(N,
1
2
) =

3 for N = even
4 for N = odd

are the two possible cases. No convergence can happen.
6

More Related Content

What's hot

Waveguides
WaveguidesWaveguides
Waveguides
Modugu Srinivas
 
On Application of Unbounded Hilbert Linear Operators in Quantum Mechanics
On Application of Unbounded Hilbert Linear Operators in Quantum MechanicsOn Application of Unbounded Hilbert Linear Operators in Quantum Mechanics
On Application of Unbounded Hilbert Linear Operators in Quantum Mechanics
BRNSS Publication Hub
 
Metric space
Metric spaceMetric space
Metric space
beenishbeenish
 
Application of Schrodinger Equation to particle in one Dimensional Box: Energ...
Application of Schrodinger Equation to particle in one Dimensional Box: Energ...Application of Schrodinger Equation to particle in one Dimensional Box: Energ...
Application of Schrodinger Equation to particle in one Dimensional Box: Energ...
limbraj Ravangave
 
2nd order ode applications
2nd order ode applications2nd order ode applications
2nd order ode applications
Muhammad Zulfazli
 
03 Vibration of string
03 Vibration of string03 Vibration of string
03 Vibration of string
Maged Mostafa
 
Ph 101-9 QUANTUM MACHANICS
Ph 101-9 QUANTUM MACHANICSPh 101-9 QUANTUM MACHANICS
Ph 101-9 QUANTUM MACHANICS
Chandan Singh
 
Higher Differential Equation
Higher Differential EquationHigher Differential Equation
Higher Differential Equation
gtuautonomous
 
Causal Dynamical Triangulations
Causal Dynamical TriangulationsCausal Dynamical Triangulations
Causal Dynamical Triangulations
Rene García
 
PaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORS
PaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORSPaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORS
PaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORSMezban Habibi
 
Vibration of Continuous Structures
Vibration of Continuous StructuresVibration of Continuous Structures
Vibration of Continuous Structures
Mohammad Tawfik
 
Problem for the gravitational field
 Problem for the gravitational field Problem for the gravitational field
Problem for the gravitational field
Alexander Decker
 
Article 1st
Article 1stArticle 1st
Selected ch25
Selected ch25Selected ch25
Selected ch25xajo2013
 

What's hot (15)

Waveguides
WaveguidesWaveguides
Waveguides
 
On Application of Unbounded Hilbert Linear Operators in Quantum Mechanics
On Application of Unbounded Hilbert Linear Operators in Quantum MechanicsOn Application of Unbounded Hilbert Linear Operators in Quantum Mechanics
On Application of Unbounded Hilbert Linear Operators in Quantum Mechanics
 
Metric space
Metric spaceMetric space
Metric space
 
Application of Schrodinger Equation to particle in one Dimensional Box: Energ...
Application of Schrodinger Equation to particle in one Dimensional Box: Energ...Application of Schrodinger Equation to particle in one Dimensional Box: Energ...
Application of Schrodinger Equation to particle in one Dimensional Box: Energ...
 
2nd order ode applications
2nd order ode applications2nd order ode applications
2nd order ode applications
 
03 Vibration of string
03 Vibration of string03 Vibration of string
03 Vibration of string
 
Ph 101-9 QUANTUM MACHANICS
Ph 101-9 QUANTUM MACHANICSPh 101-9 QUANTUM MACHANICS
Ph 101-9 QUANTUM MACHANICS
 
Higher Differential Equation
Higher Differential EquationHigher Differential Equation
Higher Differential Equation
 
Causal Dynamical Triangulations
Causal Dynamical TriangulationsCausal Dynamical Triangulations
Causal Dynamical Triangulations
 
PaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORS
PaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORSPaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORS
PaperNo8-HabibiSafari-IJAM-CHAOTICITY OF A PAIR OF OPERATORS
 
magnt
magntmagnt
magnt
 
Vibration of Continuous Structures
Vibration of Continuous StructuresVibration of Continuous Structures
Vibration of Continuous Structures
 
Problem for the gravitational field
 Problem for the gravitational field Problem for the gravitational field
Problem for the gravitational field
 
Article 1st
Article 1stArticle 1st
Article 1st
 
Selected ch25
Selected ch25Selected ch25
Selected ch25
 

Similar to Proofs nearest rank

Machine learning (10)
Machine learning (10)Machine learning (10)
Machine learning (10)NYversity
 
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
Vinh Nguyen Xuan
 
2.propagation of uncertaint
2.propagation of uncertaint2.propagation of uncertaint
2.propagation of uncertaintddhondup7
 
(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network
Masahiro Suzuki
 
Machine learning (12)
Machine learning (12)Machine learning (12)
Machine learning (12)NYversity
 
Machine learning (2)
Machine learning (2)Machine learning (2)
Machine learning (2)NYversity
 
On Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum planeOn Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum plane
Steven Duplij (Stepan Douplii)
 
Cs229 notes9
Cs229 notes9Cs229 notes9
Cs229 notes9
VuTran231
 
1-11.pdf
1-11.pdf1-11.pdf
1-11.pdf
ssusere3d41b
 
Iterative methods
Iterative methodsIterative methods
Iterative methodsKt Silva
 
machinelearning project
machinelearning projectmachinelearning project
machinelearning projectLianli Liu
 
Lecture 3 - Linear Regression
Lecture 3 - Linear RegressionLecture 3 - Linear Regression
Lecture 3 - Linear Regression
Harsha Vardhan Tetali
 
Fuzzy clustering and merging
Fuzzy clustering and mergingFuzzy clustering and merging
Fuzzy clustering and merging
abc
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
The Statistical and Applied Mathematical Sciences Institute
 
MC0082 –Theory of Computer Science
MC0082 –Theory of Computer ScienceMC0082 –Theory of Computer Science
MC0082 –Theory of Computer Science
Aravind NC
 
Chern-Simons Theory
Chern-Simons TheoryChern-Simons Theory
Chern-Simons Theory
Juliho Castillo
 
sublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energiessublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energies
Fujimoto Keisuke
 
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Dahua Lin
 
A Proof Of The Conjecture Due To Parisi For The Finite Random Assignment Problem
A Proof Of The Conjecture Due To Parisi For The Finite Random Assignment ProblemA Proof Of The Conjecture Due To Parisi For The Finite Random Assignment Problem
A Proof Of The Conjecture Due To Parisi For The Finite Random Assignment Problem
Kate Campbell
 

Similar to Proofs nearest rank (20)

compressed-sensing
compressed-sensingcompressed-sensing
compressed-sensing
 
Machine learning (10)
Machine learning (10)Machine learning (10)
Machine learning (10)
 
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
 
2.propagation of uncertaint
2.propagation of uncertaint2.propagation of uncertaint
2.propagation of uncertaint
 
(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network
 
Machine learning (12)
Machine learning (12)Machine learning (12)
Machine learning (12)
 
Machine learning (2)
Machine learning (2)Machine learning (2)
Machine learning (2)
 
On Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum planeOn Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum plane
 
Cs229 notes9
Cs229 notes9Cs229 notes9
Cs229 notes9
 
1-11.pdf
1-11.pdf1-11.pdf
1-11.pdf
 
Iterative methods
Iterative methodsIterative methods
Iterative methods
 
machinelearning project
machinelearning projectmachinelearning project
machinelearning project
 
Lecture 3 - Linear Regression
Lecture 3 - Linear RegressionLecture 3 - Linear Regression
Lecture 3 - Linear Regression
 
Fuzzy clustering and merging
Fuzzy clustering and mergingFuzzy clustering and merging
Fuzzy clustering and merging
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
MC0082 –Theory of Computer Science
MC0082 –Theory of Computer ScienceMC0082 –Theory of Computer Science
MC0082 –Theory of Computer Science
 
Chern-Simons Theory
Chern-Simons TheoryChern-Simons Theory
Chern-Simons Theory
 
sublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energiessublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energies
 
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
 
A Proof Of The Conjecture Due To Parisi For The Finite Random Assignment Problem
A Proof Of The Conjecture Due To Parisi For The Finite Random Assignment ProblemA Proof Of The Conjecture Due To Parisi For The Finite Random Assignment Problem
A Proof Of The Conjecture Due To Parisi For The Finite Random Assignment Problem
 

Recently uploaded

Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
Large scale production of streptomycin.pptx
Large scale production of streptomycin.pptxLarge scale production of streptomycin.pptx
Large scale production of streptomycin.pptx
Cherry
 
Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
subedisuryaofficial
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SELF-EXPLANATORY
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
AADYARAJPANDEY1
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
muralinath2
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
Cherry
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
muralinath2
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
yusufzako14
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
aishnasrivastava
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
anitaento25
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 

Recently uploaded (20)

Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
Large scale production of streptomycin.pptx
Large scale production of streptomycin.pptxLarge scale production of streptomycin.pptx
Large scale production of streptomycin.pptx
 
Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 

Proofs nearest rank

  • 1. Proofs of some elementary facts on the weighted nearest rank Vasilis. Anagnostopoulos April 20, 2021 Abstract In this note we prove two remarkable properties of the nearest rank when weights are employed. We use elementary properties to provide proofs and show that nearest rank is competitive to other percentile methods in simplicity. The properties also prove its consistency both when the weights are integral or not. It supports the material presented in a article about weighted medians in medium. As explained in The nearest rank method, nearest rank is a good com- promise in finding the percentile and asymptotically they are the same. The definition also extends naturally for the weighted case we are interested in. To this end, lets craft a ”math friendly definition” that will be convenient enough to help us prove theorems. Suppose we are given a series of weighted values, say {(x1, w1), . . . , (xm, wm)}. Since this series could model prices (x) and quantities (w) it is natural to assume that the weights are positive. Also we make the assumption that the series is sorted in increasing prices so that cumulative distribution function can be defined. To summarize, the constraints on this series take the form: wi ≥ 0 ∀i (1) wi ≥ wi−1 ∀i ≥ 1 (2) Now we are ready to give the definitions. Definition 0.1 (Nearest Rank). We define the weighted q-nearest rank index as mq = min{i : Pi j=1 wj Pm j=1 wj ≥ q} (3) and the weighted q-nearest rank is xmq . (4) 1
  • 2. Remark. It is an easy task to prove that the definition given here and the one in Wikipedia are equivalent. Just match the definitions for the case where wi = 1 ∀i. We will find out that these definitions, even though they deviate some- how from the common median (q-percentile), they satisfy some very desir- able properties. 1 The invariant property of nearest rank for inte- gral weights In this section we prove the first interesting property of nearest rank. If the weights are integral and we ”explode” the sequence then, the nearest rank calculated by definition 0.1 is the same whether we apply it on the original or the exploded sequence. Consider as above a sequence of integral weighted samples satisfying (1) and (2). Its exploded version is just the same sequence with every value appearing as many times as its weight. In other words we replace this sequence {(x1, w1), (x2, w2), . . . , (xm, wm)} (5) with {(x1, 1), . . . , (x1, 1) | {z } w1 , (x2, 1), . . . , (x2, 1) | {z } w2 , . . . , (xm, 1), . . . , (xm, 1) | {z } wm } (6) or equivalently {x1, . . . , x1 | {z } w1 , x2, . . . , x2 | {z } w2 , . . . , xm, . . . , xm | {z } wm } (7) The ”conditions” (1) and (2) are satisfied for the exploded sequence too. Theorem 1.1. Exploded and unexploded sequences have the same nearest rank. Proof. Smart counting is at the core of this theorem. Suppose the calculation on the ”exploded sequence gives an index nq. Suppose that the x value at this position, has index m0 q in the 1, . . . , m interval. What we are trying to prove is that m0 q = mq. (8) Please, take your time to understand why. Now, by definition for the exploded sequence 2
  • 3. Pnq j=1 1 Pm j=1 wj ≥ q (9) and consequently Pm0 q j=1 wj Pm j=1 wj ≥ q ⇒ m0 q ≥ mq (10) by the minimality of mq. On the other hand, again by definition of the exploded sequence, the condition Pmq j=1 wj Pm j=1 wj ≥ q (11) implies nq X j=1 1 ≤ mq X j=1 wj. (12) As a matter of fact we have the margin to increase nq until we change x. This means m0 q ≤ mq (13) and the theorem is proved. 2 Nearest rank is accessible through samples While the previous theorem was more or less expected the next property is unexpected and makes it super useful for non-integral weights. Suppose we would like to find the nearest rank of the following sequence satisfying (1) and (2) {(x1, w1), (x2, w2), . . . , (xm, wm)} (14) with nearest rank xmq . We add just another constraint now. the weights are positive probabilities. The weights now, sum to 1 m X i=1 wi = 1 (15) Suppose now we create another sequence {(x1, w0 1), (x2, w0 2), . . . , (xm, w0 m)} (16) 3
  • 4. with weights w0 i = [Nwi]. (17) In the equation above the reader can identify [.] as the integer part. The hope is that in the limit of infinite N the previous theorem applies. By the properties of the integer part [x] ≤ x < [x] + 1 (18) and consequently (as the original weights sum to 1) N − m < m X i=1 [Nwi] ≤ N. The new weights now do not sum to N, possibly something less but the error is bounded by m. In order to correct this shortcoming we add 1’s to the first w0 i until we get to N. This amounts to selecting a decreasing sequence of 0/1 numbers, say ki such that w00 i = [Nwi] + ki. (19) sums to N. Let the nearest rank of this sequence with weights w00 be xm(N,q) . We also need a very technical assumption that will help convergence. Definition 2.1 (Admissible q). We say that q is admissible for the weights when q 6= k X i=1 wi for all k. (20) We can state our theorem. Theorem 2.1. Non integral nearest rank is accessible through integral com- putations when weights are probabilities and the q is admissible for them. In other words lim N→∞ xm(N,q) N = xmq (21) Proof. Smart counting is crucial here too. We also make use of 18. By definition 4
  • 5. mq X i=1 wi ≥ q ⇒ (22) mq X i=1 (1 + [Nwi]) ≥ Nq ⇒ (23) m + mq X i=1 (ki + [Nwi]) ≥ Nq ⇒ (24) Pmq i=1 w00 i Pm i=1 w00 i ≥ q − m N . (25) In a similar way, Pm(N,q) i=1 w00 i Pm i=1 w00 i ≥ q ⇒ (26) m(N,q) X i=1 (ki + [Nwi]) ≥ Nq ⇒ (27) m + m(N,q) X i=1 Nwi ≥ Nq ⇒ (28) m(N,q) X i=1 wi ≥ q − m N . (29) We cannot have an infinite N such that m(N, q) < mq. This can be see from 27 because then mq−1 X i=1 wi ≥ m(N,q) X i=1 wi ≥ q − m N . (30) By taking the limits mq−1 X i=1 wi ≥ q (31) which contradicts the minimality of mq. Consequently from a N0 on- wards m(N, q) ≥ mq. (32) Also we can see from 23 that 5
  • 6. m(N, q) > mq + 1. (33) cannot happen for infinite N . So, from a N0 onwards either m(N, q) = mq or m(N, q) = mq + 1. (34) This is where admissibility comes into play. Suppose that m(N, q) = mq + 1, again for infinite N. By the minimality of m(N, q) and 23 we have q − m N ≤ Pmq) i=1 w00 i Pm i=1 w00 i < q. (35) By taking the limits Pmq) i=1 w00 i Pm i=1 w00 i = q (36) which contradicts the admissibility. The technical assumption come into play in order to select one of the two possible cases. Otherwise the integral median would oscillate. Take for example the value 3 and 4 with weights 1 2 respectively. It is not difficult to see that m(N, 1 2 ) = 3 for N = even 4 for N = odd are the two possible cases. No convergence can happen. 6