Online Static Security Assessment of Power Systems Based on Lasso Algorithm

As one important means of ensuring secure operation in a power system, the contingency selection and ranking methods need to be more rapid and accurate. A novel method-based least absolute shrinkage and selection operator (Lasso) algorithm is proposed in this paper to apply to online static security assessment (OSSA). The assessment is based on a security index, which is applied to select and screen contingencies. Firstly, the multi-step adaptive Lasso (MSA-Lasso) regression algorithm is introduced based on the regression algorithm, whose predictive performance has an advantage. Then, an OSSA module is proposed to evaluate and select contingencies in different load conditions. In addition, the Lasso algorithm is employed to predict the security index of each power system operation state with the consideration of bus voltages and power flows, according to Newton-Raphson load flow (NRLF) analysis in post-contingency states. Finally, the numerical results of applying the proposed approach to the IEEE 14-bus, 118-bus, and 300-bus test systems demonstrate the accuracy and rapidity of OSSA.


Background and Motivation
In power system operations, the security of a system has always been an important issue, which is related to the ability to continue normal operation in post-contingency conditions [1]. Power system security assessment is an effective tool for checking the security of power systems, which aims to determine whether, and to what extent, a power system is reasonably safe from serious interference to its operation [2,3]. Power system security assessment includes static security assessment (SSA) and dynamic security assessment (DSA). Static security assessment is concerned with factors related to the insecurity situation [4,5], such as overload, overvoltage, and so on, via the load flow calculation of the power system in post-contingency conditions. Meanwhile, dynamic security assessment mainly analyzes the transient stability of the power system after the fault of the power system according to the real-time data [6][7][8]. To predict the transient stability status by machine learning algorithms in the post-fault condition, the real-time data are respectively obtained from phasor measurement units (PMUs) in [6] and the simulation results in [7,8]. This article focuses on static security assessment

Literature Review
Studies of power system static security assessment have been carried out for a few years [12][13][14] that have focused on contingency screening or ranking. In order to select and screen contingencies in static security assessment, the indices representing voltages deviation and line overloads are employed in [12,13]. While in Krishnan et al. [14], a database generation method is proposed for the critical contingencies that have been screened. Thus, as a commonly used method, the severity of the power system in post-contingency conditions is evaluated by the performance indices, which are computed by the variables of power systems [15]. In Sunitha et al. [16], a single composite security index, which is obtained by Newton-Raphson load flow (NRLF) analysis, is proposed for defining the security, which provides a reference for the proposed method in this paper. The composite security index divides the power system conditions into three categories: the secure state with the index value of '0'; the alarm state with the index value between '0' to '1'; and the index value greater than '1', which represents an insecure state. The composite security index considers the violations of bus voltages and line flows, and avoids the selecting of index weights [16]. By adopting the security index in the proposal, the time consumed to evaluate severity could be reduced. However, in the research on static security assessment, the literature has an excessive focus on the accuracy and celerity [15,16]. Furthermore, many of these studies ignore the regulation ability of the power system by employing adjustable devices, such as the transformers and reactive power compensation devices in the power system [17][18][19]. In Li et al. [17], Dall'Anese et al. [18] and Li et al. [19], the power system demonstrated improved economic and environmental benefits by optimizing the variables of adjustable devices. Therefore, on the premise of ensuring fast and accurate screen contingencies, the effects of the adjustable devices are considered in this paper.
Due to the large computing scale of NRLF analysis for obtaining the composite security index in the contingency analysis [20], the static security assessment of a power system is a heavy task. What's more, the online application of static security assessment has a higher requirement for efficiency. Thus, adopting machine learning methods is an accurate and powerful way for contingency analysis [21], whose speed and accuracy are suitable for online applications. There are three typical machine learning methods that can be used for static security assessment. One is the artificial neural network (ANN) algorithm [22][23][24]. In Oliveira et al. [25]. In Sunitha et al. [16], the static security index is predicted by adopting the ANN algorithm for contingency screening and ranking. In Al-Masri et al. [22] and Zhou et al. [23], the ANN algorithm is applied for enhancing the security of power systems. In Varshney et al. [24], an ANN module is employed for static security assessment, considering the voltage and load flow in the power system. Although the ANN algorithm has been employed in the literature, it is inappropriate for large-scale data modules, and the internal mechanism is difficult to understand. Another is the decision tree (DT) algorithm [25,26]. In Oliveira et al. [25], the static security assessment applies machine learning techniques, which are based on decision tree algorithms, to improve the efficiency of contingency screening and ranking. In Saeh et al. [26], a modified decision tree algorithm is employed for static security assessment. Static security problems can be assessed by adopting decision tree algorithms; however, it is possible to over-fit or trap decision tree algorithms into local minimum points [27]. In addition, the support vector machine (SVM) algorithm is another machine learning method for static security assessment [28,29]. In Kalyani et al. [28] and Kalyani et al. [29], considering line overload and voltage deviation indices in the power system, SVM algorithms are employed for evaluating static security. Nevertheless, the SVM algorithm is difficult to implement if the scale of the training sets is too large. Therefore, according to the above analyses, the prediction of the above three algorithms may be affected when static security assessment have requirements for the time-solving and calculation scales.
Studies have shown that the least absolute shrinkage and selection operator (Lasso) algorithm has stronger generalization ability and predictive performance than other machine learning methods [30][31][32][33], such as the three algorithms that have been mentioned. The Lasso algorithm has been successfully utilized in many areas of power systems, such as, the state estimation of a power system in [30], image processing in [31], and telecommunications in [32]. Lasso is also used for the prediction of the transient stability boundary in [33], while a systematic approach for categorizing the model parameters based on Lasso is presented in [34]. Compared to other learning algorithms, Lasso is more accurate and has the ability for the automatic feature selection to yield a low-dimensional solution [33]. As the observation of online static security assessment (OSSA) is essentially a high-dimensional problem, the Lasso algorithm is suitable for OSSA. However, the application of the Lasso algorithm in OSSA is finite. The proposal provides an idea for the utilization of the Lasso algorithm in the area of OSSA.

