# Game of LLMs: Discovering Structural Constructs in Activities using Large
Language Models

Shruthi K. Hiremath<EMAIL_ADDRESS>0000-0003-4317-8864 School of
Interactive Computing, Georgia Institute of Technology, AtlantaE1566B. CODA
15th Floor, Georgia Institute of TechnologyAtlantaGeorgiaUSA30308 and  Thomas
Plötz<EMAIL_ADDRESS>0000-0002-1243-7563 School of Interactive
Computing, Georgia Institute of Technology, AtlantaE1564B. CODA 15th Floor,
Georgia Institute of TechnologyAtlantaGeorgiaUSA30308

(2024; 2024; 14 June 2024; 14 June 20249; 14 June 2024)

###### Abstract.

Human Activity Recognition is a time-series analysis problem. A popular
analysis procedure used by the community assumes an optimal window length to
design recognition pipelines. However, in the scenario of smart homes, where
activities are of varying duration and frequency, the assumption of a constant
sized window does not hold. Additionally, previous works have shown these
activities to be made up of building blocks. We focus on identifying these
underlying building blocks–structural constructs, with the use of large
language models. Identifying these constructs can be beneficial especially in
recognizing short-duration and infrequent activities. We also propose the
development of an activity recognition procedure that uses these building
blocks to model activities, thus helping the downstream task of activity
monitoring in smart homes.

smart homes, activity recognition, ML, large language models

††copyright: acmlicensed††journalyear: 2024††doi:
XXXXXXX.XXXXXXX††journalyear: 2024††copyright: acmcopyright††conference: Human
Activity Sensing Corpus and Applications; October 7-9 2024; Melbourne,
Australia††ccs: Human-centered computing Ubiquitous and mobile computing††ccs:
Computing methodologies Machine learning††ccs: Human-centered computing
Empirical studies in ubiquitous and mobile computing

##  1\. Introduction

Developing human activity recognition systems for ambient settings–such as
smart homes–is essential to providing assistance, aid and support to residents
(Asadzadeh et al., 2022; Bouchabou et al., 2021). Prior works have shown that
such applications provide support for diverse populations – from monitoring
activities of the elderly population to technologically assisting the
“sandwich generation” in their daily life (Majumder et al., 2017; Pal et al.,
2018; Burke, 2017; Pashazade et al., 2023). With the decrease in automation
costs and ease of instrumenting smart homes, collecting data in these
environments has become a possibility for many (Crandall and Cook, 2012; Gazis
and Katsiri, 2021; Belley et al., 2014). Advancements in the design of
methodologies to analyze data provide for robust recognition pipelines (Guan
and Plötz, 2017; Deldari et al., 2022; Tang et al., 2021).

Challenges exist in analyzing data collected in smart homes. A popular
approach in the wearable community (data with constant sampling rates) is to
use the Activity Recognition Chain (ARC) (Bulling et al., 2014; PlÖtz, 2021)
that assumes frames of an identified window length to be independently and
identically distributed (i.i.d.) – which are then used to learn a recognition
procedure. Owing to the non-constant sampling rates of data collected, varying
duration and patterns of activities, the assumption of i.i.d. does not hold
for data collected in smart homes. Thus a straightforward approach to pre-
process the data does not exist.

In this work, we address the aforementioned challenge, specifically through
the identification of underlying structural constructs that make up activity
sequences collected in the home. Structural constructs are defined as the
underlying unique sub-units or components that either constitute an activity
or are relevant to it. For example, the activity of ‘Bed to Toilet’ will be
made of underlying constructs such as i) wake up (sensor event in the bedroom
triggers); ii) use bathroom (sensor in bathroom); and, iii) go back to bed /
get ready for day (sensor event trigger elsewhere in home). Existing smart
home simulators e.g. VirtualHome (Puig et al., 2018) use similar constructs
(defined as categories) to generate data for a given activity, used to train
robots assisting residents.

We use Large language models (LLMs) to automatically identify these underlying
constructs. With the advancements in LLMs, trained on internet-scale corpora,
the consensus in the community is that these models rely on a semantic
understanding of the underlying text to learn contextual mappings (Zhao et
al., 2023; Minaee et al., 2024). Prior work (Hiremath et al., 2022) has shown
the importance of capturing local context through learning an embedding using
the BERT pre-trained model. In this work we extend this idea of using context,
and scale it to include global information.

Utilizing the capabilities of LLMs to generate text, we construct coherent
paragraphs corresponding to sensor event triggers, where individual input
sentences include information corresponding to location and time. A summary is
generated from the multiple sensor event triggers corresponding to a given
activity. In a “game of LLMs”, we use one family of LLMs to generate these
coherent paragraphs whereas another family of LLMs is then used to query for
the underlying structural constructs.

Through our explorations on the publicly available CASAS benchmark datasets
(Cook et al., 2012), we aim to identify i) which of the activities recorded in
the homes are made of the hypothesized underlying constructs; and, ii)
categories of underlying constructs – whether they are action-based or event-
based. In the case of most activities of interest, constructs that are logical
and relevant to the activity of interest are identified. The action-based
constructs are listed in the sequence of occurrence that characterizes the
corresponding activity. Practitioners can analyse the shortcomings of those
activities where relevant constructs are not identified, to improve
instrumentation of future homes.

##  2\. Related Work

In the following section, we situate our proposed approach in related work
that identifies components of activity sequences known as sub-units, action
units, events etc., to improve the performance of the activity recognition
task. We aim to utilize the capabilities of large language models in
identifying the aforementioned temporal constructs in the application scenario
of smart homes.

###  2.1. Temporal Constructs in Sequential Data

The activity recognition task is to identify activities of interest from
continuous data streams. Given the sequential nature of activities, approaches
are required that model their temporal nature (Hiremath and Ploetz, 2021; Shao
et al., 2024). Literature from the domains of hand-writing recognition, speech
recognition and natural language processing, consider units of analysis that,
when analyzed over longer context windows, are classified into relevant
classes of interest (Plötz and Fink, 2009). Similarly, in sensor based HAR
activities comprise of units of analysis. Most work in sensor-based HAR, uses
the same context length – frames – for both feature extraction and sequence
modeling for activity classification (Bulling et al., 2014). While this has
shown to perform well through empirical research (Dehghani et al., 2019; Bock
et al., 2021; Gupta, 2021), the assumption that each of the units of analysis
are independently and identically distributed may not necessarily hold.
Statistical analysis has revealed that adjacent segments of time-series data,
result in neighborhood bias, and further influence performance estimates. This
is observed due to adjacent frames of a given activity instance, which are
highly similar appearing in both the train and test sets during the evualation
of the activity recognition system (Hammerla and Plötz, 2015).

As observed in gesture-based HAR systems, complex gestures are known to
comprise of individual components (Mantyla et al., 2000). Once identified such
components are modeled using sequential procedures like HMMs, LSTMs, or RNNs
in general (Guan and Plötz, 2017; Ordóñez and Roggen, 2016). Previous work
showcases the benefit of using smaller length segments to learn features and
longer length sequences over an extended context to model activities (Hiremath
and Ploetz, 2021). More recently, in (Shao et al., 2024) authors use attention
from intra- and inter- frame attention to learn characteristics within
individual frames and to capture longer contextual relationships across
multiple frames. These developed approaches showcase the benefits of
identifying the underlying units and in capturing the temporal dynamics of
activities to improve the performance of the recognition task. Discovering
motifs in underlying sensor data, uses the Piece-wise Linear Aggregation (PAA)
and Symbolic Aggregate approximation (SAX) to identify re-occurring units of
signal data, which have been beneficial for both the activity recognition and
discovery procedures (Lkhagva et al., 2006; Yu et al., 2019; Li, 2015). In the
realm of smart homes, actions units are learnt over analysis windows (Hiremath
et al., 2022), deemed to identify underlying movement patterns in the home.
Motif models are learnt over these action units to identify relevant sub-
sequences of action units, that are used to perform activity recognition. More
recently work in (Haresamudram et al., 2024) uses a vector quantization
process via self-supervision to identify these underlying units of analysis
(Makhoul et al., 1985; Jaiswal et al., 2020; Misra and Maaten, 2020).

##  3\. Discovering Structural Concepts in Activities using LLMs

The key idea of the proposed analysis method is to identify underlying
structural constructs that make up activity sequences, which can be further
utilized to build an activity recognition system for smart homes. It comprises
of designing prompts fed into one family of LLMs–GPT-4 (Open AI)–and obtaining
constructs from a different family of LLMs – Gemini (Google DeepMind). In the
following sections we provide details about the LLMs used, the summarization
procedure and the process of identifying the structural constructs.

Figure 1. Overview of the proposed system. The proposed approach identifies
the underlying structural concepts of activities observed in the smart home.
First sentences detailing sensor event triggers are generated using
information such as location and time of occurrence of activity (Thukral et
al., 2024). Next a family of LLMs (GPT-4) is used to obtain a summarized
version of varied instances of these activities. Subsequently, another family
of LLMs (Gemini) is queried to identify the structural constructs.

###  3.1. Large Language Models

We briefly discuss the large language models employed in this work below – one
for summarization (GPT-4) and the other for query (Gemini) to counter biases
arising from training datasets used, model architectures optimized etc. (Carlà
et al., 2024; Rane et al., 2024) for each of these LLMs.

LLM Family 1 – GPT-4:  GPT-4 is a large language model developed by OpenAI,
built on the foundation of the GPT (Generative Pre-trained Transformer)
architecture (Achiam et al., 2023; Peng et al., 2023; Sanderson, 2023). It’s
designed to engage in conversation, answer questions, generate text based on
prompts, and perform various language-related tasks. The model learns from
large datasets of text from the internet, allowing it to generate human-like
responses across a wide range of topics. GPT-4’s architecture involves
multiple layers of transformers, a type of neural network architecture that
has been particularly successful in natural language processing (NLP) tasks.
GPT-4 (and it’s previous versions) are generative language models that can
create content, offer explanations and provide assistance across diverse tasks
and topics. These transformers are trained on vast amounts of text data to
learn patterns and relationships within language, enabling GPT-4 to generate
coherent and contextually relevant responses.

