A Novel Graphical Lasso based approach towards Segmentation Analysis in Energy GameTheoretic Frameworks
Abstract
Energy gametheoretic frameworks have emerged to be a successful strategy to encourage energy efficient behavior in large scale by leveraging humanintheloop strategy. A number of such frameworks have been introduced over the years which formulate the energy saving process as a competitive game with appropriate incentives for energy efficient players. However, prior works involve an incentive design mechanism which is dependent on knowledge of utility functions for all the players in the game, which is hard to compute especially when the number of players is high, common in energy gametheoretic frameworks. Our research proposes that the utilities of players in such a framework can be grouped together to a relatively small number of clusters, and the clusters can then be targeted with tailored incentives. The key to above segmentation analysis is to learn the features leading to human decision making towards energy usage in competitive environments. We propose a novel graphical lasso based approach to perform such segmentation, by studying the feature correlations in a realworld energy social game dataset. To further improve the explainability of the model, we perform causality study using grangers causality. Proposed segmentation analysis results in characteristic clusters demonstrating different energy usage behaviors. We also present avenues to implement intelligent incentive design using proposed segmentation method.
I Introduction
Energy consumption of buildings, both residential and commercial, account for approximately 40% of all energy usage in the U.S. [mcquade2009]. In efforts to improve energy efficiency in buildings, researchers and industry leaders have attempted to implement control and automation approaches alongside techniques like incentive design and price adjustment to more effectively regulate the energy usage [Konstantakopoulos:EECS2018139]. The heterogeneity of user preferences in regard to building utilities is considerable in variety and necessitates a system that can adequately account for differences from one occupant to another. With this in mind, focus has shifted towards modeling occupant behavior to incorporate their preferences in building control and automation [delzendeh2017the]. The behavior models can then be studied to introduce initiatives to encourage energy efficient behaviors among the occupants/energy users. Furthermore, the occupants of a building typically lack the independent motivation necessary to contribute to and play a key role in the control of smart building infrastructure. A building manager, acting as the connection between energy utilities and the end users, can encourage participation and energyefficient behavior among occupants in many ways. One of the successful methods proposed and improved over the years is a gametheoretic framework, which creates a friendly competition between occupants/users, motivating them to individually consider their own energy usage and hopefully, seek to improve it to have a better score/achieve a lucrative incentive in the game [konstantakopoulos2019deep].
Energy gametheoretic frameworks have proven to be capable of extracting the occupant behavior and possibly impacting a change in them by engaging the users in the process of energy management, integrating seamlessly through the use of cyberphysical technology by leveraging humansintheloop strategy [konstantakopoulos2019deep, zou2019consensus, Liu_thermal_comfort]. Such gametheoretic frameworks can be thought of as a sensoractuator system. Through their participation in the game (the sensor), the behavior of users is observed, which then is treated as the input to an incentive design process (the actuator). The incentives offered can motivate users to improve upon their energy usage behaviors to achieve better energy efficiency, signifying the importance of an intelligent incentive design in success of such frameworks. Although all such frameworks aim to achieve a long term or permanent improvement in the energy usage behaviors among the users, the aim is seldom achieved after the completion of energy game, mostly attributed to the lack of an intelligent and adaptive incentive design process. The incentive design process in prior works is dependant on utility functions of every player in the game, which is hard to compute as energy gametheoretic frameworks involve participation of a large number of energy users, and hence often approximated. Instead, the utility/energy usage behavior of the players in such a large scale frameworks can be segmented into a relatively small number of clusters, and incentives can be designed to tailor each cluster assuming players in a cluster behave synchronously. Energy utility companies frequently use such segmentation techniques for optimal planning of demand response, load shedding, and microgrid applications [energy_utility]. We consider the design of a smarter segmentation analysis as a solution for intelligent incentive design for energy gametheoretic frameworks as the objective of this research work.
The above goal can be achieved by learning the factors leading to human decisionmaking, and using the knowledge to devise a novel agent segmentation method. The segmentation analysis in an energy gametheoretic framework with high dimensional data requires powerful yet computationally efficient statistical methods. A possible candidate, Graphical Lasso algorithm [mainbook], has been widely applied on different scientific studies due to its sparsity property ( penalty term) and efficiency [glasso_biology, cvpr_scene]. The potential of Graphical Lasso can be innovatively combined with player segmentation. Towards this, we enable new avenues by combining both concepts and applying it on a social game data set[konstantakopoulos2019deep] to classify the energy efficiency behaviors among building occupants. We explore the causal relationship between different features of the agents using a versatile tool, Grangers Causality [granger1980testing], which leads to a deep understanding of decisionmaking patterns and helps in integrating explainable game theory models with adaptive control or online incentive design. With the advent of explainable Artificial Intelligence (AI), there has been a massive move towards making statistical models explainable. Thus we propose an explainable, rather than just a black box model. To summarize, our contributions are threefold:

