<figure><img src="image_1.png" /></figure>

HAL
open science

# A Gibbs sampler for removing environmental effects in structural health monitoring features

Max Champneys, Tim Rogers, Elizabeth Cross, Keith Worden

► To cite this version:

Max Champneys, Tim Rogers, Elizabeth Cross, Keith Worden. A Gibbs sampler for removing environmental effects in structural health monitoring features. 11th International Operational Modal Analysis Conference, Institut National de Recherche en Informatique et en Automatique [Inria], May 2025, Rennes, France. hal-05398607

HAL Id: hal-05398607

https://hal.science/hal-05398607v1

Submitted on 4 Dec 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A Gibbs sampler for removing environmental effects in structural health monitoring features

Max D. Champneys<fnref n="1" />, Tim J. Rogers<fnref n="1" />, Elizabeth J. Cross<fnref n="1" />, and Keith Worden<fnref n="1" />

## ABSTRACT

A core challenge in the widespread adoption of structural health monitoring (SHM) is the generation of robust, damage sensitive features. Many damage detection algorithms implicitly assume that features are stationary in time, interpreting non-stationarity as evidence for damage. It is well understood in the SHM literature that non-damage effects such as environmental and operating variations (EOVs) can lead to non-stationarity in SHM features. Cointegration is a method that has been proposed as a solution to EOVs in SHM that projects several features onto a reduced basis wherein they are stationary in time. Applications of cointegration to SHM thus far have focussed on maximum-likelihood solutions for the cointegrating vectors; although effective, deterministic approaches are unable to account for uncertainties in the projection. In this work, a Bayesian view of cointegration is taken in the context of SHM for the first time. Because the underlying inference task is intractable for most forms of prior belief in the cointegrating vectors, a convenient Hamiltonian Monte-Carlo (HMC) within Gibbs sampling scheme is proposed. Access to distributional estimates of damage-sensitive features enables a robust novelty detection that correctly incorporates uncertainties arising from the cointegrating projection. The proposed approach is demonstrated on an experimental case study and found to give rise to highly robust damage sensitive features.

Keywords: Cointegration, Environmental and operating variations, Gibbs sampling (Population-based) Structural health monitoring, Bayesian inference

## 1. INTRODUCTION

Structural health monitoring (SHM) is a prominent area of engineering research that enables practitioners to deduce and act upon the health state (i.e. damage) of infrastructure based on measured data [1]. SHM offers significant advantages over traditional inspection-based monitoring campaigns including continuous monitoring, reduced downtime and maintenance based on health state predictions. SHM operations

<footnote n="1">¹ Dynamics research group (DRG), University of Sheffield, max.champneys@sheffield.ac.uk</footnote>
often have a hierarchical structure with comparatively easier tasks (damage detection) underpinning more complex ones (localisation, prognosis) [2].

A key challenge in the practical application of SHM is the treatment of environmental and operating variations (EOVs) [3, 4]. Environmental effects such as weather and temperature and operating conditions such as traffic and power load can introduce non-stationarity in measured data. Unless the EOCs are properly accounted for, they can have deleterious effects on an SHM campaign. For example, a damage detection scheme may rely on determining whether damage-sensitive features leave a specified trust region. In this setting EOVs may introduce non-stationarity in the features leading to a false positive damage classification. To date, several approaches have been proposed to manage the effects of EOCs in SHM, including advanced feature extraction [5], nonlinear regression [6], Gaussian processes [7] and population-based approaches [8].

One of the most successful approaches for the treatment of EOVs and nonstationary features in SHM is cointegration [9]. Highly popular in the field of econometrics [10], the techniques were recently applied to SHM in a series of works [9, 11, 12] using a maximum-likelihood approach. Given the significant interest in Bayesian approaches in SHM [13, 14], it is of interest to consider methods that are able to quantify uncertainty in cointegration.

Although Bayesian approaches to obtaining the cointegrating relationships are available in the econometrics literature [15], as far as the authors are aware, these have yet to be applied in the context of SHM. In this work, a Bayesian approach to cointegration is proposed for SHM. The result is a distributional representation of stationary features with the effect of EOVs removed. This posterior distribution quantifies the uncertainty present in the data and the cointegrating relationships while permitting the inclusion of engineering insights as flexible prior knowledge.

## 2. COINTEGRATION AND SHM

For the convenience of the reader, an overview of cointegration for SHM is included here. For additional detail, the interested reader is directed to [9].

Two or more non-stationary<fnref n="1" /> time series $x(t)$ are said to be cointegrated if a linear combination of them is stationary in time (their joint probability density function is time-independent),