LLM Family 2 – Gemini:  Gemini references a family of Large Language Models
(LLMs) which is the core technology behind several Google products (McIntosh
et al., 2023; Team et al., 2024). It’s a powerful AI system capable of
understanding and responding to different kinds of information, including
text, code, audio, images, and video. Launched in December 2023, it succeeds
previous models like LaMDA and PaLM 2. There are three variations: i) Gemini
Ultra; ii) Gemini Pro; and, iii) Gemini Nano. We used Gemini Pro in this work.

###  3.2. GPT-4: Activity summarization

To generate a summarized description of a given activity, the capabilities of
GPT-4 are utilized. Multiple paragraphs describing activity instances for a
given activity are input to the LLM. On observing these descriptions the LLM
is asked to produce a summary, where the idea is that this summary captures
the important aspects of the given activity. The prompt is as below:

> You are an AI assistant that is helping in generating a summary from diverse
> texts and adding a context to each sensor readings leveraging world
> knowledge
>
> Please generate short summarized text (1) from the paragraphs of given
> activity descriptions. Ignore the temperature sensors. Retain the time of
> occurrence of activity. You will be given different paragraphs of the
> activity.
>
> The input has format: (Paragraph: Text detailing sensor event triggers for
> given activity). The output should be a json (key: (activity)) containing
> the summarized paragraph.

Sensor event triggers for an activity instance are converted to sentences
using the procedure in (Thukral et al., 2024). Each sensor event is mapped to
a location and sensor type. The location for the sensor event trigger is
obtained from annotations described in (Hiremath et al., 2022; Thukral et al.,
2024). Although we encode the temperature sensors while constructing these
sentences, following previous work in (Prankit et al., 2020) we ask the LLM to
ignore this information when generating the summary. These sensors record
changes in temperature observed in the smart home and do not capture movement.
The time of occurrence of an activity provides context information, shown to
be an important indicator for some activities (e.g., Bed to Toilet) is
retained while generating the summary. Time between consecutive sensor event
triggers is computed and added to the sentence.

###  3.3. Gemini: Identifying activity specific structural constructs

Next, we use Gemini to query for the underlying constructs from the summarized
activity text. We switch to a different family of LLMs to avoid bias arising
from prompting and querying from the same LLM (GPT-4). Model bias is
categorized as: i) embedding-based; ii) probability-based; and, iii) generated
text-based (Gallegos et al., 2024). The summarized text for a given activity
is provided as input, but the label of the activity is withheld.

> You are an AI assistant helping with identifying categories of a summarized
> activity leveraging world knowledge." The summary of the given activity is
> (summary)." Can you provide the sub-actions that make up this activity?"

An example summarized activity text (from GPT-4) for an activity of of
Meal_Preparation (in CASAS-Aruba) is as follows - ‘On multiple occasions, the
motion sensor in the Kitchen and the area between the Kitchen and Dining area
were triggered, indicating activity consistent with meal preparation. The
sensors were activated at various
times throughout the day, with notable activity around 5:30 PM and 6:54 PM, as
well as in the morning hours. The motion was detected as someone moved around
the Kitchen, likely cooking or preparing food, and
occasionally moving to the Dining area, possibly to set the table or gather
supplies. Temperature sensors, which are to be ignored, sporadically reported
changes, but these do not directly correlate with the meal
preparation activity.’

##  4\. Experimental Evaluation

We hypothesize that the discovery of underlying structural constructs in
activity patterns is beneficial to activity recognition. Through this work we
identify and categorize these constructs and propose a method to combine these
identified concepts in future work. Technical foundations can be explored to
develop the sequential modeling procedure, built on identified constructs.

###  4.1. Datasets and Data Pre-Processing

(a) CASAS-Aruba

(b) CASAS-Milan

Figure 2. Floor plans for Smart Homes used for our experimental evaluation:
(a) CASAS-Aruba and (b) CASAS-Milan (taken with permission from (Cook et al.,
2012)). Annotations for locations are used with permission from (Hiremath et
al., 2022).

Our explorations in this work are based on publicly available benchmarked
datasets, collected as part of the Center of Advanced Studies in Adaptive
Systems (CASAS), with ground truth annotations provided by residents (Cook et
al., 2012). We specifically use the CASAS-Aruba and CASAS-Milan datasets,
where data is collected over a span of 219 and 92 days, respectively. Home
layouts (with location specifications) of these datasets is shown in Fig. 2.
Both these are single-resident households, however, CASAS-Milan also houses a
pet. The number of activities analyzed to identify constructs are listed in
Tab. 1 and 2. Activities from the dataset have been combined according to
previous work in (Liciotti et al., 2020; Thukral et al., 2024). We ignore the
‘Other’ (‘null’) class since this is representative of background data we are
not interested in.

Data in these homes is collected through ambient sensors – Motion (denoted as
‘M###’), Door (denoted as ‘D###’) and Temperature (denoted as ‘T###’). The
states of the Door sensors are either OPEN or CLOSE and those of the Motion
sensors are either ON or OFF. Motion detection varies between localized areas
and detection over a wider area, whereas door sensor triggers when using the
various instrumented doors in the home. Temperature sensors record changes in
the home, but do not capture movement. In order to generate summaries of
activity sequences we use contextual information such as absolute timestamps
and location information as in previous works (Hiremath et al., 2022; Thukral
et al., 2024).

###  4.2. Determining Structural Concepts

The identification of structural constructs is a three step procedure – i)
encode sensor event triggers as sentences; ii) generate a summary of an
activity by using ‘n’ varied sentences corresponding to the given activity
(LLM1); and, iii) use the summary to query for discovery of structural
constructs (LLM2).

A large number of such encoded sentences (where ‘n’ is the maximum number of
sentences that could be provided) are input to LLM1 for summarization. The
constructs identified are further classified into two categories: i) event-
based constructs; and, ii) action-based constructs. Event-based constructs are
representative of sub-actions that do not necessarily follow a sequence of
occurrence. For example, in CASAS-Aruba, “Relax” identified ‘Sitting’ and
‘Walking’ as sub-actions, which do not have to be in that particular order.
Action-based constructs represent sub-actions that are commonly known to
follow a sequence of occurrence. “Bed_to_Toilet” clearly identified sub-
actions that must occur in the sequence they generated. The decision of
category for the constructs is based on the description in the generated
summary. Identified constructs and their corresponding categories are listed
in Tab. 1 and Tab. 2 for the CASAS-Aruba and CASAS-Milan datasets,
respectively. Constructs in green depict those that are relevant to the
activity. Filtering and clarification procedures need to be employed for
constructs not relevant to an activity (depicted in red). An interesting
observation is for ‘Take_Medicine’, where identified constructs are related to
the activity of accessing and taking medicine, yet, isn’t identified as a sub-
action in itself (in the absence of specific contextual triggers – such as
opening kitchen / medicine cabinet).

Although, this work is aimed at delivering a proof-of-concept to identify
constructs, it is not straightforward to validate them, given the absence of
ground truth at this granularity. However, as in (Rashidi and Cook, 2009), a
resident in the loop, through an active learning procedure can be asked to
confirm both: i) the number of identified constructs; and, ii) category of the
constructs determined. For the action-based constructs, the first identified
sub-action provides a start-up trigger (and to possibly model time duration) –
thus, providing the necessary contextual information to identify an activity.
Previous work in (Rashidi and Cook, 2009) required domain knowledge to do
this, which is now possible with the use of LLMs.