[leftmargin=*]

Novel segmentation analysis using an explainable statistical model at the core towards learning agent’s (building occupants) features characterizing their decisionmaking in competitive environments.

Characterization of causal relationship among several contributed features explaining decisionmaking patterns in agent’s actions.

Introduction of possible avenues which can prove beneficial in improving building energy efficiency by using the proposed segmentation analysis method
Ii Related Work
Energy game theoretic frameworks have enabled an effective platform for incorporating energy efficient behavior among the building occupants in a smart building. They involve the important aspect of human participation in building control, otherwise lacking in many conventional modelling approaches including passive Hidden Markov Models (HMMs) [ai2014occupancy]. A number of such frameworks have been introduced over the years [konstantakopoulos2019deep, knol:2011aa, Dahleh2010smartCom], which have proven to have significant energy conservation during postgame period as compared to pregame period.
Just like nutritional requirements vary from one person to another, incentive designs must be tailored to be suitable for every player, to have an impact on their behaviors [konstantakopoulos2016inverse, konstantakopoulos2017leveraging, konstantakopoulos2018robust]. For such incentive design, above gametheoretic frameworks rely on knowledge of utility functions of the players in the game, which is hard to compute in the scenario of energy game theoretic frameworks due to the complexity and scale. Authors in [li:2014aa] propose a nashequillibrium based approach for utility estimation. In [ratliff2014social], authors formulate the utility estimation problem as a convex optimization problem by using firstorder necessary conditions for nash equilibria, and then create an affine map along with energy consumption to derive the utilities. All these methods are hard to scale when the number of players is high. Instead, we can segment the utilities of players into clusters by learning features characterizing human decisionmaking in competitive environments, and perform an incentive design for the clusters so obtained. We derive inspiration for agent segmentation owing to the fact that customer segmentation has been successfully utilized in energy systems [energy_utility]. The energy usage behavior exhibited by each player in a cluster is expected to be similar, which has statistical justification as the number of possible clusters in the data is computed using clustering algorithms.
Towards this we use high dimensional realworld data. We use the graphical lasso algorithm as a powerful tool to understand the latent conditional dependence between variables [mainbook]. This in turn provides insights into how different features interplay among each other. Historically, Graphical Lasso has been used in various fields of science, ranging from study of how individual elements of the cell interact with each other [glasso_biology] and to the broad area of computer vision for scene labelling [cvpr_scene]. A modified version of the original algorithm, named timevarying graphical lasso, has been used on financial and automotive data [HallacPBL17]. However, the novelties of graphical lasso has not been well utilized in the area of energy cyberphysical systems. We use Granger causality[granger1980testing] to explain the causal relationship between the features in energy usage behavior of agents in social game. It has been widely used in the energy domain in applications such as deducing the causal relationship between economic growth and energy consumption [chiou2008economic].
Knitting novel segmentation algorithms and their application to energy gametheoretic frameworks together, we employ graphical lasso algorithm for customer segmentation on social game dataset and present an explainable model, helpful both in understanding inherent factors leading to energy efficiency in buildings and in intelligent incentive design.
Iii Methods
Iiia Energy GameTheoretic Dataset
The dataset used for our work is from a energy social game experiment to encourage energy efficient resource consumption in a smart residential housing, as introduced in [konstantakopoulos2019deep]. Authors in [konstantakopoulos2019deep] designed a social game among occupants of residential student housing apartments at an university campus. They make use of Internet of Things (IoT) sensors to allow the occupants to monitor their room’s lighting (desk and ceiling light) and ceiling fan usage via a personal webportal account as they participate in the energy social game for maximizing their incentives. The above gametheoretic framework is modelled under the umbrella of a multiplayer noncooperative game. The dataset consists of perminute timestamped reading of each resource’s (desk light, ceiling light and ceiling fan) status, accumulated resource usage (in minutes) per day, resource baseline, gathered points (both from game and surveys), occupant rank in the game over time and number of occupant’s visits to the web portal. It also contains features related to time of day (morning vs. evening), time of week (weekday vs. weekend) and college schedule feature indicators for dates related to breaks, holidays, midterm and final exam periods. Additionally, the dataset incorporates the external weather metrics during the experimental run.
IiiB Tradeoff between Supervised/Unsupervised Segmentation
For the purpose of segmentation analysis, both supervised and unsupervised segmentation methods can be implemented on the social game dataset. Supervised methods require a label to classify data with similar labels together. For the dataset in hand, the label we have is the rank of the player in the game, which in turn indicates their energy efficiency characteristics as compared to other players in the game (i.e. a player with less rank is more energy efficient). We use rank as the label to classify players into different groups. But, such a classification method groups different players together as per their overall rank, and does not take into account the distribution of their energy efficiency characteristics across different scenarios such as time. For instance, Figure 1 shows the distribution of cumulative resource usage (in minutes/day) for a player having low rank (high energy efficiency) and a player having high rank (low energy efficiency), with some curve smoothing across a duration of the game period. It can be observed that the high energy efficient player performs suboptimally (uses more energy resources) between the times A and B than the low energy efficient player. In an ideal scenario, for every player, the data samples corresponding to low energy efficient behavior should be clustered separately than high energy efficient behaviors so as to have an accurate understanding of the interplay of features governing human decisions for energy efficiency. In this case, unsupervised clustering proves helpful and clusters together similar behaviors. But in this case, the output of unsupervised clustering is just a number of clusters with no labelling about the energy efficiency characteristics exhibited by that cluster. So, to summarize, supervised classification provides insight into an overall picture of how different classes of energyefficient players behave, but fails to capture the distribution of behaviors. On the other hand, unsupervised clustering captures the latter accurately, but does not provide any information on labels of the clusters generated. This poses a tradeoff between supervised classification and unsupervised clustering methods for application in energy game datasets.
IiiC Proposed Segmentation Method
The tradeoff mentioned in previous section signals to use the novelty of both unsupervised and supervised segmentation together to build an optimal model. Knitting together both the methods via a powerful tool, the graphical lasso algorithm, we present a novel methodology to perform segmentation in energy gametheoretic frameworks. We employ the kmeans algorithm for unsupervised clustering. First, the optimal number of clusters in the dataset is derived using elbow method and silhouette scores. An elbow plot is a plot between the distortion score (a measure of closeness of data points to their assigned cluster center) vs the number of clusters. The optimal number of clusters is determined to be corresponding to drastic change in the rate of reduction in distortion score. The elbow plot for energy social game dataset, obtained in an unsupervied manner is given in Figure 2. The optimal number of clusters is determined to be 3.
We also use another metric, the silhouette score to confirm the optimal number of clusters. The silhouette score , is a measure of how similar an object is to its own cluster compared to other clusters. A high value indicates that the object is well matched to its own cluster and poorly matched to neighboring clusters. The silhouette score corresponging to each number of clusters is given in Table I. Note that the score is the highest (shaded in blue) for the number of clusters as 3.
No. of Clusters  2  3  4  5 

