Skip to main content
. 2019 Sep 19;19(18):4049. doi: 10.3390/s19184049
Algorithm 4: Estimating Data Truthfulness
[Service Provider receives a data submission d]
//Evaluate data truthfulness for each category of measurement.
foreach c in d
 //Check if the measurement value for this category is within the limits set by the service provider.
 if mc < mcmin or mc > mcmax then
  v = false //If not within the limits, set the validation status to false and exit the algorithm.
  return v
 end if
 Read data [dc] for c //Read the data for this category of measurement.
 Get h from [dc]’s PDF //Compute the height of the dataset’s PDF.
LLF = hsum(log(h)) //Compute the Log Likelihood Function.
 //Use initial estimates for the mean and standard deviation.
 Use initial estimates μe and σe
 //Use MLE to estimate the two parameters (mean and standard deviation) for which the normal
 //distribution best describes the data.
 Compute μ and σ by applying MLE using LLF, μe and σe
 //Read the standard deviation factor for this measurement category, compute the scaled standard
 //deviation setting and set the threshold limits.
 Read fσ
σscaled = σ * fσ
lmin= μσscaled
lmax= μ + σscaled
 //Check if the measurement value is within the threshold limits.
 if mc < lmin or mc > lmax then
  v = false//If not within the threshold limits, set the validation status to false and exit the algorithm.
  return v
 end if
end foreach
v = true//If the loop has finished without exiting the algorithm, the data submission is a valid one.