Contributions
The purpose of this paper is to develop an OSSA module based on the Lasso algorithm. In order to reduce the computation scale of real-time static security assessment, the proposed method is applied to fast and accurate contingency screening and ranking. The proposal composes the following procedure. (1) The security index PI c is used for evaluating the security of power system operating states, and the conditions can be distinguished into secure, alarmed, and insecure states. (2) The Lasso module is trained by adopting the variables in the power system, the status of all of the lines, and the corresponding security index. (3) Once the Lasso module is trained, the proposal can predict the security index based on the variables from the power system, and the operating state also can be obtained according to the value of PI c .
The main contributions of this paper are as follows.
(1) In order to screen and rank the severity of contingencies, an online static security assessment module is presented considering the impacts of adjustable devices, and the operating state also can be identified via the variables of the current operating point; (2) A novel method based on the multi-step adaptive Lasso (MSA-Lasso) regression algorithm is developed for predicting the security index with the consideration of bus voltages and power flows, which is employed to evaluate the operating states; (3) Load conditions varying from 50% to 150% of the base load are considered for adapting to the changeful power system states.

Organization of This Paper
The remaining parts of this paper are organized as follows: A brief introduction of online security assessment in the power system is given in the following section. Then, the basic principle of the Lasso algorithm is provided in Section 3. Moreover, the Lasso algorithm employed for OSSA is proposed in Section 4. Case studies and results that demonstrate the effectiveness are carried out in Section 5, and finally, Section 6 gives the conclusion.

Online Static Security Assessment in Power System
In the modern energy management system (EMS), static security assessment is an important control method [1][2][3]. The assessment can be implemented according to the fault set. The set may contain contingencies with a single line outage, loss of generators, load variations, and so on. Line outages and load variations are considered in this paper. Then, three operating states of power systems-insecurity, alarmed, and security states-can be identified via static security assessment. The operators can take appropriate measures for each state based on the severities of faults.
In conventional practices, security assessment is solved by repeatedly computing the power flow for all of the pre-defined outage conditions. However, the size of the fault set is generally large, and changes with the load conditions of the power system. Static security assessment will consume a large amount of time, and it is difficult to achieve in online application. Hence, the rapid and accuracy of screening and ranking contingencies is a significant issue. For this purpose, the composite security index PI c is employed for evaluation, and the Lasso algorithm is applied instead of a power flow calculation to obtain the security index PI c in the paper.

Principles of Multi-Step Adaptive Lasso Regression Algorithm (MSA-Lasso)
The principles of Lasso are briefly introduced in this section. As a regression learning algorithm, Lasso is superior to others [30][31][32][33]. The basic idea of Lasso is to minimize the residual sum of the square, under the condition that the sum of the absolute value of the regression coefficient is less than a constant. Then, some regression coefficients are produced, and they are strictly equal to 0. For a better presentation of the Lasso regression algorithm, the algorithm model is firstly introduced. Then, the regression algorithm is displayed. In addition, the Lasso regression algorithm is compared with the Ridge Regression algorithm. Finally, the MSA-Lasso regression algorithm is discussed.

Algorithm Model
As a supervised machine learning algorithm, the original training set of this problem is: is the ith original observation vector that is constructed by controlled variables in this paper, y (0) i is the ith original response, which is the security index in this paper, and S is the size of the training set. Generally, the original observation data x (0) i needs to be standardized, while y (0) i needs to be zero-centered; the post-treatment data x i and y i are defined as: where µ x and µ y are respectively the means of x i . After the process, it can be ensured that Taking two-dimensional data as an example, the effect after the treatment of centralization and standardization are shown in Figure 1. From the figure, it can be clearly seen that centralization moves the center of the data to the origin point, and standardization ensures that the scale of the data have the same value in each dimension. and changes with the load conditions of the power system. Static security assessment will consume a large amount of time, and it is difficult to achieve in online application. Hence, the rapid and accuracy of screening and ranking contingencies is a significant issue. For this purpose, the composite security index PIc is employed for evaluation, and the Lasso algorithm is applied instead of a power flow calculation to obtain the security index PIc in the paper.

