## 2 Materials and Methods
### Fit Linear Model (FITLM)  
The measured values in the real world never fit perfectly for a model due to measurement errors and to some mathematical models is a simplification of the real world. If it is taken into account all factors influencing a set of variables, it would be unmanageable, committing the model some error. The chosen model indicates that \(X\) variable (dependent variable) is a function of the variables \(Y_{1},\ldots,\ Y_{k}\) (independent variables). That is, all variables corresponding to a subset of all possible cases are measured. By applying the model, the difference between the measured variable \(X\) and the predicted value minimizes the error values, fitting the model. The input to the system are the different preprocessed values of meteorological parameters previous to its target value. After the corresponding prediction process is performed, it will be obtained a single output value, being the value of the weather parameter to predict. The different operating modes of the prediction systems are:  
* Training mode, in which the model used later on the test mode is created
* Testing mode, in which the desired output is obtained. Figure 3 shows the concept of the sliding window. Figure 2: Example of regression tree. The sliding window is an important parameter that must be considered when the input data is introduced into the forecast system. To it, it is assigned a certain value or size. This window contains past data or attributes (highlighted in orange) of the phenomenon that it is wanted to predict, called target value (highlighted in blue). It moves in order to change its attributes in every iteration to obtain the system outputs or target values. When an iteration happens, the window moves one position forward. The last target value becomes an attribute of the new sliding window to predict the next target value. In this way, a prediction of a specific meteorological parameter is performed. The target value corresponding to each row is set into the target values vector, which is another important parameter for the training mode. The training matrix is generated with this sliding window principle. Each row of the matrix contains the sliding window corresponding to every iteration. Every row is a vector with the information previous to a specific target value. If the window size is \"n\", there will be \"n\" values of each type of meteorological parameter used to predict in that row of the matrix. For example, if it is wanted to make a prediction about temperature using temperature and wind as input parameters using a sliding window size of five samples. The first row of the training matrix will consist of the first five temperature values concatenated with the first five values of the wind speed. Thus, it is intended to predict the sixth temperature value, which is in the first position of the target values vector. An example of the training matrix and target values vector, are shown in Table 2.  
Size of the sliding window is a critical part in the prediction system in terms of accuracy in the obtained prediction. For that reason, it is necessary to make several test to obtain the appropriate size of the window. As a result of the training mode, with all the information obtained on it, the model is created and used in the test mode as input. The block diagram of the forecasting system is shown on Figure 4.  
A training mode and, subsequently, a testing mode has been realized, forming the supervised classifier, to obtain kernel parameters.