Electricity consumption simulation using random coefficient periodic autoregressive model

The concept of a continuous-time conditional linear random process involves a random kernel being integrated stochastically by a process with independent increments, which is often called a “generative process”. In cases where the “generative process” is Poisson, the resulting model represents an investigated signal as a sum of numerous stochastically dependent random impulses each of which occurs according to some inhomogeneous Poisson arrival process. This model can be applied to represent various processes related to energy consumption, such as electricity loads of electrical power systems, gas and water consumption, and other energy resources, while also considering the signals’ cyclostationarity, which is usually caused by the rhythmic nature of consumer behaviour. A member of the discretetime conditional linear cyclostationary random processes class is the random coefficient periodic autoregressive (RCPAR) model, which is appropriate for use in energy informatics, including estimation, forecasting, and computer simulation purposes. The primary objective of the paper is to establish a procedure for simulating the hourly electricity consumption of small and medium-sized enterprises using the RCPAR model, which has periodic parameters and creates cyclostationary properties while also accounting for the investigated process conditional heteroscedasticity. The statistical estimation step of the proposed procedure uses the general methodology for estimating the parameters of the RCPAR model and the methods of statistical analysis of cyclostationary signals. This step is used to identify the simulation characteristics. The simulation step is based on the methods of cyclostationary white noise generation and its transformation by a digital linear filter with random parameters. The last ones are obtained using the Gaussian random vectors computer simulation methods, taking into account the cyclostaionarity property.


Introduction
The development of mathematical and computer-based models for stochastic signals, processes, and noises is a crucial step in the creation of information measurement and control systems within the electric power industry [1,2], as well as automated systems for energy consumption analysis (electric, gas, water consumption), information technology for monitoring and diagnosing the technical conditions and environment of energy facilities, etc.The models form the theoretical foundation for the design and implementation of such systems and technologies, and provide the basis for signal processing algorithms, diagnostic decision-making methods, and energy consumption forecasting.An adequate mathematical model must accurately represent the physical mechanism behind the signal or process, enable theoretical analysis, and facilitate the detection and estimation of informative characteristics of energy objects.Moreover, it should also be suitable for creating computer simulation models to solve practical problems.Modern problems and challenges in the energy sector, which are associated with the volatility and partial controllability of sustainable energy generators, the uncertainty of the behaviour of energy consumers (which is no longer necessarily in line with traditional load profiles), decentralization, modification of the dynamic characteristics of sustainable energy systems, require comprehensive scientific applied research in the domain of energy informatics, which combines computer science, control systems, and energy management systems in a single methodology [3].Important areas of energy informatics are the collection, analysis, deployment, and exploitation of energy status data, modelling, simulation, and prediction of the behaviour of energy objects and processes [3], including energy consumption computer simulation.Energy consumption data analysis and simulation are also useful instruments for the problems of user segmentation based on energy consumption behaviour, electricity consumption pattern (load profiles) analysis, power consumption forecasting, etc. Modelling, computer simulation, digital twin technology [4], etc. can be interconnected to create a complex digital energy ecosystem called as "Energy Metaverse" [5].
Mathematical models represented as continuous-time or discrete-time linear random processes (LRP) are very useful for solving the above problems in energy engineering [6,7].In the mentioned above application domains, the different implementations of linear periodic random processes [6,7] are also very useful, which allows taking into consideration the cyclostationarity of the studied signals or processes, caused, for example, by the rhythmic daily (weekly, yearly, etc.) behaviour of electricity, gas, or water consumers, vibrations of the bearings of energy facilities, and other energy objects that are subject to monitoring and diagnosis.
Linear random processes are commonly used for mathematical modeling of signals that are additively comprised of a large number of independently occurring independent impulses (with random parameters) forming a Poisson flow [6].However, when these impulses are dependent random functions, a more appropriate model would be a conditional linear random process (CLRP) [8], which is defined as a stochastic integral of a random kernel driven by a 'generative' inhomogeneous process with independent increments (LRP has a similar construction, where the kernel is a deterministic function).
For the problems of statistical monitoring, forecasting, diagnostics, and computer simulation, discrete-time LRP is mostly used in the form of an autoregressive sequence, and for cyclostationary processes as periodic autoregression [6,7,9].Similarly, the random coefficient autoregressive (RCA) model [8,10] is an effective tool for the statistical analysis of CLRP.Properties, methods of the parameters estimation of the RCA model in the case of its stationarity, and corresponding computer simulation methods have been studied by many authors (a comprehensive review of corresponding results is given in [10]).The random coefficient periodic autoregressive (RCPAR) model has been defined as RCA model with periodic coefficients.The periodicity conditions of its moment functions and multidimensional distribution functions have been established.Expressions for estimating the parameters of the periodic autoregression model with random coefficients in the general case have been obtained in [8], and the properties of the estimates have been confirmed by the results of computer simulation modelling.
The primary objective of the paper is to develop the method of computer simulation of electricity consumption using random coefficient periodic autoregressive model.
The representation (1) exists in the sense of mean-square convergence of the sequence of appropriate integral sums if and only if the following holds [8]: If kernel ϕ(ω, τ, t) is deterministic function then ξ(ω, t) is LRP [8].Conditional (conditionally) linear random process (1) has been characterized for the first time by Pierre [12] for the case of a homogeneous and compensated 'generative' process η(ω, τ ).In particular, Pierre studied the central limit theorem for the sequence of linear functionals from conditionally linear random processes with continuous and discrete time with application to the problems of mathematical modelling of radar clatter.
The modelling of power system loads as a linear periodic random process is based on the representation of the studied process expressed as the sum of a numerous independent impulses (with random duration and amplitude) occurring at Poisson moments of time.According to the results of experimental studies [8] it is shown that the processes of electricity consumption of individual households are stochastically dependent.This confirms the adequacy of the CLRP model for the tasks of mathematical modelling, forecasting, and simulation of electricity consumption processes at the level of households, residential areas and enterprises.Moreover, taking into account the cyclic behavior of energy users, it can be shown that the investigated electricity load process will be cyclostationary [9] with a period of T = 24 hours, that is, the random process is periodic by its time arguments [9]: Let ξ(ω, t), t ∈ (−∞, ∞) be the energy system load, mathematical model of which is represented above as a cyclostationary CLRP.Then is the discrete-time random process which is equal for each t ∈ Z to electricity consumption during time interval [(t − 1)h, th].In particular, if h = 1 hour, then ξ t (ω), t ∈ Z is hourly electricity consumption.If ξ(ω, t), t ∈ R is cyclostationary continuous-time process with the period of T , then ξ t (ω), t ∈ Z is cyclostationary discrete-time process with the period of L. Discrete-time conditional linear random process is represented as [8]: where ϕ τ,t (ω), τ, t ∈ Z is an infinite dimension random matrix (kernel), η τ (ω), τ ∈ Z is sequence of independent random variables (white noise) with finite variance; ϕ τ,t (ω) and η τ (ω) are stochastically independent, also in the present paper only the case of centered η τ (ω), is considered, that is Eη τ (ω) = 0, then the series ( 4) is mean-square convergent if the kernel Discrete-time linear random process be obtained from (4) if ϕ τ,t (ω) is nonrandom function.

