## 2 Materials and Methods
### Methodology  
Taking into account the defined requirements, a methodology for the generation of a synthetic load profile is proposed (Figure 2), which is based on the Markov chains theory. It contains four major steps, which are explained below. **Step 1. Data preparation**  
Figure 1: Example of load profiles with the same statistical characteristics but different probabilistic characteristics: (**a**) the load profile crosses the 2 kW level 6 times; (**b**) the load profiles crosses the 2 kW level 2 times. Figure 2: A summary of the methodology for synthetic data generation. In this initial phase, the training data are acquired, which includes two phases:  
**Phase 1.1. Data collection--** In this phase, a time series is obtained from an energy meter or other means, such as a photovoltaic system with a smart meter. While no strict requirements are defined for the number of samples, it is understandable that the higher the volume of data is, the clearer the image of the load will be. The used data should include the following columns:  
* a timestamp, including the date and time of the measurement;
* instantaneous (or average) power of the load for the corresponding moment. **Phase 1.2. Data preprocessing--** Next, the collected data are preprocessed, which includes several different aspects:  
* The time series is verified for inconsistencies, which should either be excluded or corrected (if applicable). Such situations might include records with empty values, negative values, unrealistically high values, etc. This verification could be made either manually or using different tools and approaches, including statistical methods for outlier detection. * If the time step of the series is lower than intended, it should be increased by choosing an appropriate approach. For example, if the time of discretization of the dataset is 5 min, and it should be analyzed in 15 min batches, then the data should be resampled. The new 15 min records could be formed either by selecting the corresponding records or by averaging them with the nearby records. * The time series should be divided into appropriate batches, depending on its seasonality. For example, if the load profile characteristics are different for the different months of the year, then it should be analyzed independently for each month. In the current study, we have adopted this approach. **Step 2. Matrices generation**  
In this step, the transition matrices are generated, which include  
* Choosing the number of states, i.e., the dimensionality of the matrices. The data are divided into \(N\) states (Figure 3) of equal width, which is estimated according to  
\[StateWidth=\frac{P_{max}-P_{min}}{N+1},W, \tag{1}\]  
where \(P_{max}\) and \(P_{min}\) are the maximal and minimal power consumptions for the investigated time series. * Generating 24 transition matrices for each hour of the day, based on the Markov chain theory. In other words, each discrete sample of the load profile data is classified into one of the N states and the probabilities of jumping from each state to all other states  
Figure 3: Classification of the load profile’s discrete samples into \(N\) states. are estimated for each hour of the day (Figure 4). These matrices are generated using all pairs of sequential records, which belong to the same hour of the day (for example, if the time of discretization is 15 min, the records at 09:30 and 09:45 are consecutive and belong to the same hour). - Generating 24 transition matrices containing the probabilities for changing states when an hour is changed (Figure 4). They are based on all pairs of sequential records, which belong to different hours (for example, if the time of discretization is 15 min, the records at 9:45 and 10:00 belong to different hours of the day). The following example is given for a better understanding of the difference between hourly and hour-change matrices.