$$z(t) = \beta^T x(t) \qquad (1)$$

where $\beta$ are known as the cointegrating vectors and where $z(t)$ is a stationary signal i.e.,

$$p(z(t), \dots, z(t_n)) = p(z(t + \tau), \dots, z(t_n + \tau)) \quad \forall t, \tau \qquad (2)$$

This has important ramifications for SHM. Consider the case of several damage-sensitive features (e.g. natural frequencies) recorded from a structure over a period of healthy operation. The presence of changing environmental and operating conditions (e.g. temperature) may cause fluctuations in these features that lead to non-stationarity that cannot be attributed to damage. This makes the individual features $x_i$ unsuitable for standard outlier analysis as the distribution $p(x(t))$ is non-stationary in time.

In the case that damage sensitive features are cointegrated, the projected residuals $z(t) = \beta^T x(t)$ are suitable for outlier analysis as they are once again stationary (and the effect of the EOVs has been removed). Incredibly, this process has been achieved without requiring measurements of the environmental condition variables (or even specifying what they are). A remarkable result.

<footnote n="1">¹Strictly, the time series must be integrated of order one ($I(1)$), verifiable by the augmented Dickey-Fuller test (ADFT) [16].</footnote>
Application of cointegration methods to SHM requires specification of the cointegrating vectors $\beta$. In the literature, several approaches for obtaining estimates of $\beta$ from measured features $x(t)$ are available. The typical approach is to fit a type of autoregressive model known as a vector error-corrector model (VECM) of the form,

$$ \Delta x(t) = x(t) - x(t-1) = \Pi x(t-1) + \sum_{i=1}^{k-1} \Psi \Delta x(t-i) + \epsilon(t) \quad (3) $$

where $\Pi$ and $\Psi$ are unknown parameter matrices and $\epsilon(t)$ is an i.i.d Gaussian sequence with Covariance $\Sigma$. Or equivalently in matrix form,

$$ Z_0 = \Pi Z_1 + \Psi Z_2 + \epsilon(t) \quad (4) $$

where the $Z_i$ are data matrices given by,

$$ \begin{aligned} Z_0 &= \Delta x(t) \\ Z_1 &= x(t-1) \\ Z_2 &= H(\Delta x(t-1)) \end{aligned} \quad (5) $$

where $H(\cdot)$ is the Hankel operator with $k$ lags. The existence of the VECM model above is a sufficient condition for cointegration (and vice-versa) by the Granger representation theorem [17]. The number of cointegrating relationships is determined by the rank of the matrix $\Pi$. By decomposing $\Pi$ as,

$$ \Pi = \alpha \beta^T \quad (6) $$

where $\alpha$ and $\beta$ are of size $d \times r$ (for $\Pi$ with shape $d \times d$), or equivalently $\Pi$ is of rank $r$. Then the features $x(t)$ can be said to be *cointegrated of order $r$*. In the context of SHM, this implies that there are $r$ stationary features $z(t)$ that can be computed from the non-stationary $x(t)$,

$$ z(t) = \beta^T x(t) \quad (7) $$

Perhaps the most common approach is to evaluate a maximum likelihood estimate for $\beta$ by the Johansen procedure [18, 19]. This approach has been shown to be successful in obtaining stationary features for outlier analysis in both simulated and experimental case studies [9]. However, the focus of the current work is to enumerate posterior distributions over the unknown projection $\beta$ and residuals $z(t)$.

### 3. A GIBBS SAMPLER FOR THE COINTEGRATING VECTORS

This section introduces a Bayesian inference scheme for the parameters of the VECM. Although the VECM model in 4 implies a Gaussian likelihood, it is nonlinear in the parameters of interest $\alpha, \beta$, and so a standard conjugate analysis cannot be applied. Instead, after [15], the approach here will be to sample the unknown parameter matrices $\alpha, \Psi, \Sigma$ from their respective full conditional distributions using Gibbs moves (closed form updates from conjugate priors), and then sample $\beta$ from a Hamiltonian Monte Carlo (HMC) scheme, allowing for an arbitrary prior structure on the cointegrating relationships.
As $\alpha, \Psi, \Sigma$ are matrix quantities (and $Z_0$ is vector valued in time), it will be necessary to formulate the update equations in terms of matrix Normal distributions (i.e. Bayesian multivariate linear regression). The derivation of conjugate update equations for the matrix Normal distribution is not included here, however the interested reader is directed to [20] for a full treatment.