Table 1. Identified Structural Constructs for CASAS-Aruba. Color coding for the constructs is explained in text. Activity |  Identified Structural Constructs |  Type of constructs
---|---|---
Sleeping |  1\. Sleeping(periods of no movement, interspersed with periods of movement. The temperature readings remain relatively stable throughout; 2. Movement (motion sensor activity; moving around in the area between the living room and home entrance aisle); 3. Rest(associated with the periods of no movement) |  Event
Meal_Prep |  1\. Gathering ingredients; 2. Preparing ingredients (e.g., chopping, slicing, dicing); 3. Cooking ingredients (e.g., boiling, frying, baking); 4. Setting the table; 5. Serving the meal |  Action
Relax |  1\. Sitting; 2. Walking |  Event
Work |  1\. Movement(motion sensor is triggered frequently, indicating movement or presence in the area); 2. Sensor switching(suggesting continuous activity); 3. Work-related tasks(likely work-related, as it is taking place in an office space) |  Event
Eating |  1\. Food preparation; 2.Cooking; 3. Eating; 4.Cleaning up |  Action
Bed_to_Toilet |  1\. Getting out of bed; 2. Walking to the toilet; 3. Using the toilet 4\. Walking back to bed or starting the day |  Action
Enter_Home |  1\. Open door; 2. Enter home; 3. Close door; 4.Move within entrance area |  Action
Leave_Home |  1\. Open door; 2. Exit home; 3. Close door |  Action
Housekeeping |  No summary generated from LLM1 |  –
Table 2. Identified Structural Constructs for CASAS-Milan. Color coding for constructs is explained in text. Activity |  Identified Structural Constructs |  Type of constructs
---|---|---
Sleeping |  1\. Go to bed; 2. Sleep; 3. Waking up briefly; 4. Visiting the kitchen; 5. Visiting the bathroom |  Event
Kitchen_Act |  1.Cooking (sensors near stove); 2. Refrigeration (sensor near fridge); 3. Movement (sensors near corridor, dining room, living room); 4. Door opening/closing (kitchen door sensor activation) |  Event
Guest_Bath |  1\. Entering the guest bathroom; 2. Using the toilet; 3. Using the shower; 4. Washing hands; 5. Exiting the guest bathroom |  Action
Read |  1\. Motion in living room; 2. Temperature changes in the kitchen and corridor (to be ignored); 3. Movement in the dining room and near the home entrance; 4. Interactions with the slider door in the living room |  Event
Master_Bath |  1\. Dressing; 2. Personal hygiene |  Event
Master_Bed |  1\. Getting dressed; 2. Getting ready for the day; 3. Getting ready for bed; 4.Using the closet space |  Event
Watch_TV |  1\. Sitting on couch; 2. Getting up to adjust TV; 3. Changing channels; 4. Talking to others; 5. Use restroom or get a drink |  Event
Desk_Act |  1\. Working; 2. Studying; 3. Using a computer |  Event
Dining_Act |  1\. Eating; 2. Socializing; 3. Cleaning |  Event
Leave_Home |  1\. Leave home preparation (person moved around the entrance and living room, possibly gathering belongings or preparing to leave); 2. Open Door (opened entrance door); 3. Exit Home (sensor near entrance); 4. Close Door (Close entrance door) |  Action
Take_Med |  1\. Preparing Food; 2. Cleaning; Other kitchen tasks (getting food; groceries; meals) |  Event
Meditate |  1\. Motion in quest bedroom; 2. Movement throughout the living room, dining room, and kitchen area; 3. Return to the guest bedroom |  Event
Bed_to_Toilet |  1\. Get out of bed; 2. Walk to the walk-in closet; 3. Walk to the bathroom; 4. Use the bathroom; 5. Walk back to the walk-in closet; 6. Walk back to bed |  Action

###  4.3. Utility of Identified Constructs: Activity Recognition

In (Bettadapura et al., 2013), authors define an activity as a finite sequence
of events observable through videos. Regular expressions are sampled from
these events through a probabilistic approach to match to the activity
patterns observed in the datasets. These expressions are used in the
recognition procedure to identify activities and anomalies in a video based
surveillance systems.

Data collected in smart homes is hypothesized to be made of similar
“observable” events, yet these are not readily available. We use LLMs to
identify these underlying events. We envision the use of regular expressions
as in (Bettadapura et al., 2013) for activity recognition in smart homes.

##  5\. Discussion and Future Work

In this work we provided a proof-of-concept that establishes the existence of
underlying structural constructs in activity sequences. Prior work has been
successful in identifying the most frequently occurring activities, and
improvements over segmentation boundaries through a maintenance procedure for
these identified activities (Hiremath et al., 2022). However, recognition of
the short-duration and infrequent activities is a challenge. Our results in
this work successfully identify the events that make up these challenging
activities. Through mapping discretized data streams (Haresamudram et al.,
2024) and the constructs identified (this work), as described in Sec. 4.3
((Bettadapura et al., 2013)) identifying these activities can be possible.
Concepts identified through this work can be extended beyond the task of
activity recognition and can be used for assessing routines in homes.

The prompts provided to both LLMs – for summarization and query – are
straightforward in the tasks they are expected to do. Improvements to these
prompts will be explored in future work. For example, LLMs are known to
perform well when fine-tuned for specific tasks with (input, output) pairs of
data. LLMs have been known to provide illogical (or nonsensical) responses
((King et al., 2024; Leng et al., 2024)), and thus filtering procedures are
generally employed. We aim to investigate both the fine-tuning and filtering
procedures. Additionally, we summarized activity sequences to compute one
activity summary. Due to restrictions on the number of queries to the API’s,
we generate queries on a subset of all instances for a given activity.
Identifying a way to generate a comprehensive summary over all activity
instances is to be explored.

##  6\. Conclusion

We have experimentally evaluated and confirmed our hypothesis that activity
sequences are made up of structural constructs. Our experimental procedures
identify these constructs using two publicly available smart home datasets. We
used two families of LLMs to do this, wherein, the first family is used to
summarize the sensor event triggers observed in the home, whereas the second
family of LLMs is used to identify the structural constructs. Further, we
propose construction of a recognition pipeline using the identified
constructs.

## References

  * (1)
  * Achiam et al. (2023) Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. 2023\.  Gpt-4 technical report.  _arXiv preprint arXiv:2303.08774_ (2023).
  * Asadzadeh et al. (2022) Mohammad Asadzadeh, Ali Maher, Mehrnoosh Jafari, Khalil A Mohammadzadeh, and Seyed Mojtaba Hosseini. 2022.  A review study of the providing elderly care services in different countries.  _Journal of Family Medicine and Primary Care_ 11, 2 (2022), 458–465.
  * Belley et al. (2014) Corinne Belley, Sebastien Gaboury, Bruno Bouchard, and Abdenour Bouzouane. 2014.  An efficient and inexpensive method for activity recognition within a smart home based on load signatures of appliances.  _Pervasive and Mobile Computing_ 12 (2014), 58–78.
  * Bettadapura et al. (2013) Vinay Bettadapura, Grant Schindler, Thomas Plötz, and Irfan Essa. 2013.  Augmenting bag-of-words: Data-driven discovery of temporal and structural information for activity recognition. In _Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition_. 2619–2626.
  * Bock et al. (2021) Marius Bock, Alexander Hölzemann, Michael Moeller, and Kristof Van Laerhoven. 2021.  Improving deep learning for HAR with shallow LSTMs. In _Proceedings of the 2021 ACM International Symposium on Wearable Computers_. 7–12.
  * Bouchabou et al. (2021) Damien Bouchabou, Sao Mai Nguyen, Christophe Lohr, Benoit LeDuc, and Ioannis Kanellos. 2021.  A survey of human activity recognition in smart homes based on IoT sensors algorithms: Taxonomies, challenges, and opportunities with deep learning.  _Sensors_ 21, 18 (2021), 6037.
  * Bulling et al. (2014) Andreas Bulling, Ulf Blanke, and Bernt Schiele. 2014.  A tutorial on human activity recognition using body-worn inertial sensors.  _ACM Computing Surveys (CSUR)_ 46, 3 (2014), 1–33.
  * Burke (2017) Ronald J Burke. 2017.  The sandwich generation: individual, family, organizational and societal challenges and opportunities.  _The sandwich generation_ (2017), 3–39.
  * Carlà et al. (2024) Matteo Mario Carlà, Gloria Gambini, Antonio Baldascino, Francesco Boselli, Federico Giannuzzi, Fabio Margollicci, and Stanislao Rizzo. 2024.  Large language models as assistance for glaucoma surgical cases: a ChatGPT vs. Google Gemini comparison.  _Graefe’s Archive for Clinical and Experimental Ophthalmology_ (2024), 1–15.
  * Cook et al. (2012) Diane J Cook, Aaron S Crandall, Brian L Thomas, and Narayanan C Krishnan. 2012.  CASAS: A smart home in a box.  _Computer_ 46, 7 (2012), 62–69.
  * Crandall and Cook (2012) Aaron S Crandall and Diane J Cook. 2012.  Smart Home in a Box: A Large Scale Smart Home Deployment.. In _Intelligent Environments (Workshops)_. 169–178.
  * Dehghani et al. (2019) Akbar Dehghani, Omid Sarbishei, Tristan Glatard, and Emad Shihab. 2019.  A quantitative comparison of overlapping and non-overlapping sliding windows for human activity recognition using inertial sensors.  _Sensors_ 19, 22 (2019), 5026.
  * Deldari et al. (2022) Shohreh Deldari, Hao Xue, Aaqib Saeed, Jiayuan He, Daniel V Smith, and Flora D Salim. 2022.  Beyond just vision: A review on self-supervised representation learning on multimodal and temporal data.  _arXiv preprint arXiv:2206.02353_ (2022).
  * Gallegos et al. (2024) Isabel O Gallegos, Ryan A Rossi, Joe Barrow, Md Mehrab Tanjim, Sungchul Kim, Franck Dernoncourt, Tong Yu, Ruiyi Zhang, and Nesreen K Ahmed. 2024.  Bias and fairness in large language models: A survey.  _Computational Linguistics_ (2024), 1–79.
  * Gazis and Katsiri (2021) Alexandros Gazis and Eleftheria Katsiri. 2021.  Smart home IoT sensors: Principles and applications a review of low-cost and low-power solutions.  _International Journal on Engineering Technologies and Informatics_ 2, 1 (2021), 19–23.
  * Guan and Plötz (2017) Yu Guan and Thomas Plötz. 2017.  Ensembles of deep lstm learners for activity recognition using wearables.  _Proceedings of the ACM on interactive, mobile, wearable and ubiquitous technologies_ 1, 2 (2017), 1–28.
  * Gupta (2021) Saurabh Gupta. 2021.  Deep learning based human activity recognition (HAR) using wearable sensor data.  _International Journal of Information Management Data Insights_ 1, 2 (2021), 100046.
  * Hammerla and Plötz (2015) Nils Y Hammerla and Thomas Plötz. 2015.  Let’s (not) stick together: pairwise similarity biases cross-validation in activity recognition. In _Proceedings of the 2015 ACM international joint conference on pervasive and ubiquitous computing_. 1041–1051.
  * Haresamudram et al. (2024) Harish Haresamudram, Irfan Essa, and Thomas Ploetz. 2024.  Towards Learning Discrete Representations via Self-Supervision for Wearables-Based Human Activity Recognition.  _Sensors_ 24, 4 (2024), 1238.
  * Hiremath et al. (2022) Shruthi K Hiremath, Yasutaka Nishimura, Sonia Chernova, and Thomas Plötz. 2022.  Bootstrapping human activity recognition systems for smart homes from scratch.  _Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies_ 6, 3 (2022), 1–27.
  * Hiremath and Ploetz (2021) Shruthi Kashinath Hiremath and Thomas Ploetz. 2021.  On the role of context length for feature extraction and sequence modeling in human activity recognition. In _Proceedings of the 2021 ACM International Symposium on Wearable Computers_. 13–17.
  * Jaiswal et al. (2020) Ashish Jaiswal, Ashwin Ramesh Babu, Mohammad Zaki Zadeh, Debapriya Banerjee, and Fillia Makedon. 2020.  A survey on contrastive self-supervised learning.  _Technologies_ 9, 1 (2020), 2.
  * King et al. (2024) Evan King, Haoxiang Yu, Sangsu Lee, and Christine Julien. 2024.  Sasha: creative goal-oriented reasoning in smart homes with large language models.  _Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies_ 8, 1 (2024), 1–38.
  * Leng et al. (2024) Zikang Leng, Amitrajit Bhattacharjee, Hrudhai Rajasekhar, Lizhe Zhang, Elizabeth Bruda, Hyeokhyen Kwon, and Thomas Plötz. 2024.  IMUGPT 2.0: Language-Based Cross Modality Transfer for Sensor-Based Human Activity Recognition.  _arXiv preprint arXiv:2402.01049_ (2024).
  * Li (2015) Hailin Li. 2015.  Piecewise aggregate representations and lower-bound distance functions for multivariate time series.  _Physica A: Statistical Mechanics and its Applications_ 427 (2015), 10–25.
  * Liciotti et al. (2020) Daniele Liciotti, Michele Bernardini, Luca Romeo, and Emanuele Frontoni. 2020.  A sequential deep learning application for recognising human activities in smart homes.  _Neurocomputing_ 396 (2020), 501–513.
  * Lkhagva et al. (2006) Battuguldur Lkhagva, Yu Suzuki, and Kyoji Kawagoe. 2006.  Extended SAX: Extension of symbolic aggregate approximation for financial time series data representation.  _DEWS2006 4A-i8_ 7 (2006).
  * Majumder et al. (2017) Sumit Majumder, Emad Aghayi, Moein Noferesti, Hamidreza Memarzadeh-Tehran, Tapas Mondal, Zhibo Pang, and M Jamal Deen. 2017.  Smart homes for elderly healthcare—Recent advances and research challenges.  _Sensors_ 17, 11 (2017), 2496.
  * Makhoul et al. (1985) John Makhoul, Salim Roucos, and Herbert Gish. 1985.  Vector quantization in speech coding.  _Proc. IEEE_ 73, 11 (1985), 1551–1588.
  * Mantyla et al. (2000) V-M Mantyla, J Mantyjarvi, T Seppanen, and Esa Tuulari. 2000.  Hand gesture recognition of a mobile device user. In _2000 IEEE International Conference on Multimedia and Expo. ICME2000. Proceedings. Latest Advances in the Fast Changing World of Multimedia (Cat. No. 00TH8532)_ , Vol. 1. IEEE, 281–284.
  * McIntosh et al. (2023) Timothy R McIntosh, Teo Susnjak, Tong Liu, Paul Watters, and Malka N Halgamuge. 2023.  From google gemini to openai q*(q-star): A survey of reshaping the generative artificial intelligence (ai) research landscape.  _arXiv preprint arXiv:2312.10868_ (2023).
  * Minaee et al. (2024) Shervin Minaee, Tomas Mikolov, Narjes Nikzad, Meysam Chenaghlu, Richard Socher, Xavier Amatriain, and Jianfeng Gao. 2024.  Large language models: A survey.  _arXiv preprint arXiv:2402.06196_ (2024).
  * Misra and Maaten (2020) Ishan Misra and Laurens van der Maaten. 2020.  Self-supervised learning of pretext-invariant representations. In _Proceedings of the IEEE/CVF conference on computer vision and pattern recognition_. 6707–6717.
  * Ordóñez and Roggen (2016) Francisco Javier Ordóñez and Daniel Roggen. 2016.  Deep convolutional and lstm recurrent neural networks for multimodal wearable activity recognition.  _Sensors_ 16, 1 (2016), 115.
  * Pal et al. (2018) Debajyoti Pal, Suree Funilkul, Nipon Charoenkitkarn, and Prasert Kanthamanon. 2018.  Internet-of-things and smart homes for elderly healthcare: An end user perspective.  _IEEE Access_ 6 (2018), 10483–10496.
  * Pashazade et al. (2023) Hakime Pashazade, Masoomeh Maarefvand, Kianoush Abdi, and Yadollah Abolfathi Momtaz. 2023.  Explaining the Process of Caregiving by Sandwich Generation.  (2023).
  * Peng et al. (2023) Baolin Peng, Chunyuan Li, Pengcheng He, Michel Galley, and Jianfeng Gao. 2023.  Instruction tuning with gpt-4.  _arXiv preprint arXiv:2304.03277_ (2023).
  * PlÖtz (2021) Thomas PlÖtz. 2021.  Applying machine learning for sensor data analysis in interactive systems: Common pitfalls of pragmatic use and ways to avoid them.  _ACM Computing Surveys (CSUR)_ 54, 6 (2021), 1–25.
  * Plötz and Fink (2009) Thomas Plötz and Gernot A Fink. 2009.  Markov models for offline handwriting recognition: a survey.  _International Journal on Document Analysis and Recognition (IJDAR)_ 12 (2009), 269–298.
  * Prankit et al. (2020) Gupta Prankit, Richard McClatchey, and Praminda Caleb-Solly. 2020.  Tracking changes in user activity from unlabelled smart home sensor data using unsupervised learning methods. In _Neural Computing and Applications_ , Vol. 32. Springer, 12351–12362.
  * Puig et al. (2018) Xavier Puig, Kevin Ra, Marko Boben, Jiaman Li, Tingwu Wang, Sanja Fidler, and Antonio Torralba. 2018.  Virtualhome: Simulating household activities via programs. In _Proceedings of the IEEE conference on computer vision and pattern recognition_. 8494–8502.
  * Rane et al. (2024) Nitin Rane, Saurabh Choudhary, and Jayesh Rane. 2024.  Gemini Versus ChatGPT: Applications, Performance, Architecture, Capabilities, and Implementation.  _Performance, Architecture, Capabilities, and Implementation (February 13, 2024)_ (2024).
  * Rashidi and Cook (2009) Parisa Rashidi and Diane J Cook. 2009.  Keeping the resident in the loop: Adapting the smart home to the user.  _IEEE Transactions on systems, man, and cybernetics-part A: systems and humans_ 39, 5 (2009), 949–959.
  * Sanderson (2023) Katharine Sanderson. 2023.  GPT-4 is here: what scientists think.  _Nature_ 615, 7954 (2023), 773.
  * Shao et al. (2024) Shuai Shao, Yu Guan, and Victor Sanchez. 2024.  Beyond Isolated Frames: Enhancing Sensor-Based Human Activity Recognition through Intra-and Inter-Frame Attention.  _arXiv preprint arXiv:2405.19349_ (2024).
  * Tang et al. (2021) Chi Ian Tang, Ignacio Perez-Pozuelo, Dimitris Spathis, Soren Brage, Nick Wareham, and Cecilia Mascolo. 2021.  Selfhar: Improving human activity recognition through self-training with unlabeled data.  _Proceedings of the ACM on interactive, mobile, wearable and ubiquitous technologies_ 5, 1 (2021), 1–30.
  * Team et al. (2024) Gemma Team, Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, et al. 2024\.  Gemma: Open models based on gemini research and technology.  _arXiv preprint arXiv:2403.08295_ (2024).
  * Thukral et al. (2024) Megha Thukral, Sourish Gunesh Dhekane, Shruthi K Hiremath, Harish Haresamudram, and Thomas Ploetz. 2024.  Layout Agnostic Human Activity Recognition in Smart Homes through Textual Descriptions Of Sensor Triggers (TDOST).  _arXiv preprint arXiv:2405.12368_ (2024).
  * Yu et al. (2019) Yufeng Yu, Yuelong Zhu, Dingsheng Wan, Huan Liu, and Qun Zhao. 2019.  A novel symbolic aggregate approximation for time series. In _Proceedings of the 13th International Conference on Ubiquitous Information Management and Communication (IMCOM) 2019 13_. Springer, 805–822.
  * Zhao et al. (2023) Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, et al. 2023\.  A survey of large language models.  _arXiv preprint arXiv:2303.18223_ (2023).


#  A Data-driven Approach to Multi-event Analytics in Large-scale Power
Systems Using Factor Model

Fan Yang, Xing He, Robert Caiming Qiu, and Zenan Ling

###### Abstract

Multi-event detection and recognition in real time is of challenge for a
modern grid as its feature is usually non-identifiable. Based on factor model,
this paper porposes a data-driven method as an alternative solution under the
framework of random matrix theory. This method maps the raw data into a high-
dimensional space with two parts: 1) the principal components (factors,
mapping event signals); and 2) time series residuals (bulk, mapping white/non-
Gaussian noises). The spatial information is extracted form factors, and the
termporal infromation from residuals. Taking both spatial-tempral correlation
into account, this method is able to reveal the multi-event: its components
and their respective details, e.g., occurring time. Case studies based on the
standard IEEE 118-bus system validate the proposed method.

