# Fine-Grained Mapping Between Daily Activity Features in Smart Homes
## 3 The Proposed Approach
### Preliminary  
To better describe the proposed method, we first provide some formal terms related to the method.  
**Definition 1**.: _For a given smart home SH, FA(SH) = {fu\({}_{1}\),fu\({}_{2}\),...} represents the **set of functional areas** within SH._  
**Definition 2**.: _For a given smart home SH, SC(SH) = {sc\({}_{1}\),sc\({}_{2}\),...} represents the **set of categories of equipped sensors** within SH._  
**Definition 3**.: _For a given smart home SH, SEN(SH) = {s\({}_{1}\),s\({}_{2}\),...} represents the **set of equipped sensors** within SH._  
**Definition 4**.: _For a given smart home SH and s \(\in\) SEN(SH), s = (id, ca, fu) is defined as a **sensor**, where s.id represents the sensor's unique identifier, s.ca denotes its category, and s.fu indicates the functional area where it is installed. For example, s = (M008, M, bedroom) specifies a sensor with the identifier \"M008\" and the category \"M\", installed in the bedroom._  
**Definition 5**.: _For a given smart home SH, DAC(SH) = {da\({}_{1}\),da\({}_{2}\),...} represents the **set of categories of involved daily activities** within SH._  
**Definition 6**.: _For a given smart home SH and s \(\in\) SEN(SH), a **sensor event** ev(s) = (d, t, s.id, v, dal) is defined, where d and t represent the date and time of the event, v denotes the sensor's recorded value, and dal indicates the category of the daily activity triggered by the activation of s._  
**Definition 7**.: _For a given smart home SH and \(s_{1}\), \(s_{2}\in\) SEN(SH), ev(\(s_{1}\)) is defined as the **precursor** of ev(\(s_{2}\)), and ev(\(s_{2}\)) is defined as the **successor** of ev(\(s_{1}\)) if either ev(\(s_{1}\)).d == ev(\(s_{2}\)).d \(\wedge\) ev(\(s_{1}\)). t < ev(\(s_{2}\)). t is satisfied or ev(\(s_{1}\)).d < ev(\(s_{2}\)).d is satisfied._  
**Definition 8**.: _For two sensor events ev(\(s_{1}\)) and ev(\(s_{2}\)), where ev(\(s_{1}\)) is the precursor of ev(\(s_{2}\)). ev(\(s_{1}\)) is called the **direct precursor** of ev(\(s_{2}\)), and ev(\(s_{2}\)) is called the **direct successor** of ev(\(s_{1}\)) if no other event ev(\(s\)) such as ev(\(s_{1}\)) < ev(\(s\)) and ev(\(s\)) < ev(\(s_{2}\)) hold. The notation ev(\(s_{1}\))\(\rightarrow\)ev(\(s_{2}\)) is used to indicate that ev(\(s_{1}\)) is the direct precursor of ev(\(s_{2}\))._  
**Definition 9**.: _Given n sensor events ev(\(s_{1}\)), ev(\(s_{2}\)),..., ev(\(s_{n}\)), the sequence <ev(\(s_{1}\)), ev(\(s_{2}\)),..., ev(\(s_{n}\))> is called a **sensor events stream** if \(\forall 1\leq i\leq n-1\), ev(\(s_{i}\))\(\rightarrow\)ev(\(s_{i+1}\)) holds._  
For a smart home \(SH\), let _FA(SH) = {Bedroom, Toilet, Kitchen, Living Room, Shower Room}_. Let _SEN(SH) = {M008, M009, LS008, LS004, LS003, LS016, MA008}_, where _SC_(SH) = {_M_, _LS_, _MA_} represents the categories, with {_M008, M009_} as infrared motion sensors (M), {_LS008, LS004, LS003, LS016_} as light sensors (LS), and {_MA008_} as wide-area infrared motion sensors (MA). Let _DAC_(\(SH\)) = {_Sleep, Bath, Cook_Breakfast_} represent daily activities. Table 1 presents a fragment of a sensor event stream activated by the \"Sleep\" activity, where each line denotes a sensor event. Two adjacent sensor events are direct predecessors or direct successors of each other.