The proposed HMC-within-Gibbs sampler proceeds as follows: First, a new sample for $\alpha$ is drawn from $p(\alpha|\cdot)$. The appropriate conjugate prior is matrix-Normal,

$$p(\alpha) = \mathcal{MN}(M_{\alpha}, \Sigma, V_{\alpha}) \qquad (8)$$

The new value of the $\alpha$ parameter can thus be sampled from the appropriate full conditional as,

$$\alpha \sim p(\alpha|\cdot) = \mathcal{MN}(\hat{M}_{\alpha}, \Sigma, \hat{V}_{\alpha}) \qquad (9)$$

where,

$$\begin{aligned}
\hat{V}_{\alpha} &= (X_{\alpha}^{T} X_{\alpha} + V_{\alpha}^{-1})^{-1} \\
\hat{M}_{\alpha} &= \hat{V}_{\alpha} (X_{\alpha}^{T} (Z_{0} - Z_{2} \Psi)^{T} + V_{\alpha}^{-1} M_{\alpha}) \\
X_{\alpha} &= Z_{1} \beta
\end{aligned} \qquad (10)$$

Then, new samples for $\Psi, \Sigma$ are drawn from the joint conditional distribution $p(\Psi, \Sigma|\cdot)$. The conjugate prior here is hierarchical and of the form,

$$p(\Psi, \Sigma) = p(\Sigma)p(\Psi|\Sigma) = \mathcal{IW}(V_{\sigma}, \nu_{\Sigma})\mathcal{MN}(M_{\Psi}, \Sigma, V_{\Psi}) \qquad (11)$$

The new parameter values can then be drawn from the corresponding full conditional distributions,

$$\begin{aligned}
\Sigma &\sim p(\Sigma|\cdot) = \mathcal{IW}(\hat{V}_{\sigma}, \hat{\nu}_{\Sigma}) \\
\Psi &\sim p(\Psi|\Sigma, \cdot) = \mathcal{MN}(\hat{M}_{\Psi}, \Sigma, \hat{V}_{\Psi})
\end{aligned} \qquad (12)$$

where,

$$\begin{aligned}
\hat{V}_{\Psi} &= (X_{\Psi}^{T} X_{\Psi} + V_{\Psi}^{-1})^{-1} \\
\hat{M}_{\Psi} &= \hat{V}_{\Psi} (X_{\Psi}^{T} (Z_{0} - Z_{1} \beta \alpha^{T}) + V_{\Psi}^{-1} M_{\Psi}) \\
\hat{V}_{\Sigma} &= V_{\Sigma} + (Y - X_{\Psi} \hat{M}_{\Psi})^{T} (Y - X_{\Psi} \hat{M}_{\Psi}) + (\hat{M}_{\Psi} - M_{\Psi})^{T} V_{\Psi}^{-1} (\hat{M}_{\Psi} - M_{\Psi}) \\
\hat{\nu}_{\Sigma} &= \nu_{\Sigma} + N \\
X_{\Psi} &= Z_{2}
\end{aligned} \qquad (13)$$

Finally, a new sample for $\beta$ is drawn from a Hamiltonian Monte-Carlo scheme [21]. An overview of the overall approach is given in Algorithm 1.
**Algorithm 1** HMC-within-Gibbs sampler for VECM parameters and stationary residuals.

**Require:** Conjugate priors over parameters $MN(M_\alpha, \Sigma, V_\alpha)$, $IW(V_\sigma, \nu_\Sigma)MN(M_\Psi, \Sigma, V_\Psi)$, prior over cointegrating vectors $p(\beta)$, order of cointegration $r$.

1. Initialize the chain at the Johansen estimate of $\beta$ and from the prior distributions of $\alpha, \Psi, \Sigma$.

2. **for** $i = 1$ to $N_{\text{samples}}$ **do**

3. Set $\alpha_i \leftarrow \alpha \sim p(\alpha|\cdot)$ from equation (9) with all other parameters fixed.

4. Set $\Sigma_i \leftarrow \Sigma \sim p(\Sigma|\cdot)$ from equation (12) with all other parameters fixed.

5. Set $\Psi_i \leftarrow \Psi \sim p(\Psi|\Sigma, \cdot)$ from equation (12) with all other parameters fixed.

6. Draw $\beta_i$ from a HMC scheme with all other parameters fixed.

7. **end for**

8. Compute residuals sample wise, $z_i(t) = \beta_i^T x(t)$

9. **return** Samples of stationary residual signals $z_i(t)$ approximating $p(z(t))$.