Random coefficient periodic autoregressive model
Our idea of statistical estimation of characteristics of CLRP ( 4) is founded on the following assumptions.A discrete-time LRP can be represented as the response of a linear digital filter (with non-random coefficients that generally change over time, for example, periodically) to an input signal which is white noise in the strict sense.Very important case for practical applications is linear random process in the form of an autoregressive sequence, which is the output of a recursive digital filter to input white noise.
Discrete-time CLRP (4) can be represented as the output of digital filter with random coefficients (because impulse response ϕ τ,t (ω) is random function) on the input white noise η τ (ω).If this filter is created so that it has only a recursive structure, then the random signal at its output will be a sequence of autoregression with random coefficients.
As we already mentioned above, the most comprehensively studied is the case of the stationary RCA model, for which we have Var (η t (ω)) = σ 2 t = σ 2 , a t = a = (a 1 , a 2 , ..., a p ) , R t = R, that is, characteristics are not time varying.
The discrete-time random process ( 5) is called random coefficient periodic autoregressive model (RCPAR), if there exists the number L ∈ N (period), such that The methods for characteristics estimation of RCPAR model have been studied for the first time by Franses et al [13], but with some boundaries, in particular non-random parameters a 1,t , a 2,t , ..., a p,t were considered as cosine function with the period L (and the parameters of that functions were estimated), moreover, in their model V ar (η t (ω)) = σ 2 = const, elements of the vector α t (ω) are independent and also have constant variances.The method of statistical 1254 (2023) 012027 IOP Publishing doi:10.1088/1755-1315/1254/1/0120275 estimation for the RCPAR model in general case have been developed in [8] and can be used for parameters specification for the applied problems of electricity consumption computer simulation.
Thus, having the results of experimental observations (or measurements) of ξ t (ω), we need to estimate the elements of the vector a t = (a 1,t , a 2,t , ..., a p,t ) , t = 1, L, variances σ 2 t , t = 1, L, and also elements of covariance (p × p)-matrices R t , t = 1, L. Note that since each matrix R t is symmetric, then we need to estimate only p(p + 1)/2-sized vectors γ t = vec(R t ), t = 1, L [8].
A two-stage algorithm for estimating the coefficients of the stationary RCA model by the method of least squares has been justified by Nicholls and Quinn [8,10,14].The obtained estimations are consistent and asymptotically normal.The approach for statistical estimating the coefficients of the RCPAR model has been developed in [8], it is based on the above results, but takes into account the cyclostationarity properties of the sequence (7).
Taking into account the periodicity of probability distribution of the process ( 7) and periodicity of its parameters, let us consider L nested subsequences, that is: Every l-th sequence from ( 8) is stationary (as a function of s) random sequence, moreover, all that sequences are jointly stationary.