Principles of Multi-Step Adaptive Lasso Regression Algorithm (MSA-Lasso)
The principles of Lasso are briefly introduced in this section. As a regression learning algorithm, Lasso is superior to others [30−33]. The basic idea of Lasso is to minimize the residual sum of the square, under the condition that the sum of the absolute value of the regression coefficient is less than a constant. Then, some regression coefficients are produced, and they are strictly equal to 0. For a better presentation of the Lasso regression algorithm, the algorithm model is firstly introduced. Then, the regression algorithm is displayed. In addition, the Lasso regression algorithm is compared with the Ridge Regression algorithm. Finally, the MSA-Lasso regression algorithm is discussed.

Algorithm Model
As a supervised machine learning algorithm, the original training set of this problem is: where ( Taking two-dimensional data as an example, the effect after the treatment of centralization and standardization are shown in Figure 1. From the figure, it can be clearly seen that centralization moves the center of the data to the origin point, and standardization ensures that the scale of the data have the same value in each dimension.   The regression algorithm is based on the following simplified linear model [33]: where Y is the vector consisting of responses, and Y = [y 1 , · · · , y i , · · · , y S ] T ; X is the S × D design observation matrix, which is formed by observation of x 1 , · · · , x i , · · · , x S , and the observation x i , which includes D variables, has the corresponding response y i ; σ = [σ 1 , · · · , σ i , · · · , σ D ] T is the vector of regression coefficients; and ε = [ε 1 , · · · , ε i , · · · , ε S ] T is the vector of random variables produced by the innovation process. For obtaining regression coefficients σ, the linear model can be solved via the least square (LS) method. The cost function f (σ) of the optimization problem is described as: The regression coefficients can be obtained, and the expression of estimatesσ is: If the estimatesσ exist, the only condition is that X is a full matrix. However, even though the condition is satisfied, large relevance features of observation data will cause big errors. Therefore, the regression algorithm is proposed to improve the situation.

Regression Algorithm
A penalty term R(|σ i |) is added to the regression algorithm, which is an improvement on the least square method. The cost function f (σ) of the regression problem is given by: where λ ≥ 0 denotes the shrinkage tuning parameter. Equation (6) is equivalent to the following functions: where t ≥ 0 represents the tuning parameter. If the penalty term adopts L 1 norm, that is R(|σ i |) = |σ i |, the following optimization issue can represent the Lasso regression algorithm, and the cost function is shown as:

Multi-Step Adaptive Lasso Regression Algorithm
In order to solve the regression problem, in the basis of the classic Lasso regression algorithm which is shown as Equation (3), the constant term of estimator σ 0 is joined in the Lasso algorithm model, and it is given by: For solving the Lasso model, the following optimization issue needs to be solved: where l(y i , x i , σ 0 , σ) represents the function of likelihood contribution for observation x i . Aiming at solving the shortcomings of low efficiency and high complexity in the classic adaptive Lasso regression algorithm, the MSA-Lasso regression algorithm, which is realized by repeatedly using the adaptive Lasso regression algorithm, is introduced as follows.
Firstly, the Gaussian model is employed in this paper for the linear regression issue, and the above optimization issue in Equation (10) can be written as: Then, cyclic coordinate descent (CCD) is employed for solving the optimization, which is a fast method compared with others under the current research background [35]. The basic criterion of CCD is that each parameter is optimized and circulated until the conditions of the other parameters are fixed, and the coefficient is stable. Thus, the Lasso regression algorithm is implemented multiple times. Then, the current kth estimator σ k can be computed as: where σ 0 and σ l (l = 1, · · · , D) are the current regression coefficients. Therefore, the model of the MSA-Lasso regression algorithm can be explained.

Parameters in This Section
In order to a better presentation of the aforementioned symbols, the main parameters in this section are listed in Table 1 as follows. Parameter Meaning The ith original observation vector The ith post-treatment observation vector y i The ith post-treatment response S The size of the training set D The number of variables X The S × D design observation matrix formed by observation vectors Y The response vector consisting of S responses λ The shrinkage tuning parameter σ The vector of regression coefficients

Online Static Security Assessment Method
The proposed OSSA method is introduced in this section, and the method contains the OSSA module and the Lasso module. The OSSA module concerns the power system operating points for screening and ranking contingencies, while the Lasso module is based on the variables of the power system and security index. By predicting the security index of the power system via the Lasso module, the system static security can be assessed online.

Overall Online Static Security Assessment Method
According to the above analysis, the overall structure of the proposed OSSA method is shown in Figure 2. The operating points are chosen as the inputs of the OSSA module, which is represented by the active power outputs P G and reactive power outputs Q G of the generators, the active loads P D and reactive loads Q D of the load buses, and the voltage amplitudes U and angles δ of the buses. In this paper, the light, normal, and heavy load conditions are considered, and the load condition randomly varies from 50% to 150% of the base load for representing different load conditions. Then, the contingency screening and ranking can be accomplished. In addition, the operating state of the corresponding operating point can be identified.

Overall Online Static Security Assessment Method
According to the above analysis, the overall structure of the proposed OSSA method is shown in Figure 2. The operating points are chosen as the inputs of the OSSA module, which is represented by the active power outputs G P and reactive power outputs G Q of the generators, the active loads D P and reactive loads D Q of the load buses, and the voltage amplitudes U and angles δ of the buses. In this paper, the light, normal, and heavy load conditions are considered, and the load condition randomly varies from 50% to 150% of the base load for representing different load conditions. Then, the contingency screening and ranking can be accomplished. In addition, the operating state of the corresponding operating point can be identified. The MSA-Lasso algorithm is employed in the Lasso module, and the Lasso module is trained by taking controlled variables, which are displayed in Section 3.2 as observations, while the security index PIc is taken as a response introduced in Section 3.3. Based on the Lasso module, the OSSA can run fast and accurately.

Selection of Observations Considering Adjustable Devices
The MSA-Lasso algorithm is adopted to prediction, and the observations are divided into two parts: one part is the states of all of the lines in the power system comprising running lines, which are represented by 1, and outage lines, which are represented by 0; the other is controlled variables among the variables in an AC power system, and the controlled variables are generated randomly in their ranges.
In order to achieve better regulation and control of the power system, the impacts of the transformer and compensation equipment are taken into account in this paper. Owing to the controlled variables that vary in the process of load flow computation, they are selected as one part of the observations of the MSA-Lasso algorithm. The controlled variables and their ranges are listed as follows:   The MSA-Lasso algorithm is employed in the Lasso module, and the Lasso module is trained by taking controlled variables, which are displayed in Section 3.2 as observations, while the security index PI c is taken as a response introduced in Section 3.3. Based on the Lasso module, the OSSA can run fast and accurately.

Selection of Observations Considering Adjustable Devices
The MSA-Lasso algorithm is adopted to prediction, and the observations are divided into two parts: one part is the states of all of the lines in the power system comprising running lines, which are represented by 1, and outage lines, which are represented by 0; the other is controlled variables among the variables in an AC power system, and the controlled variables are generated randomly in their ranges.
In order to achieve better regulation and control of the power system, the impacts of the transformer and compensation equipment are taken into account in this paper. Owing to the controlled variables that vary in the process of load flow computation, they are selected as one part of the observations of the MSA-Lasso algorithm. The controlled variables and their ranges are listed as follows: where P G i and Q G i are respectively the active and reactive power outputs of generator i, U i is the magnitude of voltage in bus i, T i is the tap of transformer i, Q C i is the switching capacity of reactive power compensation capacitor i, and N G , N ac , N T and N C are respectively the numbers of generators, buses, adjustable transformer taps, and reactive power compensation capacitor banks in the AC power system; the upper and lower limits of each variable are distinguished by the subscripts min and max.

Selection of Responses Considering Bus Voltages and Power Flows
After NRLF analysis, the corresponding security index PI c is chosen as the response of the MSA-Lasso algorithm. The index can assess the security of the power system under N−1 contingencies [16], and PI c , which considers bus voltages and power flows, is defined as: where n is the exponent, and n = 2 in this paper; A max i and A min i are respectively the upper and lower alarm limits of U i ; H max i and H min i are respectively the upper and lower security limits of U i ; P A j and P H j are the upper alarm limit and security limit of the jth line active power flow P j . In this equation, q max U i and q min U i are employed for evaluating the voltage limit violations, while q P j can determine the extent of line overloading. In the power flow calculation, there are no limits of power flows; thus, the value of PI c can be very large, and the security index can better evaluate the severity of contingency caused by overloading.
By adopting the security index PI c as the response, the operating states are distinguished into three classes as following:

1.
PI c = 0, the system is in the secure state, 2. 0 < PI c ≤ 1, the system is in the alarmed state, 3.
PI c > 1, the system is in the insecure state.
The contingencies can be identified as one of the three states, and the severity can be sorted by the values of security index PI c , where a higher value of PI c means a more serious contingency.

Solution Process of Lasso Module
According to the observations and responses of the MSA-Lasso algorithm, the solution procedures of the Lasso module are listed as follows, and the flowchart is as shown in Figure 3.
Step 1: Input the data of the network, particularly the load conditions (i.e., light, normal, heavy load conditions). Input the ranges of controlled variables in Equation 14. In addition, the steps of the discontinuous variables, T and Q C , also need to be provided.
Step 2: Set the iteration number ite = 1, and its maximum value ite max .
Step 3: Calculate the load flow of the power system with randomly controlled variables in the condition that every line has an outage respectively; then, the corresponding response PI c is computed. In this step, the information is recorded, which includes the random controlled variables, the outage line, and the corresponding index PI c .
Step 4: Judge the terminate conditions. If ite ≥ ite max , the cyclical process comes to an end, and continues to the following steps. Otherwise, come back to Step 3, and increase the iteration number by 1.
Step 5: The Lasso module is trained with conservations and corresponding responses, where each conservation is the set formed by the random controlled variables and the status of lines, and each response is the security index PI c . Moreover, it should be noted that the size of Lasso training set S is same as the maximum iteration number ite max .
Step 6: The security index PI c can be predicted by adopting the Lasso module, with a known set of controlled variables and outage lines in the power system.  Figure 3. Solution process of the least absolute shrinkage and selection operator (Lasso) module.
Step 1: Input the data of the network, particularly the load conditions (i.e., light, normal, heavy load conditions). Input the ranges of controlled variables in Equation 14. In addition, the steps of the discontinuous variables, T and C Q , also need to be provided.
Step 2: Set the iteration number =1 ite , and its maximum value max ite .
Step 3: Calculate the load flow of the power system with randomly controlled variables in the condition that every line has an outage respectively; then, the corresponding response PIc is computed. In this step, the information is recorded, which includes the random controlled variables, the outage line, and the corresponding index PIc.
Step 4: Judge the terminate conditions. If max ite ite ≥ , the cyclical process comes to an end, and continues to the following steps. Otherwise, come back to Step 3, and increase the iteration number by 1.
Step 5: The Lasso module is trained with conservations and corresponding responses, where each conservation is the set formed by the random controlled variables and the status of lines, and each response is the security index PIc. Moreover, it should be noted that the size of Lasso training set S is same as the maximum iteration number max ite .
Step 6: The security index PIc can be predicted by adopting the Lasso module, with a known set of controlled variables and outage lines in the power system.

Solution Using Online Static Security Assessment Method
Based on the above overall frame of OSSA and the introduction of the Lasso module, the proposed method is discussed in this section. The online static security assessment method is presented by two parts: the OSSA module and the Lasso module. The application of the proposed method is discussed as follows.
In the OSSA module, the load condition randomly varies from 50% to 150% of the base load; thus, the load condition needs to be identified. According to the values of active loads D P and reactive loads D Q , the power system data are divided into different types for representing different load conditions.

Solution Using Online Static Security Assessment Method
Based on the above overall frame of OSSA and the introduction of the Lasso module, the proposed method is discussed in this section. The online static security assessment method is presented by two parts: the OSSA module and the Lasso module. The application of the proposed method is discussed as follows.
In the OSSA module, the load condition randomly varies from 50% to 150% of the base load; thus, the load condition needs to be identified. According to the values of active loads P D and reactive loads Q D , the power system data are divided into different types for representing different load conditions. For the determined load condition, the set is randomly generated in the post-contingency condition. The set contains the observations and responses of the Lasso algorithm, and the observations are active power outputs P G , reactive power outputs Q G , voltages U, taps of transformers T, switching capacities of reactive power compensation capacitors Q C , and the status of all of the lines that are represented by "0" and "1"; the responses are corresponding security indices PI c . The number of sets is based on the number of outage lines and types of load conditions. Meanwhile, 20% of the sets are employed as test sets, and the others are applied as training sets. Then, each training set can obtain a Lasso module after training.
Once all of the Lasso modules are trained, the Lasso algorithm can be employed for predicting the security index PI c of a certain load condition with the line outage. According to the value of PI c , the operating state of the power system can be identified, and the contingencies can be sorted and screened.

Parameters in This Section
In order to obtain a better presentation, the aforementioned symbols, the main parameters in this section are listed in Table 2 as follows.

Case Studies
The IEEE 14-bus, 118-bus, and 300-bus systems are analyzed in this section. The programs of all of the algorithms are performed by a desktop computer with 3.40 GHz central processing unit (CPU) basic frequency and 4 GB memory in MATLAB 2013a. The effectiveness of the proposal is verified through the comparison of the actual value and predictive value of the index. Then, the security indicators are sorted for assessing the severities of contingencies.
In the test systems, the outages of every line are considered, except the lines that are the only line connected to the generator. The upper and lower alarm limits are ±5% of the desired bus voltage, and the upper and lower of security limits are ±7%. The alarm limit of line flow is 80% of the security limit. The observations and responses of the Lasso algorithm are listed in Table 3. In the table, L represents the status of all of the lines with "0" or "1". Table 3. Observations and responses of the Lasso algorithm.

Parameter
Observation Response Moreover, under normal operating conditions, the ranges of active power output P G and reactive power output Q G are set according to the IEEE standard examples [36], the voltage U ranges from 0.95 p.u. to 1.05 p.u., the transformer tap T ranges from 0.9 p.u. to 1.1 p.u., and the switching capacity Q C ranges from 0 p.u. to 0.5 p.u. The steps of transformer tap T and switching capacity Q C are respectively 0.125 p.u. and 0.01 p.u.

Case Introduction
The IEEE 14-bus system in the literature [1,17,36] is used as a test case to examine the effectiveness of the proposed approach. This system includes five generators, 11 loads, 20 branches, three adjustable transformers, and one reactive power compensation device (connected to bus 9), as shown in Figure 4.

Case Introduction
The IEEE 14-bus system in the literature [1,17,36] is used as a test case to examine the effectiveness of the proposed approach. This system includes five generators, 11 loads, 20 branches, three adjustable transformers, and one reactive power compensation device (connected to bus 9), as shown in Figure 4.  In the case of the 14-bus system, 19 lines are considered for the N−1 contingencies analysis. The line 7-8 (L 14) is not taken into account, because it is the only line connected to the generator. The load condition randomly varies from 50% to 150% of the base load; 950 sets are generated for the MSA-Lasso algorithm, where 20% of the sets are employed for test sets, and the others are applied as training sets [15]. It should be noted that more sets can be generated if necessary. Once the Lasso model is trained, it can be used for predicting the security indices.

Base Load Condition
Under the condition of N−1 contingencies in the normal load conditions of the IEEE 14-bus system, the values of security index PIc are computed by using the NRLF analysis results and predicted by adopting the MSA-Lasso, ANN, and SVM algorithms. One of the ANN algorithms, the back-propagation (BP) neural network, is employed in this paper, and it is a relatively commonly used ANN algorithm [9]. The parameter settings of each algorithm are listed in Table 4, and the comparison of times for contingency screening and ranking by adopting these methods are listed in Table 5. In the case of the 14-bus system, 19 lines are considered for the N−1 contingencies analysis. The line 7-8 (L 14) is not taken into account, because it is the only line connected to the generator. The load condition randomly varies from 50% to 150% of the base load; 950 sets are generated for the MSA-Lasso algorithm, where 20% of the sets are employed for test sets, and the others are applied as training sets [15]. It should be noted that more sets can be generated if necessary. Once the Lasso model is trained, it can be used for predicting the security indices.

Base Load Condition
Under the condition of N−1 contingencies in the normal load conditions of the IEEE 14-bus system, the values of security index PI c are computed by using the NRLF analysis results and predicted by adopting the MSA-Lasso, ANN, and SVM algorithms. One of the ANN algorithms, the back-propagation (BP) neural network, is employed in this paper, and it is a relatively commonly used ANN algorithm [9]. The parameter settings of each algorithm are listed in Table 4, and the comparison of times for contingency screening and ranking by adopting these methods are listed in Table 5. It can be obviously seen that the time of the proposed module is faster than the others. So, the proposal is more available for online applications. The tested controlled variables are listed in Table 6, with the considerations of adjustable transformer taps and reactive power compensation capacitor banks. The detailed comparisons of PI c are listed in Table 7, and the relative errors are listed in Table 8, with each branch exiting from operation. In addition, the ANN and SVM algorithms are employed for contrast, and the results are also listed in the tables. From the above two tables, it can be seen that the values of PI c obtained by algorithm prediction are basically close to those obtained by direct calculation. Compared with ANN and SVM, the MSA-Lasso algorithm has the advantage for predicting the security indices PI c , because the maximum relative error of MSA-Lasso is the smallest among the three algorithms. For a better presentation, the relative errors are shown in Figure 5. Table 8. Relative errors of each method in the base load condition of the IEEE 14-bus system.
MSA-Lasso ANN SVM Figure 6. Boxplot of relative errors in the base load condition of the IEEE 14-bus system.
In the figure, the red crosses represent the mean of errors, and the red lines are the median (50th percentile) of the errors. From the above figure, it can be seen that although the median of ANN is the best, the mean of MSA-Lasso is closer to zero. Thus, MSA-Lasso has a small deviation in the three algorithms. By comparing the lengths of the boxes that reflect dispersion, it is obvious that MSA-Lasso is the best. Therefore, it can be concluded that the MSA-Lasso algorithm has an advantage in the predictions compared with other algorithms. Then, the security indices are sorted in descending order, and the larger value of PIc means that the contingency is more serious. The As shown in Figure 5, the MSA-Lasso algorithm has a narrow error range of initiation in the three algorithms, which means that the MSA-Lasso algorithm is more stable and accurate than the others. Further discussion of the comparisons is based on the boxplot of relative errors, as shown in Figure 6. As shown in Figure 5, the MSA-Lasso algorithm has a narrow error range of initiation in the three algorithms, which means that the MSA-Lasso algorithm is more stable and accurate than the others. Further discussion of the comparisons is based on the boxplot of relative errors, as shown in Figure 6.
MSA-Lasso ANN SVM Figure 6. Boxplot of relative errors in the base load condition of the IEEE 14-bus system.
In the figure, the red crosses represent the mean of errors, and the red lines are the median (50th percentile) of the errors. From the above figure, it can be seen that although the median of ANN is the best, the mean of MSA-Lasso is closer to zero. Thus, MSA-Lasso has a small deviation in the three algorithms. By comparing the lengths of the boxes that reflect dispersion, it is obvious that MSA-Lasso is the best. Therefore, it can be concluded that the MSA-Lasso algorithm has an advantage in the predictions compared with other algorithms. Then, the security indices are sorted In the figure, the red crosses represent the mean of errors, and the red lines are the median (50th percentile) of the errors. From the above figure, it can be seen that although the median of ANN is the best, the mean of MSA-Lasso is closer to zero. Thus, MSA-Lasso has a small deviation in the three algorithms. By comparing the lengths of the boxes that reflect dispersion, it is obvious that MSA-Lasso is the best. Therefore, it can be concluded that the MSA-Lasso algorithm has an advantage in the predictions compared with other algorithms. Then, the security indices are sorted in descending order, and the larger value of PI c means that the contingency is more serious. The sorted results of all of the lines are listed in Table 9, and the digits represent branch numbers. Table 9. Ranking of security indices in the base load condition of the IEEE 14-bus system. From the results, it is clear that the ranking of the MSA-Lasso algorithm is the same as that via NRLF. However, the ANN and SVM algorithms have little differences with NRLF. The results show that the MSA-Lasso algorithm is more suitable for the prediction of security indices. The reason why the others have different orders is that the three algorithms are all biased estimation algorithms [33]; the prediction errors may affect the contingency ranking orders when the values of PI c are relatively close. The ranking results with the descending order of index values via the NFLR method are shown in Figure 7. From the results, it is clear that the ranking of the MSA-Lasso algorithm is the same as that via NRLF. However, the ANN and SVM algorithms have little differences with NRLF. The results show that the MSA-Lasso algorithm is more suitable for the prediction of security indices. The reason why the others have different orders is that the three algorithms are all biased estimation algorithms [33]; the prediction errors may affect the contingency ranking orders when the values of PIc are relatively close. The ranking results with the descending order of index values via the NFLR method are shown in Figure 7. From the above analysis, the proposal has proven that it is effective on the base load condition of the IEEE 14-bus system, since it can predict the security index within a small error, and all of the lines can be identified in a proper order.

Light and Heavy Load Conditions
For testing the accuracy of the prediction of the MSA-Lasso, ANN, and SVM algorithms in the light and heavy load conditions of the IEEE 14-bus system, 80% and 110% of the base load situations are employed for representing light and heavy conditions, respectively. The tested controlled variables are still applied to the variables in Table 6. The ranking results of each condition, with the descending order of the NRLF method, are shown in Tables 10 and 11.   Table 10. Security index results of each method in the light load condition of the IEEE 14-bus system.  From the above analysis, the proposal has proven that it is effective on the base load condition of the IEEE 14-bus system, since it can predict the security index within a small error, and all of the lines can be identified in a proper order.

Light and Heavy Load Conditions
For testing the accuracy of the prediction of the MSA-Lasso, ANN, and SVM algorithms in the light and heavy load conditions of the IEEE 14-bus system, 80% and 110% of the base load situations are employed for representing light and heavy conditions, respectively. The tested controlled variables are still applied to the variables in Table 6. The ranking results of each condition, with the descending order of the NRLF method, are shown in Tables 10 and 11.  (10)(11) 0.9984 0.9995 0.9931 0.9977 L 17 (9)(10)(11)(12)(13)(14) 0.5178 0.5162 0.5146 0.5190 L 7 (4)(5) 0.3878 0.3870 0.3890 0.3899 L 9 (4)(5)(6)(7)(8)(9) 0.3014 0.3005 0.3040 0.3018 L 12 (6)(7)(8)(9)(10)(11)(12) 0  With the analysis of the light, normal, and heavy load conditions, it can be seen that the rankings of the security indices are basically the same. In addition, with the aggravating of loads, the insecure states will gradually increase.
From the results in this section, the conclusion can be drawn that the MSA-Lasso algorithm is also suitable for the light and heavy load conditions of the IEEE 14-bus system. With the utilization of MSA-Lasso, the severities of the N−1 contingencies can be ranked, and the contingencies can be screened.

IEEE 118-Bus System
The IEEE 118-bus system [9,16,20,36], which has 54 generators, 91 loads, 186 branches, nine adjustable transformers, and 12 reactive power compensation devices, is then utilized for examining the effectiveness. A single line diagram of the system is shown in Figure 8.   In the case of the 118-bus system, 179 lines are considered for the N−1 contingencies analysis. In addition, 8950 sets are generated for the MSA-Lasso algorithm.

Base Load Conditions
Under the condition of N−1 contingencies in the normal load conditions of the IEEE 118-bus system, the values of PI c are respectively calculated by employing NRLF analysis and the MSA-Lasso algorithm. Some 30 branches account for more than 15% of all lines, and are randomly selected in two results obtained by the two methods [16], which can represent different operating states of the power system. With descending order of PI c values obtained by NRLF, the outage lines, corresponding PI c , and relative errors are listed in Table 12.
From the above comparison, it can be seen that the results calculated by NRLF and predicted by the MSA-Lasso algorithm have essentially the same ranking. What's more, the security index value of the MSA-Lasso prediction has little difference with that of direct computation in the same outage line. The different orders appear in the alarm states (0 < PI c ≤ 1), and the values of indices are so close that the errors affect the ranking. The differences in alarm operating states will not affect screening contingencies [16]. Therefore, the MSA-Lasso algorithm is still effective in the IEEE 118-bus system.
The computation time of the proposed OSSA module is then compared with that of NRLF and that from the literature [16] by using a multi-layer feed forward network (MLFFN) and radial basis function network (RBFN). From the Table 13, it is clear that MSA-Lasso is more rapid in the OSSA application. From the above analysis, the Lasso module is suitable for online application, and the effectiveness of the proposed method for 118-bus systems is verified.

Light and Heavy Load Conditions
For testing the effectiveness of the proposed method in light and heavy load conditions of the IEEE 118-bus system, 80% and 110% of the base load situations are respectively employed. The tested controlled variables are the same as those in Section 5.2.1. The ranking results of each condition in descending order are shown in Table 14.
From the data of Table 12 and the above table in the IEEE 118-bus system, it can be seen that the rankings of the outage lines are basically the same. Moreover, for the same outage line, the heavier loads cause a large security index value, and the conclusion can be drawn that the proposal is suitable for light, normal, and heavy load conditions in the larger scale system.

IEEE 300-Bus System
For examining the effectiveness of large-scale power systems, the IEEE 300-bus system is applied as an example in this paper, which has 69 generators, 68 loads, 411 branches, 107 adjustable transformers, and 14 reactive power compensation devices [18]; the system is available in [36].
In this case, 342 lines are considered, and 17,100 sets are generated for the MSA-Lasso algorithm.

Base Load Conditions
Under the condition of N−1 contingencies in the IEEE 300-bus system, the values of security index PI c are computed by using two methods, which are respectively calculation by NPLF and prediction via the MSA-Lasso algorithm. The time for contingency screening and ranking by adopting the proposed module is 4.1732 s, while the computation time is 76.8578 s by using NPLF. Obviously, the proposal is available for online application. Some 60 branches accounting for more than 15% of all of the lines are randomly selected, which can represent different operating states of the power system. The results of PI c by adopting two ways, and the relative errors, are listed in Table 15 in the descending order of the NPLF method.
From the above table, it can be seen that the values of PI c obtained by adopting the two methods have similar ranking results, and the contingencies can also be screened. Thus, the conclusion can be drawn that the proposal is also effective for large-scale power systems.

Light and Heavy Load Conditions
For testing the effectiveness of the proposed method in light and heavy load conditions of the IEEE 300-bus system, the conditions of 80% and 110% of base load are respectively applied. The tested controlled variables are the same as those in Section 5.3.1. The ranking results of light and heavy conditions in descending order are shown in Table 16. From the values of the security indices in Table 16, a similar conclusion can be drawn that the rankings are almost unchanged, and increasing the loads will lead to serious consequences. What's more, the effectiveness of the proposal in the IEEE 300-bus system is verified.

Conclusions
In terms of fast and accurate contingency screening and ranking, an online static security assessment module based on a multi-step adaptive Lasso regression algorithm is proposed in this paper. The proposed approach is examined on the IEEE 14-bus, 118-bus, and 300-bus test systems, and the results indicate that this approach manages to handle this issue with reduced time, and is suitable for online application. The following conclusions can be drawn from the work: (1) Based on the online static security assessment module in this paper, the issues, which include operating state identifying and contingency screening and ranking, can be solved quickly and accurately. What's more, the operating state considers the impacts of transformers and compensation devices, and subsequently realizes better control of power systems. (2) Due to the proposed method not needing to calculate a large number of load flow under the conditions of contingencies and the MSA-Lasso algorithm having more accuracy than the other learning algorithm, it is suitable for an online assessment of the static security of power systems. (3) Considering the current various operating states of power systems, the proposed method analyzed different load conditions that varied from 50% to 150% of the base load. Through online static security assessment modules in different load conditions, the MSA-Lasso algorithm can assess the static security problems in the normal, light, and heavy load conditions. Future research will focus on considering parallel computation techniques in machine learning methods [12]. It will be interesting to develop an efficient version to improve the practicality of the presented approach for real-world applications. Moreover, with the increment of renewable energy and energy storage embedded into the power system [37][38][39], the research of static security assessment considering renewable energy and load uncertainty [40] and integrated energy systems [41] is a meaningful topic.

Conflicts of Interest:
The authors declare no conflict of interest.

OSSA
Online static security assessment SSA Static security assessment DSA Dynamic security assessment NRLF Newton-Raphson load flow Lasso Least absolute shrinkage and selection operator MSA-Lasso Multi-step adaptive least absolute shrinkage and selection operator ANN Artificial neural network SVM Support vector machine Y The vector consisting of responses X The input matrix that is formed by observations S The size of the training set The numbers of buses T The tap of transformer N T The numbers of adjustable transformer taps Q C The switching capacity of reactive power compensation capacitor N C The numbers of reactive power compensation capacitor banks PI c The composite security index