# LoRaWAN Path Loss Measurements in an Urban Scenario Including Environmental Effects
## 5 Path Loss and Shadowing Modelling
### Multiple Linear Regression Model  
Because previous works have shown that the environmental variables affect the CPLS, i.e., temperature [30], relative humidity [30], barometric pressure [43], particulate matter [33], and SNR [29], we proposed an enhancement of the LDPLM considering the log-distance term and the effects of the environmental variables as shown in Equation (10):  
\[CPLS=\hat{\beta}_{0}+10\gamma log_{10}(d)+20 log_{10}(f)+\hat{\beta}_{1}T+\hat{ \beta}_{2}RH+\hat{\beta}_{3}BP+\hat{\beta}_{4}PM+\hat{\beta}_{5}SNR+\psi, \tag{10}\]  
where \(\hat{\beta}_{0}\) is the model intercept (equivalent to \(K\) in Equation (6)), \(\gamma\) is the path loss exponent, \(\beta_{i}\in i=\{1,\ldots,5\}\) are the model predictors, \(f\) is the frequency (Hz), \(T\) is the temperature (\"C), \(RH\) is the relative humidity (%), \(BP\) is the barometric pressure (hPa), \(PM\) is the particulate matter (\(\mathrm{\mu g}/\mathrm{m}^{3}\)), \(SNR\) is the signal-to-noise ratio (the received signal power divided by the noise floor power level in dB), and \(\psi\) is the shadow fading term expressed in Equation (6). The path loss exponent is multiplied by ten from Equation (6), assuming a far-field distance \(d_{0}=1\,\mathrm{m}\). The frequency weight is fixed to 20 from the [PERSON] model [13]. To fit the MLR model, we have applied minimum squares optimization by differentiating the set of Equations in (11):  
\[\frac{\partial}{\partial\hat{\beta}_{k}}\sum_{i=0}^{n}\left[C_{i}-\left(\hat{K }+10\hat{\gamma}\log_{10}(d_{i})+\hat{\beta}_{1}T_{i}+\hat{\beta}_{2}RH_{i}+ \hat{\beta}_{3}BP_{i}+\hat{\beta}_{4}PM_{i}+\hat{\beta}_{5}SNR_{i}\right) \right]^{2}=0, \tag{11}\]  
where \(K\) is the model intercept, \(\hat{\beta}_{k}\in\left\{\hat{\beta}_{1},\ldots,\hat{\beta}_{5},\hat{\gamma}\right\}\) are the model predictors, \(C_{i}=M_{i}-20\log_{10}(f_{i})\), \(M_{i}\) is the i\({}^{th}\) experimental path loss observation, \(d_{i}\), \(f_{i}\), \(T_{i}\), \(RH_{i}\), \(BP_{i}\), \(PM_{i}\), and \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Subset** & **RMSE (dB)** & \(\mathbf{R}^{2}\) \\ \hline LDPLM & Training & 2.465, \(s=0.25\) & 0.8517 \\  & Test & 2.46 & 0.8529 \\ MLR & Training & 1.843, \(s=0.1\) & 0.917 \\  & Test & 1.8401 & 0.9177 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Errors of fitted models. \(SNR_{i}\) are the corresponding distance, frequency, temperature, relative humidity, barometric pressure, and SNR for the \(i^{th}\) experimental path loss observation. The model coefficients found after the optimization are in Table 7.  
The model coefficients can be explained as discussed subsequently: (i) as expected, as the distance increases, the CPLS also increases, according to the predictions of different theoretical models like Friis [13] or two-ray [12]; furthermore, \(\hat{\gamma}\) = 2.203 attends the empirical values usually found for microcells [12], (ii) CPLS is directly proportional to the changes in temperature [30], (iii) relative humidity is also directly proportional to path loss [30], (iv) because a high barometric pressure causes high water vapor concentration, the effect of barometric pressure on CPLS is proportional, causing signal attenuation [32], and (v) the SNR has a negative impact on path loss, that is, when the SNR is worse, the path loss increases [29]. We obtained an RMSE for the test set of 1.84 dB and an R\({}^{2}\) equal to 0.9177, outperforming those obtained in the LDPLM. Remarkably, the R\({}^{2}\) increases from 0.85 (LDPLM) to 0.917 (MLR), exhibiting a better behavior regarding shadowing, so the inclusion of environmental variables helps improve the accuracy of the CPLS model. This fact can be verified in Figure 13, where we depict the histograms for the prediction errors of the LDPLM and the MLR CPLS models.