## 3 Methods
### A State Space Model (SSM) Incorporating an Intervention Analysis  
Whilst HMMs apply to scenarios where the state process is discrete-valued, we also apply an SSM allowing for interventions. Here, the state process is continuous-valued and interventions are related to times/events of aerosol exceedances or declines. Intervention analysis, initially proposed by [PERSON] and [PERSON] in 1975 [73], provides a structured approach for evaluating the influence of an intervention on a given time series. An intervention is considered to be an event that brings about a shift in the time series, affecting not only its average behavior, but also potentially altering characteristics such as the conditional variance and the properties of serial correlation [74].  
For a time series \(Y_{t}\), this general intervention model is given by  
\[Y_{t}=m_{t}+N_{t}, \tag{7}\]  
where \(m_{t}\) is the change in the mean function and \(N_{t}\) is modeled as another process, such as a seasonal or harmonic process or a trend model. The sequence \(N_{t}\) denotes the segment without any intervention and is known as the inherent or unaffected process. This process may exhibit features of stationarity or non-stationarity, seasonality, or lack thereof.  
Assume the moment in time, \(T\), marks the occurrence of the intervention. Prior to \(T\), \(m_{t}\) is presumed to be consistently zero. The set \(Y_{t},t<T\) is termed as pre-intervention data and is used to define the model for the unaffected process \(N_{t}\).  
Figure 10: Graphical models associated with extensions to the basic HMM. (**A**) state sequence with a memory order of 2. (**B**) influence of covariate \(z_{1},\ldots,z_{T}\) on state dynamics. (**C**) observations depending on both states and previous observations. (**D**) bivariate observation sequence, conditionally independent given the states. Source: [72].  
To delineate the impact of the intervention on the mean function the step function can be determined as:  
\[S_{t}^{(T)}=\begin{cases}1,&\text{if }t\geq T\\ 0,&\text{otherwise.}\end{cases} \tag{8}\]  
Hence the values of \(S_{t}^{(T)}\) will be 0 during the pre-intervention period and 1 in the post-intervention period. Then we define the pulse function as follows:  
\[P_{t}^{(T)}=S_{t}^{(T)}-S_{t-1}^{(T)} \tag{9}\]  
The pulse function above is equal to 1 at the time point T and 0 elsewhere, indicating the point where the intervention occurred.  
Implementation of the Intervention Analysis  
The intervention analysis is applied in this study with the dynlm package in R [75]. The dynlm package is a powerful tool for conducting dynamic linear modeling, and is particularly well-suited for time series analysis and intervention studies. The package primarily focuses on fitting dynamic linear models while preserving the characteristics of time series data, with a single main function [76]. It provides a flexible framework for modeling relationships in data that evolve over time, allowing for lagged effects and dynamic dependencies. This package's capabilities accommodate time-dependent variables and interventions. By incorporating lagged terms, the temporal dependencies can be captured. Furthermore, the inclusion of intervention variables enables the assessment of the impact of specific events or interventions on the time series under investigation.