###### Index Terms:

multiple event analytics; factor model; power systems; spatial-tempral
correlation; time series; random matrix;

##  I Introduction

For a large-scale power system, multiple events can hardly be identified
properly as it is difficult to distinguish the features of multi-event from
the ones of single-event. The multi-event poses a more serious threat to the
systems: it can hardly be identified, and thus be addressed, which may lead to
a wide-spread blackout.

This paper proposes a statistical, data-driven solution, rather than its
deterministic, empirical or model-based counterpart, to solve the problem
given above. The study is built upon our previous work in the last several
years. See Section I-B for details.

###  I-A Contribution

This paper, based on random matrix theory (RMT), proposes a high statistical
tool, namely, factor model, for multi-event detection and recognition in a
modern grid. This paper extracts the spatial and temporal information from the
massive raw data, respectively, in the form of principal components (factors)
and residuals (bulk). The factors map event signals, and the residuals map
white/non-Gaussian noises.

The proposed method can be used for multi-event analytics effectively. To the
factors, we experimentally obtain that there is a linear relationship between
the number of factors and the event number of the multi-event. To the
residuals, on the other hand, we extract their information rather than simply
assuming it to be identically independent “pure white noise” as [1]. Time
series information contained in noise, together with the spatial information
in factors, reveals the multi-event status. The proposed method is practical
for real-time analysis.

Besides, the proposed solution is model-free, requiring no knowledge of
topologies or parameters of the power system [2, 3, 4], and able to handle
non-Gaussian noises. To the best of our knowledge, it is the first time to
propose an algorithm aiming at multi-event detection based on random matrix
theory in the field of power systems.

###  I-B Related Work

In our previous work, a universal architecture with big data analytics is
proposed [5] and is applied for anomaly detection [6, 7]. Little work,
howerve, has been done to multi-event analytics in a complex situation.
Current researches on event analysis are mainly model-based, aiming at single-
event analytics. They may not be suitable for real-time analytics in a complex
situation [8]. Some other methods adopt graph theory [9, 10]; the methods
strongly depend on the structure of the power system.