Hourly electricity consumption simulation
The general approach for the computer simulation of electricity consumption based on RCPAR model has been illustrated on the figure 1.
We emphasize that characteristics of RCPAR model (Setting 2 -Setting 4) have to be specified as periodic function (see formula (6).The characteristics can be obtained from statistical analysis (estimation step) of electricity consumption data using the expressions ( 9) - (12).Before performing the estimation procedure according to ( 9) -( 12) the electricity consumption time series data should be centered by the periodic mean estimation (the usual averaging estimator [15] can be used).
In stage Simulation 1 the simulation of centered independent random vectors has to be performed with a given covariance matrix.We recommend generating them as normally distributed random vectors.The method of multivariate normally distributed random vectors simulation is well known and is considered, for example, in [16], we should take into account only that the covariance matrix is time-varying and periodic.That is, according to [16] (section 6.2) step Simulation 1 should be performed for each time stamp in the following way: • simulation of the vector (the size depends on the order of RCPAR model) of independent standard normal random variables; • performing the Choleski decomposition of the covariance matrix given in the Setting 3 step; • simulation of the centered normal random vector (see step Simulation 1), using the linear transformation of the vector of independent standard normal random variables by the lower triangular matrix, which is obtained using the Choleski decomposition.
In stage Simulation 2 the centered white noise should be simulated with periodic variance, given in step Setting 4. The probability distribution is recommended to be normal as well.The well-known methods (e.g.polar method, described in [16], section 5.3) can be used for this simulation, taking into account the time-varying periodic variance of simulated white noise.That is, step Simulation 2 should be performed for each time stamp in the following way: simulation of the standard normal random variable and then multiplying it by the standard deviation given in step Setting 4.
In stage Simulation 3 the RCPAR sequence is simulated using the random objects obtained in the previous steps.Taking into account the mentioned relationship between the random coefficient autoregressive model and digital filters stage Simulation 3 can be performed in the following way: • design the linear recursive digital filter with random coefficients, given and simulated in steps Setting 2 and Simulation 1; • feed the white noise from Simulation 2 to the input of this filter; • output is the computer simulation of RCPAR sequence.
In stage Simulation 4 the deterministic component should be added, which is also a discretetime periodic function.This function is the mathematical expectation of simulated electricity consumption time series.It has the same period as other above periodic functions.
The verification and validation stages cover checking the computer code for any programming errors, comparing simulated and real data visually (realizations, probability characteristics and parameters) and using the statistical estimations and tests, etc.
The realization of hourly electricity consumption of the enterprise belonging to the category of SME (small and medium-sized enterprises) has been represented in the figure 2 (A).On the same figure 2 below (B) the realization of computer simulation model of the first order has been represented.Mean absolute percentage error (MAPE) is one of the most common performance criteria to validate simulation models [17] and time series forecasting [18].For the presented example MAPE is equal to 15.12 percent.
We should emphasize the difference between the RCPAR-based computer simulation model of electricity consumption and other close established constructive models such as periodic autoregressive (PAR) model [6,7] (or more general periodic moving average (PARMA) model [6]) and seasonal autoregressive moving average (SARMA) model [18].All these models can be used both for computer simulation of electricity consumption, as well as for its forecasting.PARMA and RCPAR-based simulation models have periodic parameters, and they are cyclostationary sequences while SARMA is a wide-sense stationary model with constant parameters.PARMA and SARMA models are linear while RCPAR can simulate the nonlinear dynamics representing both periodic heteroscedasticity and conditional heteroscedasticity (random conditional variance) of electricity consumption.Finally, the RCPAR-based computer simulation model follows from a physically reasonable mathematical model of electricity loads in the form of a conditional linear cyclostationary random process.The experimental comparison of the above models is a task for future research.
The prospective research should be also related to estimation (and utilizing in simulation process) of order of the model, which can be periodic function, also the probability distribution of random objects on the stages Simulation 1 and Simulation 2 can be analyzed as different from normal.
The developed computer simulation model as presented above doesn't consider the very important and widespread case of additional weekly (168-hour) cyclicity of electricity consumption, caused, for example, by the days off.A possible way of improvement, in our opinion, is the use of a multivariate random coefficient periodic autoregressive model.For the hourly simulation, the corresponding model would be 24-variate with the period equal to 7.

Conclusion
The mathematical model of electricity loads has been represented in the form of cyclostationary conditional linear random process, which made it possible to justify the model of hourly electricity consumption as a cyclostationary discrete-time conditional linear random process.
Random coefficient periodic autoregressive model, as a particular case of discrete-time CLRP, has been used to create the computer simulation method of hourly electricity consumption of SME, taking into account its cyclostationarity (periodic heteroscedasticity) and conditional heteroscedasticity.
The first step of this method is statistical estimation of the periodical characteristics of RCPAR model, taking into account its cyclostationarity.The estimations are then analyzed and used for the simulation model parameters specification.RCPAR-based simulation is performed as digital recursive filtration (with random coefficient) of input cyclostationary white noise.
The improvements of the model are possible in the direction of using the non-gaussian distributions of filter coefficients or input white noise and also taking into account the weekly

Figure 1 .
Figure 1.Structure of electricity consumption simulation using RCPAR model.

Figure 2 .
Figure 2. Time series of hourly electricity consumption of SME (A) and its computer simulation model (B).