## 4. EXPERIMENTAL CASE STUDY

In this section, the Gibbs sampler established above is applied to an experimental SHM dataset subject to EOVs. The dataset under consideration comes from a Lamb-wave inspection investigation of a composite panel subject to temperature variations in an environmental chamber. The data were collected as part of the Brite-Euram project DAMASCOS (BE97 4213) [5]. The dataset consists of Lamb-wave recordings, collected every minute for a total of 2944 minutes and consisting of three distinct phases.

* Phase I: For the first 1355 minutes, the chamber temperature was held at 25°C.

* Phase II: For the next 1126 minutes, the chamber temperature was varied between 10°C and 30°C with a cycle time of approximately 370 minutes.

* Phase III: At minute 2483, the chamber was opened and damage was introduced by drilling a 10mm hole in the centre of the plate. A further 461 minutes of data were collected continuing the same variation between 10°C and 30°C.

Feature extraction is conducted by considering 50 spectral lines around the peak of the power spectrum of the measured acceleration data. For a more complete description of the data, the interested reader is directed to [5]. A training set (comprised of data from minutes 1000 to 2000) was extracted from the overall dataset. In order to capture both the stationary and non-stationary behaviour of the features, the training set comprises examples from both phases I and II. Before the Gibbs sampler in Algorithm 1 can be applied, it is important to ascertain which features are suitable for cointegration analysis by performing an augmented Dickey-Fuller test (ADFT) for $I(1)$ non-stationarity. In total 37 of the 50 features in the training set were found to be $I(1)$ at a confidence level of 0.05. Figure 1 depicts all 50 features, indicating which are used for training and the damage regime.

With the training data established, the 37 $I(1)$ features are used to estimate the posterior distributions of VECM parameters using Algorithm 1. After [9], only a single cointegrating relationship ($r = 1$) is considered in this study. All prior distributions are set to weakly informative zero-mean, unit variance Gaussian distributions. During the inference, all cointegrating vectors $\beta$ are scaled to have a unit norm. For the HMC sampling, the no U-turn sampler (NUTS) is employed [21]. Overall, 6000 samples are collected and the first 1000 are discarded to remove the effect of any transient burn-in behaviour. Samples and a three standard deviation confidence interval from the resulting posterior distribution over the stationary residuals are plotted in Figure 2. So that the obtained posterior can be used for outlier analysis, an empirical normal condition is derived from the samples of $z(t)$ in the training regime. The empirical normal condition evaluated here is the Gaussian distribution $N(E[z], V[z])$ where $E[z], V[z]$ are inferred alongside the other VECM parameters in an auxiliary HMC sampling step. A three standard-deviation threshold is plotted as horizontal dashed lines in Figure 2.
<figure><img src="image_3.png" /><figcaption>**Figure 1:** DAMASCOS data used in the case study example.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>**Figure 2:** Posterior stationary residual. Left axis: Samples and ±3σ interval for the stationarity residual as well as the maximum likelihood estimate (obtained by the Johansen method [19]). Right axis: Log likelihood of *z* under the empirical stationary distribution obtained from the *z*(t) in the training regime.</figcaption></figure>
As can be seen in Figure 2, the distribution over the stationary residual remains largely stationary during the undamaged phases I and II of testing. The onset of damage is marked by an explosion in the variance of the posterior $z(t)$, indicating a significant deviation from the normal operating condition of the structure. This is further evidenced by consideration of the sample-wise log-likelihood of the empirical normal condition distribution (Figure 2, right axis). As can be seen in the Figure, the log-likelihood remains constant during the undamaged testing and the onset of damage coincides with a massive reduction in the likelihood of normal operation, indicating that the identified distributional feature is highly damage sensitive.

## 5. CONCLUSIONS

In conclusion, this work presets a HMC-within-Gibbs sampling scheme for Bayesian identification of stationary residuals for use as damage-sensitive features in SHM. The results of this approach in an experimental case study indicate that the resulting posterior distributions are highly damage sensitive. While these early results are promising, important areas for future investigation remain. Given the distributional nature of the identified features, it is interesting to imagine how a standard outlier approach might be extracted to make the best use of this information. It is also of interest to consider how the Bayesian approach proposed herein might be applied in the context of populations of structures. Thus far, only linear cointegrating relationships have been considered. In the maximum-likelihood setting, nonlinear cointegration has been considered as a method for removing the nonlinear effects of EOVs in SHM [22, 23]. The Bayesian treatment of nonlinear cointegration in the context of SHM is a further avenue for future investigation.

