## 2 Materials and Methods
### Data Elaboration  
Nonlinear regression is a type of regression where, during analysis, observational data are modelled according to a function that is a nonlinear combination of the model parameters and depends on one or more independent variables. The data are fitted by a method of successive approximations. The use of nonlinear regression may be made as not all phenomena are described by linear models, as well as for cases of data where linear regression is less accurate than nonlinear regression. In general, a function is nonlinear with respect to its constituent parameters. For the purposes of this work a polynomial equation of second degree was chosen. Polynomials offer a broader scope for representing functions and relationships between variables than linear equations, enabling more complex modeling and flexible curve fitting, and enhancing predictive accuracy. A second-degree polynomial equation is expressed in Equation (1). \[f(x)=ax^{2}+\beta x+\gamma \tag{1}\]  
where \(x\) is the independent variable, and \(a\), \(\beta\), \(\gamma\), are the coefficients. Nonlinear functions that can be used include logarithmic functions, exponential functions, trigonometric functions, etc. To ensure thorough analysis of the results, experiments were conducted on a weekly and monthly basis. Polynomial functions were identified weekly for each sensor and gas and the monthly function was derived from monthly data and refined by incorporatingweekly polynomial functions. In addition, a comprehensive study was conducted on time scaling and seasonality correction using the nonlinear regression approach. The methodology for applying nonlinear regression to low-cost electrochemical sensor data is described in four steps:  
1. Hourly measurements of low-cost sensors of the same type were averaged. 2. The averaged values were correlated with the reference values and the degree of correlation was expressed by a second-order polynomial function. In the same way, the hourly measurements of each sensor were correlated with the reference measurements and the degree of correlation was expressed by a second-degree polynomial function. For the purpose of evaluating the results, this procedure was carried out on a weekly basis for one month's measurements. 3. From the monthly polynomial correlations, the coefficients of the polynomial correction function were estimated. 4. The monthly polynomial correction function was applied to the low-cost sensor measurements and the results were re-evaluated. Finally, the Root Mean Square Error (RMSE), Mean Absolute Deviation (MAD), and Mean Absolute Error (MAE) methods were used to evaluate the nonlinear method results, both for weekly and monthly data. The measurements analyzed below relate to gaseous pollutants, such as nitrogen dioxide and ozone. The data from both the low-cost and reference gas sensors have been taken on an hourly basis. Simple nonlinear regression is applied to the data to identify a polynomial function that can be used as a correction factor for the data from the low-cost sensors. The measurements (primary and corrected by nonlinear regression (NLR)) analyzed below relate to gaseous pollutants, such as nitrogen dioxide and ozone. The data from both the low-cost (N1, N2, N3) and reference gas sensors have been taken on an hourly basis. Simple nonlinear regression is applied to the data to identify a polynomial function that can be used as a correction factor for the data from the low-cost sensors. For the needs of the experiment, one month's data (14 April 2021 to 13 May 2021) are studied, since according to [37], the ageing of the sensors has an effect on the measurements. To establish a more generalized study, nonlinear regression is applied on a daily basis, weekly basis, and monthly basis, for both types of sensors. A series of replicated experiments were performed to determine the degree of the polynomial function. The results showed that a polynomial function of 2 nd degree is sufficient to give satisfactory results in terms of the degree of correlation.