Some data-driven methods for event analysis are proposed recently [11] and
applied for multi-event analytics [12].

Rafferty utilizes principal component analysis (PCA) for real-time multi-event
detection and classification in [12]. In his approach, a threshold of
cumulative percentage of total variation is selected in advance. Then, the
number of principal components is determined according to the threshold
mentioned above. The threshold is selected empirically and subjectively.
Besides, for other supervised tools, like deep learning [13] and kernel-based
algorithms [14], which are hot-spot to data-driven approaches, the same
problem is inevitable. The deep learning algorithms automatically select the
features from the massive datasets. This is one big advantage of deep learning
over our paradigm. Our paradigm, however, has the advantage of transparency in
that our results are provably. Also, our paradigm is deeply rooted in random
matrix theory.

Nowadays, high-dimensional factor model has been actively studied and already
successfully applied in statistics [15] , econometrics [16] and biology [17].

##  II Theory Foundation and Data Processing

The frequently used notations are given in Table 1.

###  II-A Random Matrix Theory and Spectral Analytics

Random matrices have been an important issue in multi-variate statistical
analysis since the landmark work of Wigner and Wishart [18], motivated by
problems in quantum physics. Factor model, on the other side, can be used to
identify non-random properties (in the form of spikes/outliers) which are
deviations from the universal predictions (in the form of bulk) [19, 20]. To
be specific, the eigenvalues of covariance matrix (spectrum) can usually be
divided into two parts: a bulk and several spikes. The bulk represents the
noises, while the spikes represent the signals, namely, factors.

In previous work, noises are usually assumed to be identically independent in
power systems, namely, white noises. However, ”no information” or ”pure noise”
assumption is invalid in practice. For instance, for a certain PMU, there
exits time correlation between the measured voltage magnitude data of adjacent
sampling points [21, 22]. The time correlation is non-ignorable, especially
for a large inter-connected system! This paper formulars the noises using time
series analytics.

TABLE I:  Some Frequently Used Notations Notations |  Means
---|---
$\bm{X},\bm{x},{x_{i,j}}$ |  a matrix, a vector, an entry of a matrix
$\mu(x),\sigma(x)$ |  mean, variance for $x$
$\Omega$ |  raw data source
${\mathbb{C}^{N\times T}}$ |  $N\times T$ dimensional complex space
$N,T$ |  the row and column size of moving split-window
$n$ |  the number of measurable status variables
${t_{i}}$ |  the sampling time
${\hat{\bm{X}}}$ |  a raw data matrix
${\tilde{\bm{X}}}$ |  a standard non-Hermitian matrix
$p$ |  the number of factors
$b$ |  the covariance structure of residualss
$z$ |  a complex eigenvalue, $z=\lambda+i\varepsilon$
$\hat{p},\hat{\theta}$ |  the estimated value of $p$, $\theta$

Reference [23] provides a fundamental theory to estimate noises, and
formulates them as:

$\bm{U}={\bm{A}_{N}}^{1/2}\bm{G}{\bm{B}_{T}}^{1/2}$ (1)

where $\bm{G}$ is an $N\times T$ matrix with i.i.d (identically independent
distribution) Gaussian entries, and $\bm{A}_{N}$ and $\bm{B}_{T}$ are $N\times
N$ and $T\times T$ symmetric non-negative definite matrices, representing
cross- and auto- covariances, respectively. For more details about the model,
please refer to Appendix A. On the other side, the spikes (deviating
eigenvalues) of the spectrum map the event signals. They represent dominant
information for system operating status.

###  II-B Data Processing

Massive raw data can be represented by matrix naturally [24]. In a power
system, assume that there are $n$ kinds of measurable variables. At sampling
time $t_{0}$, we arrange the measured data of these variables in the form of a
column vector
$\hat{\bm{x}}({t_{0}})={({{\hat{x}}_{t_{0},1}},{{\hat{x}}_{t_{0},2}},\cdots,{{\hat{x}}_{t_{0},n}})^{H}}$
[25]. Then, arranging the column vectors $\hat{x}({t_{i}})$ in chronological
order ($i=1,2,\cdots$), we obtain raw data source $\Omega$.

For the raw data source $\Omega$, we can cut off any arbitrary part, e.g.,
size of $N\times T$, at any time, e.g., samping time $t_{i}$ , forming
${\hat{\bm{X}}_{ti}}\in{\mathbb{C}^{N\times T}}$ as

$\hat{\bm{X}}({t_{i}})=(\hat{\bm{x}}({t_{i-T+1}}),\hat{\bm{x}}({t_{i-T+2}}),\cdots,\hat{\bm{x}}({t_{i}}))$
(2)

where
$\hat{\bm{x}}({t_{j}})=({\hat{x}_{t_{j},1}},{\hat{x}_{t_{j},2}},\cdots,{\hat{x}_{{t_{j},N}}})^{H}$
is measured data at sampling time ${t_{j}}$ ($j=1,2,\cdots,T$). It is worth
noting that $T$ is the length of the moving split-window. If we keep the last
sampling time as the current time, with the moving split-window, the real-time
analytics is conducted.

Then, we convert the raw data matrix ${\hat{\bm{X}}_{ti}}$ obtained at each
sampling time $t_{i}$ into a standard non-Hermitian matrix
${\tilde{\bm{X}}_{ti}}$ with the following algorithm.

${\tilde{x}_{i,j}}=({\hat{x}_{i,j}}-\mu({\hat{\bm{x}}_{i}}))\times\frac{{\sigma({{\tilde{\bm{x}}}_{i}})}}{{\sigma({{\hat{\bm{x}}}_{i}})}}+\mu({\tilde{\bm{x}}_{i}})$
(3)

where
${\hat{\bm{x}}_{i}}=({\hat{x}_{i,1}},{\hat{x}_{i,2}},\cdots,{\hat{x}_{i,T}})$,
$\mu({\tilde{\bm{x}}_{i}})=0$, $\sigma({\tilde{\bm{x}}_{i}})=1$,
$i=1,2,\cdots,N$ and $j=1,2,\cdots,T$.

In the following section, ${\tilde{\bm{X}}_{ti}}$ is used to analyze the
factors and noises at sampling time $t_{i}$.

##  III Factor Model Algorithm

For a certain window, e.g. the one obtained at sampling time $t_{i}$, we aim
to decompose the standard non-Hermitian matrix ${\tilde{\bm{X}}_{ti}}$, as
given in (3), into factors and residuals as follows:

${\tilde{\bm{X}}_{ti}}={{{\bm{L}}_{ti,j}}{{\bm{F}}_{ti,j}}+{{\bm{U}}_{ti}}}$
(4)

where $p$ is the number of factors, ${{{\bm{F}}_{ti,j}}}$ is the $j-$th
factor, ${{{\bm{L}}_{ti,j}}}$ is the corresponding loading, ${{U_{ti}}}$ is
the residual. Usually, only ${\tilde{\bm{X}}_{ti}}$ is available, while
${{{\bm{L}}_{ti,j}}}$, ${{{\bm{F}}_{ti,j}}}$ and ${{{\bm{U}}_{ti}}}$ need to
be estimated.

Factor model aims to simultaneously provide estimators of factor number and
correlation structures in residuals. We turn the parameter-estimation problem
into a minimum-distance problem. Specifically, we consider a minimum distance
between the experimental spectral distribuion $\rho_{\text{real}}(p)$ and the
theoretical spectral distribuion $\rho_{\text{model}}(b)$. The experimental
one $\rho_{\text{real}}(p)$, depending on the sampling data, is obtained as
empirical eigenvalue density (EED) of $C_{\text{real}}^{(p)}$ in (7), and the
theoretical one $\rho_{\text{model}}(b)$, based on Sokhotskys formlua, is
given as $\rho_{\text{model}}(\lambda;b)$ in (8). As a result, we turn the
factor model estimation into a classical optimziation as

$\\{\hat{p},\hat{\theta}\\}=\arg\min
D(\rho_{\text{real}}(p),{\rho_{\text{model}}}(\theta))$ (5)

where $D$ is a spectral distance measure or loss function. The solution of
this minimization problem gives the number of factors, in the form of
$\hat{p}$, and the parameters for the correlation structure of the residuals,
in the form of $\hat{\theta}$.

###  III-A Principal Component Estimation :$\rho_{\mathrm{real}}(p)$

The first step is to generate $p$-level empirical residuals, by substracting
$p$ largest principal components according to (4).

${\hat{\bm{U}}^{(p)}}={\tilde{\bm{X}}_{ti}}-{\hat{\bm{L}}^{(p)}}{\hat{\bm{F}}^{(p)}}$
(6)

where ${\hat{\bm{F}}^{(p)}}$ is a $p\times T$ matrix of $p$ factors, each row
of which is a $j$-th $(j=1,\cdots,p)$ principal component from
${{\tilde{\bm{X}}}_{ti}}^{T}{{\tilde{\bm{X}}}_{ti}}$, $\hat{\bm{L}}^{(p)}$ is
an $N\times p$ matrix of factor loadings, estimated by multivariate least
squares regression of $\tilde{\bm{X}}_{ti}$ on ${\hat{\bm{F}}^{(p)}}$.

Then the covariance matrix from $p$-level residuals is obtained as

$\bm{C}_{\text{real}}^{(p)}=\frac{1}{T}{{\hat{\bm{U}}}^{(p)}}{{\hat{\bm{U}}}^{{{(p)}^{T}}}}$
(7)

The subscript “real” indicates that $\bm{C}_{\text{real}}^{(p)}$ is obtained
from real data. The steps can be summarized as follows:

