with outliers at high value side and give following Expanding Algorithm (also IIR algorithm). Algorithm 1: Expanding Algorithm Input: data set D {d1, d2,…, dN} with length N
Output: outliers of data set D
1. Sort D in ascending order, we get ordered data set D"
D"{d0:N, d1:N, …,dN-1:N} d0:N ≤d1:N ≤ … ≤d*N-1:N*
2. Let δi = (di:N - d*i-1:N*) i ≥1 and 

$$\begin{array}{l}{{\Delta\delta_{0:N}=\Delta T N=\ \cdot}}\\ {{\Delta=\sum_{i=0}^{N-1}\delta_{i}\ .}}\end{array}$$

1
$\int$
$\square$
i
3. Calculate Er, Ihr and IIR of di:N (i ≥2)
Eri = δi * (N-1)/ Δ

```
          ( max( )) j
                   j i
   i i i
Ihr   
                   

```

 
 
IIRi = Eri / Ihri =    

( 1) ( max( )) j j i N  i 4. Let t = min(i) in all i that meet IIRi > c and i > N/2 (c is an adjustable threshold)
5. Output dk when dk ≥ dt:N 
If the safest point changes from the first one to the middle one, algorithm could be generalized as following.

## Algorithm 1':

Expanding Algorithm Input: data set D {d1, d2,…, dN} in ascending order Output: outliers of data set D
1. Set median set M={dN/2, d*N/2+1*} when N=even, or M={d*(N+1)/2*} when N=odd.

2. Call the order of minimum value of M left limit l, and the order of maximum value right limit r. initial value of l and r are l0 and r0, l0 =N/2 and r0=N/2+1 when N=even, l0 =r0=(N+1)/2 when N=odd 3. Expanding median set M by step 4 till |M|=N/2+1 (N is even) or (N+1)/2 (N is odd).

4. If (dr+1 - dr) > (dl - dl-1) let left limit l=l-1 Else let right limit r=r+1 5. Calculate maxdelta=max{(di-di-1), (dj-dj-1)} ( i<l0*, j>r*0 di,dj∈M)
6. Resume step 4 and calculate the following three parameters till IIR>=c or reaching all data (l=1 and r=N), c is a threshold.

 To i<l to j>r Eri=(di+1-di*)/(d*N-d1)*(N-1) Eri =(dj-dj-1)/(dN-d1)*(N-1)
 Ihri=(di+1-di)/(di+1-di-maxdelta) Ihri =(dj-dj-1)/(dj-dj-1-maxdelta)
 IIRi=Eri/Ihri IIRi=Eri*/Ihr*i If IIRi<c l=i if IIRi <c r=j and maxdelta=max{maxdelta, (di+1-di)} and maxdelta=max{maxdelta, (dj-dj-1)} 