# CrowdPower: A Novel Crowdsensing-as-a-Service Platform for Real-Time Incident Reporting
## 3 System Architecture and Design
### Estimation of Data Quality, Participant's Reputation, and Filtering Outliers
#### 3.7.2 Participant Reputation Estimation Model  
After determining the data quality of a participant's data, the participant's reputation is estimated. Reputation is defined as the 'trustworthiness' of a user, and it is estimated using historical quality records. While a participant's reputation progressively increases because of consistent behavior over time, it decreases if there are anomalies detected [43]. Intuitively, the participant's reputation should have a small increase after receiving a high-quality contribution and a larger decrease if the data quality was low. To determine a participant's reputation after \(k\) time slots, we first determine \(q^{\prime}_{i,k}\) which is the relative quality index. We aggregate previous information to estimate the participant's reputation by summing all the past quality records, where \((1-q_{i,k})^{2(k-t)}\) is the aging weight where \(0<(1-q_{i,k})<1\). Therefore, \(q_{i,t}-\frac{1}{n}\) determines if a participant's data quality in slot \(t\) is above average, i.e., \(q_{i,t}-\frac{1}{n}>0\) or otherwise. The participant with lower quality data \(q_{i,t}\leq\frac{1}{n}\) should have a higher aging weight and have a larger reputation decrement, i.e., the participant's reputation decrements relatively when data quality decreases, as shown in Equation (12). Similarly, when the average quality is above average \(q_{i,t}>\frac{1}{n}\), the aging weight is \(q_{i,t}\). When the number of participants increase, the rate at which the reputation is affected should also increase as the quality of peer-data must affect the reputation. Therefore, we adapt a generalized logistic regression function [44], given in Equation (13), to calculate a participant's reputation.  
\[q^{\prime}_{i,k}=\left\{\begin{array}{l}\sum\limits_{t=1}^{k}(1-q_{i,t})^{ 2(k-t)}\Big{(}q_{i,t}-\frac{1}{n}\Big{)}\ if\ q_{i,t}\leq\frac{1}{n}\\ \sum\limits_{t=1}^{k}q_{i,t}^{2(k-t)}\Big{(}q_{i,t}-\frac{1}{n}\Big{)}\ if\ q_{i,t}>\frac{1}{n}\end{array}\right. \tag{12}\]  
\[Rp_{i}=W+\frac{X}{\Big{(}1+e^{-B(q^{\prime}_{i,k}-C)}\Big{)}^{\frac{1}{7}}} \tag{13}\]In Equation (13), \(W\) and \(X\) are the lower and upper asymptotes, \(B\) is the growth rate, \(C\) is the maximum growth rate, and \(f\) is the inflection point. After each time slot \(k\), the participant's reputation is updated. This approach of calculating the reputation is proportional to the degree of trustworthiness which is assimilated over time. The algorithm for calculating participant reputations is provided in Algorithm 2.  
```
Input: Quality set: \(q_{i,k}\) Output: Reputation of participants: \(Rp_{i}\)
1:for all\(i\in N\)
2:for all\(k\in K\)
3:if \(q_{i,k}\leq 1/n\)
4:\(q^{\prime}_{i,k}=\sum_{t=1}^{k}\bigl{(}1-q_{i,t}\bigr{)}^{2(k-t)}\bigl{(}q_{i,t }-\frac{1}{n}\bigr{)}\)
5:else
6:\(q^{\prime}_{i,k}=\sum_{t=1}^{k}q^{2(k-t)}_{i,t}\bigl{(}q_{i,t}-\frac{1}{n} \bigr{)}\)
7:for all\(i\in N\)
8:\(Rp_{i}\bigl{(}q^{\prime}_{i,k}\bigr{)}=A+\frac{B}{\left(1+\text{D}e^{-r(q^{ \prime}_{i,k}-30)}\right)^{\frac{1}{4}}}\)
9:return\(Rp_{i}\)
```  
**Algorithm 2**Estimation of Participant Reputation