Steps of Calculating $\rho_{\mathrm{real}}(p)$
---
1.Calculate ${{\hat{\bm{F}}}^{(p)}}$: each row of which is a $j$-th principal
component from correlation matrix of ${\tilde{\bm{X}}_{ti}}$, i.e.
${{\tilde{\bm{X}}}_{ti}}^{T}{{\tilde{\bm{X}}}_{ti}}$; denote as:
${{\hat{\bm{F}}}^{(p)}}={({f_{1}},{f_{2}},\cdots,{f_{p}})^{T}}$.
2.Conduct least squares regression of ${\tilde{\bm{U}}}_{ti}$ on
${\hat{\bm{F}}^{(p)}}$:
${{\hat{\bm{L}}}^{(p)}}={{\tilde{\bm{X}}}_{ti}}{{\hat{\bm{F}}}^{{{(p)}^{T}}}}$.
3.Calculate $p$-level residual:
${{\hat{\bm{U}}}^{(p)}}={{\tilde{\bm{X}}}_{ti}}-{{\hat{\bm{L}}}^{(p)}}{{\hat{\bm{F}}}^{(p)}}$.
4.Calculate covariance matrix from $p$-level residual:
${\bm{C}}_{\text{real}}^{(p)}=\frac{1}{T}{{\hat{\bm{U}}}^{(p)}}{{\hat{\bm{U}}}^{{{(p)}^{T}}}}$.
5.Calculate the empirical eigenvalue density of
${\bm{C}}_{\text{real}}^{(p)}$.

###  III-B Modeling Covariance of Residuals: $\rho_{\mathrm{model}}(\theta)$

In section ${\rm I}{\rm I}$, we consider residuals as time series, which is
represented by (1). The $\rho_{\text{model}}(\theta)$, however, is difficult
to be obtained, since the limiting distribution of general ${A_{N}}$ and
${B_{T}}$ cost too much calculation resource via Stieltjes transform in [23]
Fortunately, a recent work by [26] provides an analytic derivation of limiting
spectral density using free random variable techniques. This paper uses the
results of [26] to calculate $\rho_{\text{model}}(\bullet)$. If we assume that
the cross-correlations [23], i.e. ${\bm{A}_{N}}$, are effectively removed by
the factors, then, the cross-correlations among the normalized residuals are
negligible: ${\bm{A}_{N}}\approx{\bm{I}_{N\times N}}$. Under this assumption,
only the auto-correlations, i.e. ${\bm{B}_{T}}$, left. The ${\bm{B}_{T}}$ is
in the forms of exponential decays with respect to time lags, as:
${({\bm{B}_{T}})_{i,j}}={b^{\left|{i-j}\right|}}$. As a result, the
$\rho_{\text{model}}({\theta_{{A_{N}}}},{\theta_{{B_{T}}}})$ is replaced by
$\rho_{\text{model}}(b)$.

This enables us to calculate the modeled spectral density,
$\rho_{\text{model}}(b)$, much more easily. It can be done through the free
random variable techniques proposed in [26] (Refer to Appendix A for analytic
derivation). The steps can be summarized as follows:

Steps of Calculating $\rho_{\mathrm{model}}(b)$
---
1.Get the mean spectral density from Green Function G(z) by using Sokhotsky’s
formula:
$\rho_{\text{model}}(\lambda;b)=-\frac{1}{\pi}\mathop{\lim}\limits_{\varepsilon\to{0^{+}}}{\mathop{\rm
Im}\nolimits}{G_{c}}(\lambda+i\varepsilon)$ (8)
2\. Green Function $G(z)$ can be obtained from the Moments Generating Function
$M(z)$ $M(z)=zG(z)-1$ (9)
3\. Solve the polynomial equation for $M=M(z)$ $(a=\sqrt{1-{b^{2}}})$ and
$c=N/T$ (a 6th-order polynomial equations for
$\rho_{\text{model}}({\theta_{{A_{N}}}},{\theta_{{B_{T}}}})$):
${a^{4}}{c^{2}}{M^{4}}+2{a^{2}}c(-(1+{b^{2}})z+{a^{2}}c){M^{3}}+$
$({(1-{b^{2}})^{2}}{z^{2}}-2{a^{2}}c(1+{b^{2}})z+({c^{2}}-1){a^{4}}){M^{2}}-2{a^{4}}M-{a^{4}}=0$
(10)

With the above procedure, we can rewrite (5) as

$\\{\hat{p},\hat{b}\\}=\arg\min
D(\rho_{\text{real}}(p),{\rho_{\text{model}}}(b))$ (11)

###  III-C Distance Measure

Since the empirical spectrum contains spikes, a distance measure which is
sensitive to the presence of spikes should be given. This paper uses Jensen-
Shannon divergence, which is a symmetrized version of Kullback-Leibler
divergence.

${D_{\text{JS}}}(P\left\|Q\right.)=\frac{1}{2}{D_{\text{KL}}}(P\left\|M\right.)+\frac{1}{2}{D_{\text{KL}}}(Q\left\|M\right.)$
(12)

where $P$ and $Q$ are probability densities, $M=\frac{1}{2}(P+Q)$, and
${D_{\text{KL}}}(P\left\|Q\right.)$ is the Kullback-Leibler divergence defined
by
${D_{\text{KL}}}(P\left\|Q\right.)=\sum\limits_{i}{{P_{i}}\log\frac{{{P_{i}}}}{{{Q_{i}}}}}$
. Note that the Kullback-Leibler distance becomes larger if one density has a
spike at a point while the other is almost zero at the same point. Refer to
Appendix B for more details.

Figure 1:  Topology of the Standard IEEE 118-bus System.

##  IV CASE STUDIES

Figure 2:  Case Stusies: (a) Case 1 (b) Case 2 (c) in Case 3.