## ACKNOWLEDGMENTS

MDC gratefully acknowledges the support of the Centre for Machine Intelligence (CMI) within the University of Sheffield.

The authors of this paper gratefully acknowledge the support of the UK Engineering and Physical Sciences Research Council (EPSRC) via grant reference EP/W005816/1. For the purpose of open access, the authors have applied a Creative Commons Attribution (CC BY) licence to any Author Accepted Manuscript version arising.

## REFERENCES

[1] C. R. Farrar and K. Worden. *Structural health monitoring: a machine learning perspective*. John Wiley & Sons, 2012.

[2] A. Rytter. *Vibrational based inspection of civil engineering structures*. PhD thesis, 1993.

[3] H. Sohn. Effects of environmental and operational variability on structural health monitoring. *Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences*, 2007.

[4] E. Cross. *On structural health monitoring in changing environmental and operational conditions*. PhD thesis, University of Sheffield, 2012.

[5] E. Cross, G. Manson, K. Worden, and S. Pierce. Features for damage detection with insensitivity to environmental and operational variations. *Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences*, 2012.

[6] C. Roberts, L. D. Avendaño-Valencia, and D. G. Cava. Robust mitigation of EOVs using multi-variate nonlinear regression within a vibration-based SHM methodology. *Mechanical Systems and Signal Processing*, 2024.
[7] N. Dervilis, H. Shi, K. Worden, and E. Cross. Exploring environmental and operational variations in SHM data using heteroscedastic Gaussian processes. In *Dynamics of Civil Structures, Volume 2: Proceedings of the 34th IMAC, A Conference and Exposition on Structural Dynamics 2016*. Springer, 2016.

[8] W. Lin, K. Worden, A. Eoghan Maguire, and E. J. Cross. Towards population-based structural health monitoring, Part VII: EOV fields-environmental mapping. In *Topics in Modal Analysis & Testing, Volume 8: Proceedings of the 38th IMAC, A Conference and Exposition on Structural Dynamics 2020*. Springer, 2021.

[9] E. J. Cross, K. Worden, and Q. Chen. Cointegration: a novel approach for the removal of environmental trends in structural health monitoring data. *Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences*, 2011.

[10] R. Perman. Cointegration: an introduction to the literature. *Journal of Economic Studies*, 1991.

[11] E. J. Cross and K. Worden. Cointegration and why it works for SHM. In *Journal of physics: conference series*, volume 382. IOP Publishing, 2012.

[12] K. Worden, E. Cross, I. Antoniadou, and A. Kyprianou. A multiresolution approach to cointegration for enhanced SHM of structures under varying conditions-an exploratory study. *Mechanical Systems and Signal Processing*, 2014.

[13] M. W. Vanik, J. L. Beck, and S.-K. Au. Bayesian probabilistic approach to structural health monitoring. *Journal of Engineering Mechanics*, 2000.

[14] L. A. Bull, P. Gardner, T. J. Rogers, E. J. Cross, N. Dervilis, and K. Worden. Probabilistic inference for structural health monitoring: New modes of learning from data. *ASCE-ASME Journal of Risk and Uncertainty in Engineering Systems, Part A: Civil Engineering*, 2021.

[15] G. Koop, R. Strachan, H. Van Dijk, and M. Villani. Bayesian approaches to cointegration. 2006.

[16] D. A. Dickey and W. A. Fuller. Distribution of the estimators for autoregressive time series with a unit root. *Journal of the American statistical association*, 1979.

[17] R. F. Engle and C. W. Granger. Co-integration and error correction: representation, estimation, and testing. *Econometrica: journal of the Econometric Society*, 1987.

[18] S. Johansen. Estimation and hypothesis testing of cointegration vectors in Gaussian vector autoregressive models. *Econometrica: journal of the Econometric Society*, 1991.

[19] S. Johansen. Statistical analysis of cointegration vectors. *Journal of economic dynamics and control*, 1988.

[20] T. Minka. Bayesian linear regression. Technical report, Citeseer, 2000.

[21] M. D. Hoffman, A. Gelman, et al. The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. *J. Mach. Learn. Res.*, 2014.

[22] E. J. Cross and K. Worden. Approaches to nonlinear cointegration with a view towards applications in SHM. In *Journal of Physics: Conference Series*, volume 305. IOP Publishing, 2011.

[23] H. Shi, K. Worden, and E. Cross. A nonlinear cointegration approach with applications to structural health monitoring. In *Journal of Physics: Conference Series*, volume 744. IOP Publishing, 2016.