Skip to main content
letter
. 2015 Mar 19;15(3):6607–6632. doi: 10.3390/s150306607

Algorithm 2: Sensor Refinement

Input: Snxm matrix of time series for n sensors with m samples each, and a set Inline graphic = {r1, r2,…, rn} of reliable sensors.
Output: Set Inline graphic of dislocated sensors and vector Δ of their dislocations from the majority.
Inline graphic←∅
Δ ← {Δi = 0 | 1 ≤ in}
m ← {mi = 0 | 1 ≤ in}
Pn×n ← {pi,j = 0 | 1 ≤ i,jn}
// Compute the average squared pairwise-distance between each two sensors.
for i ← 1 to n − 1 do
for ji + 1 to n do
  // Adjust the valid readings among the reliable sensors.
  u ← { sri,k (sri,k ≠ λ) and (srj,k ≠ λ), 1 ≤ km };
  v ← { srj,k (sri,k ≠ λ) and (srj,k ≠ λ), 1 ≤ km };
  pi,jpj,i ← mean((uv)2)
end
end
// Compute the median pairwise-distance for each sensor.
for i ← 1 to n do
mi ← median({pi,j|1 ≤ jn})
end
// The limit to consider a sensor dislocated.
l ← mean(m)
// The dislocated sensors.
Inline graphic ← {i | mi > l}
// Compute the dislocation Δi for each reliable sensor.
for i ← 1 to n do
 Δi ← median(pi,jmi)
end
return ( Inline graphic, Δ)