The proposed method is tested with simulated data in the standard IEEE 118-bus
system (the topology is shown in Fig. 1 on the Matpower platform [27]. In this
simulations, we regard a sudden power consumption (active power, $P$) change
on some node as an event.

Three cases are designed to validate the proposed method. In case 1, case 2,
case 3, we set different numbers of events on node 52, 117, 75, and observe
the number of factors, respectively. To make a comparison, we illustrate the
results of the three cases in the same picture as Fig. 2.

The raw data source, $\Omega$, is in size of $n$=118, $t$=2500. The size of
the moving split-window is set to be $N$=118, $T$=250, i.e.
$\hat{\bm{X}}\in\mathbb{C}^{118\times 250}$.

Then, (11) is used to estimate the parameters $p$ and $b$ as $\hat{p}$ and
$\hat{b}$. The $p$ for the number of the assumed events, and the $b$ for the
correlation structure of the noises. It is noted that we implement the
simulated system model for dozens of times to collect data, the noise of each
time follows the same distribution. The dozens times simulation is reasonable,
as that we can obtain dozens observations for a real physical system through
its sampling data, which have noises following a certain distribtuion.

Then, in the $k$-th simulation, $\Omega_{k}$ is generated. With (11), the
estimation result $\hat{p}_{k}$ and $\hat{b}_{k}$ are obtained. For these
$\hat{p}_{k}$ and $\hat{b}_{k}$ $(k=1,2,\cdots)$, their mean value
$\hat{p}_{\text{ave}}$ and $\hat{b}_{\text{ave}}$ is calculated, which may
appear in decimal form. We need to point out that the estimation of
$\hat{p}_{\text{ave}}$ and $\hat{b}_{\text{ave}}$ begins at ${t_{s}}$=250 due
to the length of the split-window. In Fig.2, we amplify the value of
$\hat{b}_{\text{ave}}$ for twenty times to make it obvious, i.e.
$\hat{b}_{\text{ave0}}=\hat{b}_{\text{ave}}\times 20$.

The events in Case 1, Case 2, and Case 3 are given as Tab.II, Tab.III, and
Tab.IV, respectively. The corresponding estimation resuts, i.e., the number of
factors (i.e., $\hat{p}_{\text{ave}}$) and the correlation structure of the
residuals (i.e., $\hat{b}_{\text{ave0}}$), are obtained as Fig. 2.

###  IV-A Case 1: Single Event Detection

Single Step Signal on Node 52:

TABLE II:  Events Assumed in Case 1

Node |  Sampling Time |  Power Consumption $P$ (MW)
---|---|---
52 |  ${t_{s}}=1\sim 499$ |  0+$r_{52,t}$
|  ${t_{s}}=500\sim 899$ |  100+$r_{52,t}$
others |  ${t_{s}}=1\sim 899$ |  $c_{k}+r_{k,t}$

*$c_{k}$ is a constant of node $k$, $k=\\{{1,2,\\!\cdots\\!,118}\\}\\!-\\!\\{52\\}.$
*$r_{52,t}$, $r_{k,t}$ are noises following AR(1) model, where $b_{\text{noise}}=0.5.$

Fig. 2(a) shows that:

  * •

During the sampling time ${t_{s}}=250\\!\sim\\!499$111$250=1$(The beginning of
Sigal)$+250$(Length of Split-Window)$-1$. $\hat{p}_{\text{ave}}$ and
$\hat{b}_{\text{ave}}$ remain steady around 3 and 0.28, respectively.

  * •

At ${t_{s}}$=500, $\hat{p}_{\text{ave}}$ starts to decline to around 2. Also,
$\hat{b}_{\text{ave}}$ declines slightly.

Actually, as can be seen from Tab. II: no event occurs in the system when
$\hat{p}_{\text{ave}}$ keeps steady. Right at ${t_{s}}$=500, the $P_{52}$
changes from 0 to 100MW. Therefore, we can conduct event detection with the
proposed method.

Moreover, in this case, for the split-window $W_{t1}\\!:\\!t\in[251,500]$,
there exist a single-event (i.e., step signal on Node 52, $\text{s}_{52}$, at
${t_{s}}$=500) and 2 factors, i.e., 1 event,
$\hat{p}_{\text{ave}}\\!\approx\\!2$ during
$W_{t1_{\text{Start}}}\\!:\\!t\in[251,500]$ to
$W_{t1_{\text{End}}}\\!:\\!t\in[650,899]$. A linear relationship between the
number of events and the number of factors will be revealed afterwards.

###  IV-B Case 2: Multiple Event Detection (Two Events)

Multiple Step Signal on Node 52 and Node 117:

TABLE III:  Events Assumed in Case 2 Node |  Sampling Time |  Active Load (MW)
---|---|---
52 |  ${t_{s}}=900\sim 1299$ |  0+$r_{52,t}$
|  ${t_{s}}=1300\sim 1899$ |  100+$r_{52,t}$
117 |  ${t_{s}}=900\sim 1399$ |  0+$r_{117,t}$
|  ${t_{s}}=1400\sim 1799$ |  150+$r_{117,t}$
|  ${t_{s}}=1800\sim 1899$ |  0+$r_{117,t}$
others |  ${t_{s}}=900\sim 1899$ |  $c_{k}+r_{k,t}$

Fig. 2(b) shows that:

  * •

During the sampling time ${t_{s}}=1149\\!\sim\\!1299$222$1149=900$(The
beginning of Sigal)$+250$(Length of Split-Window)$-1$, $\hat{p}_{\text{ave}}$
and $\hat{b}_{\text{ave}}$ remain steady. Thus, we deduce that no event occurs
in the system, which meets Tab. III.

  * •

At ${t_{s}}$=1300, $\hat{p}_{\text{ave}}$ starts to decline (from 3.023 to
2.603) and then keeps around 2 till ${t_{s}}$=1399. For the split-window
$W_{t2,1_{\text{Start}}}\\!:\\!t\in[1051,1300]$ to
$W_{t2,1_{\text{End}}}\\!:\\!t\in[1150,1399]$, there exist a single-event
(i.e., $\text{s}_{52}$ at ${t_{s}}$=1300) and 2 factors, i.e., 1 event,
$\hat{p}_{\text{ave}}\\!\approx\\!2$.

  * •

At ${t_{s}}$=1400, $\hat{p}_{\text{ave}}$ starts to raise (from 2.333 to
3.047) and then keeps around 3. For the split-window
$W_{t2,2_{\text{Start}}}\\!:\\!t\in[1151,1400]$ to
$W_{t2,2_{\text{End}}}\\!:\\!t\in[1299,1548]$, there exist two multi-event
(i.e., $\text{s}_{52}$ at ${t_{s}}$=1300, $\text{s}_{117}$ at ${t_{s}}$=1400)
and 3 factors, i.e., 2 event, $\hat{p}_{\text{ave}}\\!\approx\\!3$.

###  IV-C Case 3: Multiple Event Detection (Three Events)

Multiple Step Signal on Node 52, Node 117 and Node 75:

TABLE IV:  Events Assumed in Case 3 Node |  Sampling Time |  Active Load (MW)
---|---|---
52 |  ${t_{s}}=1900\sim 2249$ |  0+$r_{52,t}$
|  ${t_{s}}=2250\sim 2500$ |  100+$r_{52,t}$
117 |  ${t_{s}}=1900\sim 2299$ |  0+$r_{117,t}$
|  ${t_{s}}=2300\sim 2500$ |  150+$r_{117,t}$
75 |  ${t_{s}}=1900\sim 2399$ |  0+$r_{75,t}$
|  ${t_{s}}=2400\sim 2500$ |  400+$r_{75,t}$
others |  ${t_{s}}=1900\sim 2500$ |  $c_{k}+r_{k,t}$

Fig. 2(c) shows that:

  * •

During the sampling time ${t_{s}}=2149\\!\sim\\!2249$333$2149=1900$(The
beginning of Sigal)$+250$(Length of Split-Window)$-1$, $\hat{p}_{\text{ave}}$
and $\hat{b}_{\text{ave}}$ remain steady. Thus, we deduce that no event occurs
in the system, which meets Tab. IV.

  * •

At ${t_{s}}$=2250, $\hat{p}_{\text{ave}}$ starts to decline (from 2.873 to
2.603) and then keeps around 2 till ${t_{s}}$=2300. For the split-window
$W_{t3,1_{\text{Start}}}\\!:\\!t\in[2001,2250]$ to
$W_{t3,1_{\text{End}}}\\!:\\!t\in[2050,2299]$, there exist a single-event
(i.e., $\text{s}_{52}$ at ${t_{s}}$=2250) and 2 factors, i.e., 1 event,
$\hat{p}_{\text{ave}}\\!\approx\\!2$.

  * •

At ${t_{s}}$=2300, $\hat{p}_{\text{ave}}$ starts to raise (from 2.307 to
3.173) and then keeps around 3 till ${t_{s}}$=2400. For the split-window
$W_{t3,2_{\text{Start}}}\\!:\\!t\in[2051,2300]$ to
$W_{t3,2_{\text{End}}}\\!:\\!t\in[2150,2399]$, there exist two multi-event
(i.e., $\text{s}_{52}$ at ${t_{s}}$=2250, $\text{s}_{117}$ at ${t_{s}}$=2300)
and 3 factors, i.e., 2 event, $\hat{p}_{\text{ave}}\\!\approx\\!3$.

  * •

At ${t_{s}}$=2400, $\hat{p}_{\text{ave}}$ starts to raise (from 3.433 to
3.547) and then keeps around 4. For the split-window
$W_{t3,3_{\text{Start}}}\\!:\\!t\in[2151,2400]$ to
$W_{t3,3_{\text{End}}}\\!:\\!t\in[2251,2500]$, there exist three multi-event
(i.e., $\text{s}_{52}$ at ${t_{s}}$=2250, $\text{s}_{117}$ at ${t_{s}}$=2300,
$\text{s}_{75}$ at ${t_{s}}$=2400) and 4 factors, i.e., 3 event,
$\hat{p}_{\text{ave}}\\!\approx\\!4$.

###  IV-D Further Discussions about the Cases

Through the above three cases, the relationship between the number of events
(i.e., $\text{n}_{event}$) and the number of factors (i.e.,
$\hat{p}_{\text{ave}}$) is revealed.

The results of the three cases are summarized in Tab. V:

TABLE V:  Relationship between Event Number ($\text{n}_{event}$) and Factor Number ($\hat{p}_{\text{ave}}$) Case |  Split Window |  ${n}_{\text{event}}$ |  $\hat{p}_{\text{ave}}$
---|---|---|---
1 |  $[251,500]\sim[650,899]$ |  1 |  2
2 |  $[1051,1300]\sim[1150,1399]$ |  1 |  2
|  $[1151,1400]\sim[1299,1548]$ |  2 |  3
3 |  $[2001,2250]\sim[2050,2299]$ |  1 |  2
|  $[2051,2300]\sim[2150,2399]$ |  2 |  3
|  $[2151,2400]\sim[2251,2500]$ |  3 |  4

$\hat{p}_{\text{ave}}$, estimated by factor model, is approximately equal to
${n}_{\text{event}}$ plus one, i.e.
$\hat{p}_{\text{ave}}\approx{n}_{\text{event}}+1$. There exists a linear
relationship between them. Therefore, we can deduce the number of the multi-
event for a certain split-window.

Besides, every time an event occurs, $\hat{b}_{\text{ave}}$ drops. It
indicates that the correlation in the residuals decreases when there exit
events.

##  V CONCLUSION

This paper proposes a data-driven method, namely, factor model, to conduct
multi-event detection and recognition in a large power system. In the analysis
procedure, we estimate the number of factors $p$ and the parameter for the
correlation structure of residuals $b$ by minimizing the distance between two
spectrums. Then, we conduct real-time analysis of the two parameters, $p$ and
$b$, using moving split-window. The proposed method is direct and practical
for multi-event analytics in a complex situation. Following conclusions are
obtained: First, the number of factors estimated by factor model has an
approximately linear relationship with the number of events that occur in the
system. Second, taking non-Gaussian noises into account, time series analytics
is implemented to extract the information from noises. The decrease of
parameter $b$ is related to the occurrence of events. It is noted that, the
number of factors reveal the spatial information (events on different nodes)
in the system; while the correlation structure in noises contains temporal
information. The proposed method considers space-time correlation in a large
power system. Finally, case studies verify the effectiveness of the method.

Along this direction, following work can be done. For example, we can employ
more general modeling for noises. If we consider vector ARMA (1, 1) processes,
we have up to 6th-order polynomial equations [26]. Furthermore, the
relationship betweeen the number of factors and events can be further studied
with physical model.

##  Appendix A An Overview of Free Random Variable Techniques

We summarize the main concepts and key results in free random variables
techniques that we employ to derive ${\rho_{\bmod el}}(b)$. We follow the
notations and derivations from [26, 28]. First, consider a simple
decomposition of covariance structures:

$Co{v_{ia,jb}}={A_{ij}}{B_{ab}}$ (13)

where $A$ is an $N\times N$ cross-covariance matrix and $B$ is a $T\times T$
auto-covariance matrix, $i,j=1\cdots N$, $a,b=1\cdots T$. Suppose $G$ is an
$N\times T$ $i.i.d$ Gaussian random matrix. Then a correlated Gaussian random
matrix $U$ ($N\times T$ time series) can be written as
$U={A_{N}}^{1/2}G{B_{T}}^{1/2}$. Its sample (empirical) covariance matrix $C$
is

$C=\frac{1}{T}U{U^{T}}=\frac{1}{T}{A^{1/2}}GB{G^{T}}{A^{1/2}}$ (14)

Consider a real symmetric $N\times N$ random matrix $H$.
Definition 1 Mean Spectral Density

${\rho_{H}}(\lambda)=\frac{1}{N}\sum\limits_{i=1}^{N}{\left\langle{\delta(\lambda-{\lambda_{i}})}\right\rangle=}\frac{1}{N}\left\langle{Tr(\lambda{1_{N}}-H)}\right\rangle$
(15)

where the expectation $\left\langle\cdots\right\rangle$ is taken w.r.t. the
rotationally invariant probability measure, $\delta(\bullet)$ is a Dirac delta
function, and ${{1_{N}}}$ is a $N\times N$ unit matrix.
Definition 2 The Green’s Function (or Stieltjes Transform)

${G_{H}}(z)=\frac{1}{N}\sum\limits_{i=1}^{N}{\left\langle{\frac{1}{{z-{\lambda_{i}}}}}\right\rangle=}\frac{1}{N}\left\langle{\frac{1}{{z{1_{N}}-H}}}\right\rangle$

$=\int{\frac{{{\rho_{H}}(\lambda)}}{{z-\lambda}}d\lambda}$ (16)

The relationship between ${\rho_{H}}(\lambda)$ and ${G_{H}}(z)$ is:

${\rho_{H}}(\lambda)=-\frac{1}{\pi}\mathop{\lim}\limits_{\varepsilon\to{0^{+}}}{\mathop{\rm
Im}\nolimits}{G_{H}}(\lambda+i\varepsilon)$ (17)

The Green’s function generates moments of a probability distribution, where
the $n-th$ moment is defined by:
Definition 3 Moment

${m_{n}}=\frac{1}{N}\left\langle{Tr{H^{n}}}\right\rangle=\int{{\rho_{H}}(\lambda){\lambda^{n}}d\lambda}$
(18)

Definition 4 Moment Generating Function

${G_{H}}(z)=\sum\limits_{n\geq 0}{\frac{{{m_{n}}}}{{{z^{n+1}}}}}$

${M_{H}}(z)=\sum\limits_{n\geq 1}{\frac{{{m_{n}}}}{{{z^{n+1}}}}}$ (19)

The relationship between ${G_{H}}(z)$ and ${M_{H}}(z)$ is

${M_{H}}(z)=z{G_{H}}(z)-1$ (20)

Blue’s function and N-transform are the inverse transform of the Green’s
function and moment generating function, respectively.
Definition 5 Blue’s function and N-transform

${G_{H}}({B_{H}}(z))={B_{H}}({G_{H}}(z))=z$

${M_{H}}({N_{H}}(z))={N_{H}}({M_{H}}(z))=z$ (21)

Then, return to $Eq.13$. The N-transform of $C$ can be derived as:

${N_{C}}(z)=rz{N_{B}}(rz){N_{A}}(z)$ (22)

Using the moments’ generating function $M\equiv{M_{C}}(z)$ and its inverse
relation to N-transform, $Eq.20$ can be written as:

$z=rM{N_{B}}(rM){N_{A}}(M)$ (23)

Now, we consider the simplified model with ${A_{N}}\approx{I_{N\times N}}$. In
such case, ${U_{nt}}$ is a time-series (AR(1)) following the autoregressive
model:

${U_{nt}}=b{U_{n,t-1}}+{\xi_{nt}}$ (24)

where $\left|b\right|<1$, ${\xi_{nt}}\sim N(0,1-{b^{2}})$,
$n=1,\cdots,N,t=1,\cdots,T$. We calculate the eigenvalue distribution
${\rho_{C}}(\lambda)$ of correlation matrix $C=\frac{1}{T}U{U^{T}}$ based on
the following strategy.
Step 1: Find ${M_{C}}(z)$, from the equation for N-transform.
Step 2: Find ${G_{C}}(z)$, by $Eq.19$.
Step 3: Find ${\rho_{C}}(\lambda)$, by $Eq.16$.

For Step 1, consider $Eq.22$. Because ${A_{N}}\approx{I_{N\times N}}$, so
${N_{A}}(z)=1+1/z$. Therefore, $Eq.22$ can be rewritten as:

$\frac{z}{{r(1+M)}}={N_{B}}(rM)$

$rM={M_{B}}(\frac{z}{{r(1+M)}})$ (25)

To find ${M_{B}}$, note that the auto-covariance matrix of AR(1) process has a
simple form:

${B_{st}}=\frac{{{\mathop{\rm
var}}(\zeta)}}{{1-{b^{2}}}}{b^{\left|{s-t}\right|}}={b^{\left|{s-t}\right|}}$
(26)

Using Fourier-transform of the matrix B, it can be shown that the moment
generating function of B is

${M_{B}}(z)=-\frac{1}{{\sqrt{1-z}\sqrt{1-\frac{{{{(1+{b^{2}})}^{2}}}}{{1-{b^{2}}}}z}}}$
(27)

Therefore, we obtain $Eq.10$ for Step 1. The other steps are followed
straightforwardly as $Eq.9$ and $Eq.8$.

##  Appendix B Kullback-Leibler divergence

The Kullback-Leibler divergence is defined as follows:

${D_{KL}}(P\left\|Q\right.)=\sum\limits_{i}{{P_{i}}\log\frac{{{P_{i}}}}{{{Q_{i}}}}}$
(28)

where $P$ and $Q$ are probability densities. To deal with zero elements of
$P$, we use:

${{\tilde{P}}_{i}}=\left\\{{\begin{array}[]{*{20}{c}}{\alpha{P_{i}}}\\\
\varepsilon\end{array}}\right.\begin{array}[]{*{20}{c}}{,{P_{i}}>0}\\\
{,{P_{i}}=0}\end{array}$ (29)

where $\varepsilon$ is a small enough positive number. Denote the number of
zero elements in $P$ as $num$, $\alpha=1-num\times\varepsilon$. Probability
density $Q$ is dealt with in the same way.

## References

  * [1] X. Xu, X. He, Q. Ai, and R. C. Qiu, “A correlation analysis method for power systems based on random matrix theory,” _IEEE Transactions on Smart Grid_ , vol. PP, no. 99, pp. 1–10, 2015.
  * [2] X. Miao and D. Zhang, “The opportunity and challenge of big data’s application in distribution grids,” in _China International Conference on Electricity Distribution_ , 2014, pp. 962–964.
  * [3] J. Zhang and M. L. Huang, “5ws model for big data analysis and visualization,” in _IEEE International Conference on Computational Science and Engineering_ , 2013, pp. 1021–1028.
  * [4] M. Mayilvaganan and M. Sabitha, _A cloud-based architecture for Big-Data analytics in smart grid: A proposal_ , 2013.
  * [5] X. He, Q. Ai, R. C. Qiu, W. Huang, L. Piao, and H. Liu, “A big data architecture design for smart grids based on random matrix theory,” _IEEE Transactions on Smart Grid_ , vol. 8, no. 2, pp. 674–686, 2017.
  * [6] X. He, R. C. Qiu, Q. Ai, and X. Xu, “An unsupervised learning method for early event detection in smart grid with big data,” _Computer Science_ , 2015.
  * [7] L. Chu, R. C. Qiu, X. He, Z. Ling, and Y. Liu, “Massive streaming pmu data modeling and analytics in smart grid state evaluation based on multiple high-dimensional covariance tests,” _IEEE Transactions on Big Data_ , vol. PP, no. 99, pp. 1–1, 2016.
  * [8] M. J. Smith and K. Wedeward, “Event detection and location in electric power systems using constrained optimization,” in _IEEE Power and Energy Society General Meeting_ , 2009, pp. 1–6.
  * [9] S. Soltan, D. Mazauric, and G. Zussman, “Cascading failures in power grids:analysis and algorithms,” in _International Conference on Future Energy Systems_ , 2014, pp. 195–206.
  * [10] M. He and J. Zhang, “A dependency graph approach for fault detection and localization towards secure smart grid,” _IEEE Transactions on Smart Grid_ , vol. 2, no. 2, pp. 342–351, 2011.
  * [11] L. Xie, Y. Chen, and P. R. Kumar, “Dimensionality reduction of synchrophasor data for early event detection: Linearized analysis,” _IEEE Transactions on Power Systems_ , vol. 29, no. 6, pp. 2784–2794, 2014.
  * [12] M. Rafferty, X. Liu, D. M. Laverty, and S. Mcloone, “Real-time multiple event detection and classification using moving window pca,” _IEEE Transactions on Smart Grid_ , vol. 7, no. 5, pp. 2537–2548, 2016.
  * [13] Y. Wang, M. Liu, and Z. Bao, “Deep learning neural network for power system fault diagnosis,” in _Control Conference_ , 2016, pp. 6678–6683.
  * [14] S. Naderian and A. Salemnia, “An implementation of type‐2 fuzzy kernel based support vector machine algorithm for power quality events classification,” _International Transactions on Electrical Energy Systems_ , vol. 27, no. 5, pp. –, 2016.
  * [15] M. Forni, A. Giovannelli, M. Lippi, and S. Soccorsi, “Dynamic factor model with infinite dimensional factor space: Forecasting,” _Center for Economic Research_ , 2016.
  * [16] J. Yeo and G. Papanicolaou, “Random matrix approach to estimation of high-dimensional factor models,” _Papers_ , 2016.
  * [17] Z. Sun, X. Liu, and L. Wang, “A hybrid segmentation method for multivariate time series based on the dynamic factor model,” _Stochastic Environmental Research and Risk Assessment_ , pp. 1–14, 2016.
  * [18] E. P. Wigner, “On a class of analytic functions from the quantum theory of collisions,” _Annals of Mathematics_ , vol. 53, no. 1, pp. 36–67, 1951.
  * [19] V. Plerou, P. Gopikrishnan, B. Rosenow, L. A. N. Amaral, and H. E. Stanley, “Universal and non-universal properties of cross-correlations in financial time series,” _Papers_ , vol. 83, no. 7, pp. 1471–1474, 2012.
  * [20] L. LALOUX, P. CIZEAU, M. POTTERS, and J.-P. BOUCHAUD, “Random matrix theory and financial correlations,” _International Journal of Theoretical and Applied Finance_ , vol. 3, no. 03, pp. 391–397, 2000.
  * [21] S. C. Chevalier and P. D. H. Hines, “Identifying system-wide early warning signs of instability in stochastic power systems,” in _Power and Energy Society General Meeting_ , 2016, pp. 1–5.
  * [22] C. Xu, J. Liang, Z. Yun, and L. Zhang, “The small-disturbance voltage stability analysis through adaptive ar model based on pmu,” in _Transmission and Distribution Conference and Exhibition: Asia and Pacific, 2005 IEEE/PES_ , 2005, pp. 1–5.
  * [23] L. Zhang, “Spectral analysis of large dimentional random matrices,” _Ph D_ , 2007.
  * [24] R. Qiu and M. Wicks, _Cognitive Networked Sensing and Big Data_. Springer Publishing Company, Incorporated, 2013.
  * [25] D. L. Donoho, “High-dimensional data analysis: The curses and blessings of dimensionality,” 2000.
  * [26] Z. Burda, A. Jarosz, M. A. Nowak, and M. Snarska, “A random matrix approach to varma processes,” vol. 12, no. 1002.0934, pp. 1653–1655, 2010.
  * [27] R. D. Zimmerman and C. E. Murillo-Sánchez, “Matpower 4.1 user’s manual,” _Power Systems Engineering Research Center_ , 2011.
  * [28] B. Z, J. J, and W. B, “Spectral moments of correlated wishart matrices.” _Phys.rev.e_ , vol. 71, no. 2 Pt 2, p. 026111, 2005.