# Low-Rate Non-Intrusive Load Disaggregation with Graph Shift Quadratic Form Constraint
## 2 Methodology
### Two-Step Iterative Optimization Method  
Since appliance number \(N_{p}\) and the length of testing dataset \(N\)-\(n\) tend to be large, Equation (9) is difficult to solve as it involves a large set of optimization variables. In order to simplify the solving process, we propose a two-step iterative optimization method. The first step minimizes the regularization term to find the signal with minimum variation, and based on the total graph variation minimizer the second step iteratively minimizes both terms in Equation (9) using SA algorithm to find global optimal solution. In Step 1, to minimize the regularization term, we adopt the following method. First, the appliances are sorted according to the average power in a descending order. Then, we separate the appliances from aggregate power signal one by one in this order until all the appliances are separated. After an appliance is disaggregated, its power consumption is removed from the total load. Note that this method reduces the coverage to low power appliances, and the disaggregation accuracy is improved obviously. According to the above analysis, the problem of minimizing the regularization term can be transformed into solving an unconstrained quadratic optimization problem repeatedly as follows,  
\[\text{argmin}(\frac{1}{2}\|\mathbf{s}_{k}-\mathbf{E}^{norm}\mathbf{s}_{k}\|_{2}^ {2})=\text{argmin}(\frac{1}{2}\|(\mathbf{I}-\mathbf{E}^{norm})\mathbf{s}_{k}\|_ {2}^{2}) \tag{10}\]  
Let \(\mathbf{X}=\mathbf{I}-\mathbf{E}^{norm}\). Using the partitioned matrix computation, we can rewrite the smoothness term as,  
\[(\mathbf{I}-\mathbf{E}^{norm})\mathbf{s}_{k} =\left( \begin{array}{cccc|cccc}x_{11}&x_{12}&\cdots&x_{1n}&x_{1(n +1)}&\cdots&x_{1N}\\ x_{21}&x_{22}&\cdots&x_{2n}&x_{2(n+1)}&\cdots&x_{2N}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ x_{N1}&x_{N2}&\cdots&x_{Nn}&x_{N(n+1)}&\cdots&x_{NN}\end{array} \right)\left( \begin{array}{c}s_{k}(1)\\ \vdots\\ \hline s_{k}(n)\\ \vdots\\ s_{k}(N)\end{array} \right) \tag{11}\] \[=(\mathbf{N},\mathbf{W})\Bigg{(} \begin{array}{c}s_{k}(1:n)\\ s_{k}(n+1:N)\end{array} \Bigg{)}\] \[=\mathbf{M}\!\cdot\!\mathbf{s}_{k}(1:n)+\mathbf{W}\!\cdot\! \mathbf{s}_{k}(n+1:N)\]  
Since \(\mathbf{s}_{k}(1:n)\) has determined during training, \(\mathbf{M}\cdot\mathbf{s}_{k}(1:n)\) is a constant vector, denoted by \(\mathbf{\beta}\). Thus, the Equation (10) can be simplified as,  
\[\text{argmin}(\frac{1}{2}\|\mathbf{s}_{k}-\mathbf{E}^{norm}\mathbf{s}_{k}\|_{2 }^{2})=\text{argmin}(\|\mathbf{W}\cdot\mathbf{s}_{k}(n+1:N)+\mathbf{\beta}\|_ {2}^{2}) \tag{12}\]  
This is a typical unconstrained quadratic optimization problem with the well-known analytical solution [46],  
\[\mathbf{s}_{k}(n+1:N)=\mathbf{W}^{-1}\cdot\mathbf{\beta} \tag{13}\]  
Once \(\mathbf{s}_{k}(n+1:\!N)\) is determined, we can get the activation vector \(\mathbf{A}_{k}\) according to the mapping between \(s_{k}(i)\) and \(a_{k}(i)\). Then we can calculate the power variation of appliance \(k\) according to Equation (3). After appliance \(k\) has been disaggregated, its contribution to the total power variation is removed by subtracting \(\Delta p_{k}(i)\) from \(\Delta P(i)\), for \(i=1,2\cdots N\). We repeat the process of solving the unconstrained quadratic optimization problem for all appliances in the order of mean power from high to low. By minimizing the regularization term, we can get the optimal \(\mathbf{\alpha}^{*}(i)\), for \(i=n+1,\cdots,N\), which is also called the total graph variation minimizer. Although in Step 1 we obtain the total graph variation minimizer, it is easy to encounter the over-smooth phenomenon. In order to overcome this problem, in Step 2 we adopt the SA algorithm to minimize the objective function and constraint in Equation (9) iteratively and select the total graph variation minimizer as the initial point. In Ref. [40], the method of generating a candidate solution only guarantees to reduce the number of false positives (_FP_), but is unable to decrease the number of false negatives (_FN_).