Silhouette Scores  0.684  0.749  0.611  0.540 
Following this, we use Minibatch Kmeans algorithm with k= 3 (optimal number of clusters in the data) to obtain the clusters. Let the clusters obtained be represented by , and . Since the dataset correspond to energy usage behavior of the players, the three clusters so obtained correspond to high, medium and low energy efficient behaviors. We then use supervised classification and graphical lasso to label the unsupervised clusters. We divide the players into three classes in a supervised way taking the ranks of the users as the label.
Let the players be denoted by , , , and the data points corresponding to the player across time be , ,, . The whole range of ranks were divided into three equal segments, with the high, medium and low energy efficient rank groups being , and respectively.Let the classes be represented by , and , where the superscripts signify the energy efficiency behavior of each class. We assign the players to the classes as per the following formula, , where,
(1) 
where is the indicator function. This allocates each player into one of the three supervised classes. The behavior of a player in a particular class, e.g. represents the characteristic behavior of players showcasing high energy efficiency. Then the feature correlations in all the supervised classes and unsupervised clusters were studied using graphical lasso algorithm. Knowledge of feature correlation similarity among members of the supervised classes and unsupervised clusters is used to label the unsupervised clusters (, and ) as high/medium/low energy efficient. Finally, the labelled unsupervised clusters can be further explored for downstream tasks, such as incentive design. The whole process is illustrated in Figure 3.
Iv Graphical Lasso for Energy Social Game
In this section, we formulate a framework towards segmentation analysis that allows us to understand users decision making model. Specifically, we adopt graphical lasso algorithm [friedman2008sparse, mainbook] to study the way in which features in a energy gametheoretic framework interplay among each other.
Let the features representing the social game data be denoted by the collection . From a graphical perspective, can be associated with the vertex set of some underlying graph. The structure of the graph is utilized to derive inferences about the relationship between the features. We use the graphical lasso algorithm [mainbook] to realize the underlying graph structure, under the assumption that the distribution of the random variables is Gaussian.
Consider the random variable at . We use the NeighbourhoodBased Likelihood for graphical representation of multivariate Gaussian random variables. Let the edge set of the graph be given by . The neighbourhood set of is defined by
(2) 
and the collection of all other random variables be represented by:
(3) 
For undirected graphical models, node for is conditionally independent of nodes not directly connected to it given , i.e.
(4) 
The problem of constructing the inherent graph out of observations is nothing but finding the edge set for every node. This problem becomes predicting the value of given , or equivalently, predicting the value of given by the conditional independence property. The conditional distribution of given is also Gaussian, so the best predictor for can be written as:
(5) 
where is zeromean gaussian prediction error. The terms dictate the edge set for node s in the graph. We use regularized likelihood methods for getting a sparse . Let the total number of data samples available be N. The optimization problem is formulated as: corresponding to each vertex , solve the following lasso problem:
(6) 
The implementation of Graphical Lasso algorithm is summarized in Appendix.
V Results
As has been introduced in Section IIIC, we learn the feature correlations using graphical lasso algorithm in supervised classes , and to obtain the knowledge about factors governing human decision making towards various (high/medium/low) energy efficient behaviors.
Va Feature correlation learning in supervised segregation
We consider a representative player (selected as the player holding the median rank in the class) for each of the three classes obtained out of supervised segregation method described in Section IIIC to run graphical lasso and study the correlation between the features for that class. We group the features into different categories so as to study their influence on energy efficiency behaviors. Specifically, we consider Temporal features like time of the day, academic schedules and weekday/weekends, External features as outdoor temperature, humidity, rain rate etc. and Game Engagement features like frequency of visits to game web portal.
The feature correlations for a low energy efficient player is given in Fig 7. The player tries to use each resource independently which can be observed in Figure 7(a) with no correlation between the corresponding resource usage identifiers. There is a positive correlation between morning and desk light usage indicating heedless behavior towards energy savings. The absolute energy savings increase during the breaks and finals, given by positive correlation with total points, but it is not significant as compared to other players during the same period, thus increasing the rank. External parameters play a significant role in energy usage behavior of this class. The operation of the ceiling fan is driven by external humidity as given in Figure 7(b). Figure 7(c) indicates that their frequency of visits to the game web portal is motivated by suboptimal performance in the game.
Feature correlations for a medium energy efficient player is given in Fig 7. The player showcases predictable behaviors with correlations between desk light, ceiling light and ceiling fan usage (Figure 7(a)). The player cooptimizes the usage by alternating the use of ceiling and desk light. Different occasions like break, midterm and final are marked by energy saving patterns. Unlike a low energy efficient player, the player in this class tries to save energy in a conscious manner shown by reduced fan usage during the morning and reduced light usage during the afternoon. The fan usage is influenced by the external humidity, shown by Fig 7(b). The game engagement patterns for a player in this class (Fig 7(c)) is similar to that of the low energy efficient class.
Fig 7 shows the feature correlations for a high energy efficient player. This player also exhibits predictable behavior. Opportunistically, this player saves energy during breaks and midterms as shown by negative correlation between the corresponding flags and rank in Figure 7(a). Notice that there exists a negative correlation between midterm flag and total points, indicating decrease in absolute amount of points. However, the points are still higher than the points by other players which marks improvement in the rank. This behavior is completely opposite to what is exhibited by a player in low energy efficient class. The player is neither affected by the time of the day, nor by the external factors (Figure 7(b)) showing a dedicated effort to save energy. The game engagement behavior for this player, given in Figure 7(c) is inconclusive, possibly due to dominance by other energy saving factors.
Test whether causes  Fan Ceiling Light  Humidity Fan  Desk Light Fan  Ceiling Light Desk Light  Morning Desk Light  Afternoon Fan  Evening Ceiling Light  
Player type  pvalue  Fstatistic  pvalue  Fstatistic  pvalue  Fstatistic  pvalue  Fstatistic  pvalue  Fstatistic  pvalue  Fstatistic  pvalue  Fstatistic 
Low Energy Efficient  0.54  0.37  0.004  8.12  0.06  3.55  0.81  0.06  0.4  0.71  0.01  6.1  0  25.3 
Medium Energy Efficient  0  21.2  0.008  7.06  0  113.6  0  25.8  0.23  1.41  0.46  0.55  0.0007  11.5 
High Energy Efficient  0  21.9  0.12  2.36  0.99  0.003  0.93  0.007  0.63  0.22  0.04  4.2  0.52  0.41 
VB Causal Relationship between features
To ensure the correctness of results in Section VA and to enhance the explainable nature of our model, we studied the causal relationship between features using Granger causality test. Granger causality is a statistical test used to determine causal relationship between two signals. If signal A grangercauses signal B, then past values of A can be used to predict B for future timesteps beyond what is available for B. The results for causal relationship study is given in Table II. Under null hypothesis , does not Grangercause . So, a pvalue lower than (5% significance level) indicates a strong causal relationship between the tested features and implies rejecting the null hypothesis .
The pvalues (shaded in blue) for which Granger causality is established are highlighted in the table. Interestingly, for medium and high energy efficient building occupants, ceiling fan usage causes ceiling light usage. This in fact confirms the predictive behavior for them as mentioned earlier. In both low and medium energy efficient building occupants, external humidity causes ceiling fan usage. This is an indicator that their energy usage is affected by external weather conditions. However, for high energy efficient building occupants external humidity doesn’t cause ceiling fan usage. This shows that they are highly engaged with the proposed gamification interface and try to minimize their energy usage. Another interesting result is that the evening label causes ceiling light usage for both low and medium energy efficient building occupants. But this is not the case for high energy efficient building occupants, for whom ceiling light usage is better optimized as a result of their strong engagement with the ongoing social game, eventually leading to exhibition of better energy efficiency.
VC Labelling unsupervised clusters using feature correlation knowledge from supervised classification
We also learn the feature correlations in clusters obtained from unsupervised clustering of data in Section IIIC. Based on the feature correlation knowledge gained from different supervised classes in Section VA, we label the clusters as having low, medium or high energy efficient data. As an illustration, the feature correlations for is shown in Fig 7. It is evident from Fig 7(a) that data in exhibit predictability in behavior with correlations between resource usage flags. Also the weekdays are marked by energy savings in terms of decrease in fan usage minutes. The time of the day is also unrelated to the performance. Neither do the external factors contribute to the performance (Figure 7(b)). The engagement in the game also boosts the points (Figure 7(c)). All the above behaviors are indicative of the similarity between the energy efficiency characteristics manifested by and the high energy efficient class obtained using supervised segregation (). So, is labelled as the high energy efficient cluster. Following the same comparison, and are labelled as the medium and low energy efficient clusters respectively.
To further strengthen our inference, we compute the similarity using Pearson Correlation and RV coefficient [robert1976a] between the feature correlation matrices in unsupervised clusters and supervised classes. Figure 8 showing the result of above operation confirms our earlier assignment of labels to the unsupervised clusters, i.e. { Medium Energy Efficient},{ Low Energy Efficient} and { High Energy Efficient}. The labelled unsupervised clusters are the final segments that can be used for a number of downstream tasks as discussed in Section VI.
Vi Conclusion and Future Work
A general framework for segmentation analysis in energy gametheoretic frameworks was presented in this research work. The analysis included clustering of agent behaviors and an explainable statistical model representing the contributed features motivating their decisionmaking. To strengthen our results, we examined several feature correlations using granger causality test for potential causal relationships. Coupled with the statistical justification and explainable nature, the proposed method can provide characteristic clusters demonstrating different energy usage behaviors, following which, specific incentives can be designed for each cluster.
There are several directions for future research. Our ultimate goal for the segmentation analysis is to improve the gamification methodology, to simultaneously learn occupant preferences while also opening avenues for feedback, as static programs for encouraging energy efficiency are less efficient with passing of time [schipper:2000aa]. So, an improved version of energy social game, similar in structure to that of [konstantakopoulos2019deep] but with intelligent incentive design and privacy preserving techniques [jia2018poisoning] can be implemented, with building occupants and managers interaction modeled as a reverse stackelberg game (leaderfollower) in which there are multiple followers that play in a noncooperative game setting [ratliff2014social]. By leveraging proposed segmentation analysis, an adaptive model can be formulated that learns how user preferences change over time, and thus generate the appropriate incentives. Furthermore, the learned preferences can be adjusted through incentive mechanisms [ratliff2018adaptive] and a tailored meanfield game approach [gomes2018mean] to enact improved energy efficiency. Above two operations can be carried out in a tree structure, with segmentation carried out in regular intervals in each of the tree branches, as depicted in Figure 9. This can be coherently designed with other smart building systems [zou2019machine, zou2019wifi, liu2019personal, biscuit]. Summing up, this would result in a novel mechanism design, effectively enabling variation in occupant’s behaviors, in order to meet, for instance, the requirements of a demand response program. Another line of future work can be to study the delayed impacts of energy social game and design it accordingly to achieve long term energy efficiency, like a research in same line [liu2018delayed].
Vii Acknowledgments
This research is funded by the Republic of Singapore’s National Research Foundation through a grant to the Berkeley Education Alliance for Research in Singapore (BEARS) for the SingaporeBerkeley Building Efficiency and Sustainability in the Tropics (SinBerBEST) Program. BEARS has been established by the University of California, Berkeley as a center for intellectual excellence in research and education in Singapore. The work of I. C. Konstantakopoulos was supported by a scholarship of the Alexander S. Onassis Public Benefit Foundation.
References
Appendix
A. Description of Graphical Lasso algorithm
Algorithm 1: GRAPHICAL LASSO ALGORITHM FOR
GAUSSIAN GRAPHICAL MODELS

For vertices :

Calculate initial loss

Untill Convergence:

Calculate partial residual = 

For all , Get =

Compute new loss =

Update =


Get the neighbourhood set (s)= supp() for s


Combine the neighbourhood estimates to form a graph estimate ) of the random variables.
is soft thresholding operator as .
For optimal design of penalty factor in Graphical Lasso run for a vertex s, we take 10 values in logarithmic scale between and as given below and conduct a line search to find the penalty factor which brings the minimum loss.
(7) 
Implementing a coordinate descent approach [mainbook], the time complexity of the proposed algorithm is for a complete run through all features. We also do 5fold cross validation to ensure accurate value of the coefficients . Use of partial residuals for each node significantly reduces the time complexity of the algorithm.