**Kalman Filter Models for the Prediction of Individualised Thermal Work Strain** Provisional chapter

Kalman Filter Models for the Prediction of Individualised

DOI: 10.5772/intechopen.71205

Jia Guo, Ying Chen, Weiping Priscilla Fan, Si Hui Maureen Lee, Junxian Ong, Poh Ling Tan, Thermal Work Strain

Yu Li Lydia Law, Kai Wei Jason Lee and Jia Guo, Ying Chen, Weiping Priscilla Fan,

Kok-Yong Seng Si Hui Maureen Lee, Junxian Ong,

Additional information is available at the end of the chapter Kai Wei Jason Lee and Kok-Yong Seng

http://dx.doi.org/10.5772/intechopen.71205 Additional information is available at the end of the chapter

Poh Ling Tan, Yu Li Lydia Law,

#### Abstract

It is important to monitor and assess the physiological strain of individuals working in hot environments to avoid heat illness and performance degradation. The body core temperature (Tc) is a reliable indicator of thermal work strain. However, measuring Tc is invasive and often inconvenient and impractical for real-time monitoring of workers in high heat strain environments. Seeking a better solution, the main aim of the present study was to investigate the Kalman filter method to enable the estimation of heat strain from non-invasive measurements (heart rate (HR) and chest skin temperature (ST)) obtained 'online' via wearable body sensors. In particular, we developed two Kalman filter models. First, an extended Kalman filter (EFK) was implemented in a cubic state space modelling framework (HR versus Tc) with a stage-wise, autoregressive exogenous model (incorporating HR and ST) as the time update model. Under the second model, the online Kalman filter (OFK) approach builds up the time update equation depending only on the initial value of Tc and the latest value of the exogenous variables. Both models were trained and validated using data from laboratoryand outfield-based heat strain profiling studies in which subjects performed a high intensity military foot march. While both the EKF and OKF models provided satisfactory estimates of Tc, the results showed an overall superior performance of the OKF model (overall root mean square error, RMSE = 0.31C) compared to the EKF model (RMSE = 0.45C).

Keywords: heat strain, body core temperature, wearable body sensors extended Kalman filter, online Kalman filter

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

### 1. Introduction

Physically demanding tasks, environmental heat and humidity and various clothing requirements combine to create heat stress for workers. The associated physiological responses to that stress, e.g. increased body core temperature (Tc), heart rate (HR) and sweating, are collectively known as physiological strain. Physiological strain rises with the heat stress, and if not controlled, may diminish the quality and productivity of job performance. Left unchecked, high levels of heat strain may also result in increased accident rates and an increased risk of heatrelated disorders including unconsciousness and cardiac arrest. Heat casualties are a concern to the military, first responders and industrial workers [1–3].

relationship between time-varying HR and Tc [13–15]. Their results have indicated that 95% of all predictions fell within 0.48–0.63C for different study cohorts. However, the developmental datasets contained only a limited amount of data at high Tc (≥39C) and thus most of these statistics are based on the lower Tc values, which may limit the model's ability to reliably predict hyperthermic body temperatures. Further, the validity of the Tc estimates in human subjects with differing demographics and working in a predominantly hot and humid climate was unclear. We implemented an extended Kalman filter (EKF) model using a non-linear (cubic) state space model (ST versus Tc) with a stage-wise, autoregressive exogenous model (incorporating HR) as the time update model [11]. We showed that the EKF model predicted Tc more precisely [root mean square error (RMSE) was 0.29C] compared to KF models that relied only on HR as an explanatory variable (RMSD = 0.33C). However, our model was developed using only laboratory data as developmental data and thus lacked assessment against data

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

http://dx.doi.org/10.5772/intechopen.71205

121

While practical, the aforementioned KF models require previous estimates of Tc for continuous prediction of this latent variable. One major inherent limitation of such models is that when the forecast horizon increases, errors in the prediction would accumulate, which would progressively increase the prediction uncertainty even with the Kalman gains. This may give rise to grave clinical consequences since large prediction errors at high core temperature zones (for an individual who works continuously) could delay the application of cooling measures on heat

The main aim of this paper was to develop and investigate the potential of using online Kalman filter (OKF) models to improve the estimation of Tc over long time horizons as encountered during extended duration high intensity physical tasks, e.g. foot march. The OKF models comprised a time update equation that depends on the initial value of Tc and time-current value of the measurable exogenous variables such that the value of Tc at any time point is directly predicted. The second aim was to assess the comparative accuracy of Tc

Data for model development were derived from laboratory- and field-based heat strain profiling studies that involved different participants. The study protocols used in all studies were approved by the Institutional Review Board. All volunteers were briefed on the purpose, risks and benefits of the study and each gave their written informed consent prior to participation.

A total of 29 male volunteers [mean (range); age = 30 (26–33years), bodyweight = 68.4 (48.9– 87.6 kg), height = 1.71 (1.61–1.81 m), body mass index (BMI) = 23.7 (17.3–28.0 kg/m2

chamber. During the trials, all participants donned a standard infantry full battle order (FBO), comprising camouflage uniform, combat boots, body armour, load bearing vest with standard

)] performed a military 16 km foot march in a climatic

), body

predictions by the EFK and OFK models vis-à-vis-observed Tc.

measured in the field settings.

casualties.

2. Methods

2.1.1. Study 1 (laboratory study)

surface area (BSA) = 1.80 (1.52–2.07m2

2.1. Data

High Tc is one of the most reliable predictor of heat-related disorders and the ability to accurately monitor this variable could help mitigate the risk of heat injuries [4]. However, the measurement of Tc in an ambulatory setting is not straightforward. Traditional methods of Tc measurement typically require probes (e.g. rectal and oesophageal) but these are impractical for an ambulatory setting. While ingestible thermometer capsules (e.g. Philips Respironics, Murrysville, PA) have been used with success in laboratory and field settings, these instruments are relatively expensive, are unsuitable for individuals with food and drug administration contraindications, and while still in the stomach or upper intestine can suffer acute inaccuracies when cold fluids are ingested. This means that in many situations, the continuous ambulatory monitoring of Tc is still impractical. Alternative Tc surrogate methods, which seek some non-invasive core temperature correlate (e.g. surface heat flux), can be difficult to use consistently across different environments and lose precision when predicting for individuals [5].

Wearable activity trackers have emerged as an increasingly popular method for individuals to assess their daily physical activity and energy expenditure through sensing of physiological data, e.g. HR and surface skin temperature (ST) [6]. One means of overcoming Tc measurement problem is to estimate Tc based on other more readily available data obtained from such body worn sensors. From physiology, both HR and ST are closely related to work and heat stress. Serial HR measurements contain information about heat production [7] and heat transfer since HR is related to skin perfusion [8]. Similarly, because heat can be conducted from deep tissues to skin, an increase in Tc can lead to an elevation of ST over time [9]. Previous studies have also shown the promise of using HR and ST to estimate heat strain [10, 11].

Tapping on the wide availability of physiological measurements from increasingly ubiquitous wearable activity trackers and the physiological basis of associations between Tc with HR and ST, we applied the Kalman filter (KF) technique to track individual-specific Tc over time using time series observations of HR and ST. KF-based methods utilise a prediction-correction scheme to dynamically track and adjust both the system states (Tc for our application) and its uncertainty to agree with measurements (HR and ST) as they are made [12]. The system model expressed as a function of the state variable is used to iterate the distribution of Tc forward in time to produce a prediction, which is then corrected to both adjust the prediction and collapse its uncertainty.

The pursuit of reliable KF models to predict Tc is a subject of active investigation. Buller and co-authors have used the KF technique to estimate Tc by capturing the linear or quadratic relationship between time-varying HR and Tc [13–15]. Their results have indicated that 95% of all predictions fell within 0.48–0.63C for different study cohorts. However, the developmental datasets contained only a limited amount of data at high Tc (≥39C) and thus most of these statistics are based on the lower Tc values, which may limit the model's ability to reliably predict hyperthermic body temperatures. Further, the validity of the Tc estimates in human subjects with differing demographics and working in a predominantly hot and humid climate was unclear. We implemented an extended Kalman filter (EKF) model using a non-linear (cubic) state space model (ST versus Tc) with a stage-wise, autoregressive exogenous model (incorporating HR) as the time update model [11]. We showed that the EKF model predicted Tc more precisely [root mean square error (RMSE) was 0.29C] compared to KF models that relied only on HR as an explanatory variable (RMSD = 0.33C). However, our model was developed using only laboratory data as developmental data and thus lacked assessment against data measured in the field settings.

While practical, the aforementioned KF models require previous estimates of Tc for continuous prediction of this latent variable. One major inherent limitation of such models is that when the forecast horizon increases, errors in the prediction would accumulate, which would progressively increase the prediction uncertainty even with the Kalman gains. This may give rise to grave clinical consequences since large prediction errors at high core temperature zones (for an individual who works continuously) could delay the application of cooling measures on heat casualties.

The main aim of this paper was to develop and investigate the potential of using online Kalman filter (OKF) models to improve the estimation of Tc over long time horizons as encountered during extended duration high intensity physical tasks, e.g. foot march. The OKF models comprised a time update equation that depends on the initial value of Tc and time-current value of the measurable exogenous variables such that the value of Tc at any time point is directly predicted. The second aim was to assess the comparative accuracy of Tc predictions by the EFK and OFK models vis-à-vis-observed Tc.

### 2. Methods

### 2.1. Data

1. Introduction

120 Kalman Filters - Theory for Advanced Applications

individuals [5].

its uncertainty.

Physically demanding tasks, environmental heat and humidity and various clothing requirements combine to create heat stress for workers. The associated physiological responses to that stress, e.g. increased body core temperature (Tc), heart rate (HR) and sweating, are collectively known as physiological strain. Physiological strain rises with the heat stress, and if not controlled, may diminish the quality and productivity of job performance. Left unchecked, high levels of heat strain may also result in increased accident rates and an increased risk of heatrelated disorders including unconsciousness and cardiac arrest. Heat casualties are a concern

High Tc is one of the most reliable predictor of heat-related disorders and the ability to accurately monitor this variable could help mitigate the risk of heat injuries [4]. However, the measurement of Tc in an ambulatory setting is not straightforward. Traditional methods of Tc measurement typically require probes (e.g. rectal and oesophageal) but these are impractical for an ambulatory setting. While ingestible thermometer capsules (e.g. Philips Respironics, Murrysville, PA) have been used with success in laboratory and field settings, these instruments are relatively expensive, are unsuitable for individuals with food and drug administration contraindications, and while still in the stomach or upper intestine can suffer acute inaccuracies when cold fluids are ingested. This means that in many situations, the continuous ambulatory monitoring of Tc is still impractical. Alternative Tc surrogate methods, which seek some non-invasive core temperature correlate (e.g. surface heat flux), can be difficult to use consistently across different environments and lose precision when predicting for

Wearable activity trackers have emerged as an increasingly popular method for individuals to assess their daily physical activity and energy expenditure through sensing of physiological data, e.g. HR and surface skin temperature (ST) [6]. One means of overcoming Tc measurement problem is to estimate Tc based on other more readily available data obtained from such body worn sensors. From physiology, both HR and ST are closely related to work and heat stress. Serial HR measurements contain information about heat production [7] and heat transfer since HR is related to skin perfusion [8]. Similarly, because heat can be conducted from deep tissues to skin, an increase in Tc can lead to an elevation of ST over time [9]. Previous studies have also shown the promise of using HR and ST to estimate heat strain [10, 11].

Tapping on the wide availability of physiological measurements from increasingly ubiquitous wearable activity trackers and the physiological basis of associations between Tc with HR and ST, we applied the Kalman filter (KF) technique to track individual-specific Tc over time using time series observations of HR and ST. KF-based methods utilise a prediction-correction scheme to dynamically track and adjust both the system states (Tc for our application) and its uncertainty to agree with measurements (HR and ST) as they are made [12]. The system model expressed as a function of the state variable is used to iterate the distribution of Tc forward in time to produce a prediction, which is then corrected to both adjust the prediction and collapse

The pursuit of reliable KF models to predict Tc is a subject of active investigation. Buller and co-authors have used the KF technique to estimate Tc by capturing the linear or quadratic

to the military, first responders and industrial workers [1–3].

Data for model development were derived from laboratory- and field-based heat strain profiling studies that involved different participants. The study protocols used in all studies were approved by the Institutional Review Board. All volunteers were briefed on the purpose, risks and benefits of the study and each gave their written informed consent prior to participation.

### 2.1.1. Study 1 (laboratory study)

A total of 29 male volunteers [mean (range); age = 30 (26–33years), bodyweight = 68.4 (48.9– 87.6 kg), height = 1.71 (1.61–1.81 m), body mass index (BMI) = 23.7 (17.3–28.0 kg/m2 ), body surface area (BSA) = 1.80 (1.52–2.07m2 )] performed a military 16 km foot march in a climatic chamber. During the trials, all participants donned a standard infantry full battle order (FBO), comprising camouflage uniform, combat boots, body armour, load bearing vest with standard accessories, Kevlar helmet, rifle replica and a backpack filled with additional accessories, for the foot march. All back packs used in the study were packed in the same configuration. The foot march was composed of three rounds of 4 km followed by one round each of 3 km and 1 km marches on the treadmill at 5.3 km/h and 0% gradient, with each exercise bout separated by 15 min seated rest. Water was provided ad libitum to all participants. Environmental conditions in the climatic chamber represented those present in hot-humid environments, with a mean dry bulb temperature of 32C, relative humidity of 70%, solar radiation of 250 W/m<sup>2</sup> and wind speed of 1.5 m/s. The mean completion time of the full 16 km route march was 255 min.

of the studied profiles) were constituted to form four different index groups. Each remaining 25% of the studied profiles constituted a separate test group, generating four independent test groups. Then, a final model was separately identified using the four different index groups. To assess the predictive performance of the final model, the parameter estimates from each of the four subsets (i.e. index group) were used to predict the individual Tc time series in the

Various evaluation criteria were used to assess the model performance. These were RMSE, Bland-Altman limits of agreement (LoA) [16] and percentage of prediction-data deviation (i.e.

where Tcct,<sup>i</sup> denotes the predicted value of Tc at time t for the ith participant and Tct,i is the

i

where N and T denote the total number of participants in the relevant dataset and the total

LoA, which indicates the limits within which 95% of all prediction errors should fall assuming

In this section, we describe the KF approaches proposed by Buller and his co-authors [13–15], as well as the EKF [11] and the OKF models developed by our group. In the state-space models, Tc is not directly observed but considered as a latent state variable, while the other measurable physiological variables (e.g. HR, ST) are used as observable exogenous variables.

The KF algorithm uses observed exogenous variables to estimate the latent or unobservable variable. The algorithm recursively operates on streams of noisy input variables to produce

X T

!<sup>1</sup>=<sup>2</sup>

t e2 t,i

et,<sup>i</sup> ¼ Tcct,<sup>i</sup> � Tct,<sup>i</sup> (1)

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

http://dx.doi.org/10.5772/intechopen.71205

LoA ¼ bias þ 1:96 � ð Þ SD of et,<sup>i</sup> (3)

<sup>t</sup> et,<sup>i</sup> and SD is the standard deviation of the difference

(2)

123

error) that were within �0.1, 0.3 and 0.5�C [percentage of target attainment (PTA)].

respective test group.

,

The prediction error is computed using:

where bias mean error ð Þ¼ <sup>1</sup>

3. Kalman filter models

3.1. Kalman filter

between the predicted and observed Tc.

measured (based on the thermometer capsule) value of Tc.

number of Tc measurements per participant, respectively.

that the errors are normally distributed, is computed using:

N 1 T P<sup>N</sup> i P<sup>T</sup>

RMSE, a measure of the precision in the predicted Tc, is computed using:

RMSE <sup>¼</sup> <sup>1</sup>

N 1 T X N

### 2.1.2. Study 2 (field study)

A total of 43 male volunteers [age = 24 (18–33 years), bodyweight = 66.4 (49.9–89.3 kg), height = 1.72 (1.58–1.92 m), BMI = 22.4 (17.7–27.6 kg/m2 ), BSA = 1.79 (1.54–2.09 m2 )], outfitted in FBO, performed a military 16 km foot march together as a group in the field. The foot march was conducted in the morning with cloudy skies (mean dry bulb temperature, relative humidity and wind speed during the trials were 27C, 86% and 1.1 m/s, respectively). The foot march was composed of three rounds of 4 km followed by one round each of 3 km and 1 km marches on paved terrain, with each exercise bout separated by 15 min seated rest. All participants had ad libitum access to fluid from their water containers, which were refilled during each recess period. The total duration of the trials was approximately 285 min.

#### 2.1.3. Physiological measures

For all heat profiling studies, Tc, HR and ST were recorded every 15 s using a chest belt physiological monitoring system (Equivital EQ02 LifeMonitor®, Hidalgo Ltd., Cambridge, UK) with an associated ingestible thermometer capsule (Philips Respironics, Murrysville, PA). Participants ingested one thermometer capsule at least 8 h prior to the foot march in order to ensure that the capsule had travelled far enough in the intestinal tract to avoid errors from ingested fluids. Each participant's real-time data were checked for accurate reporting of Tc, HR and ST prior to the trials. Tc data were not used if there were evident signs of fluid signatures (rapid decrease in Tc to below 32C and slow recovery to normal body temperature).

For data modelling in the present study, Tc, HR and ST measured using the physiological monitoring system were reduced to 1 min intervals by taking the median of four 15 s samples for each 1 min epoch.

#### 2.2. Assessment of model performance

Predictive performance of each model against data from study 1 and study 2 was assessed separately using in-sample and out-of-sample analyses. Conducting an in-sample analysis entailed using the model to estimate all observed Tc that formed the database for model training. Out-of-sample analysis: estimating observed Tc time series that was not part of the database for model training: was implemented using a four-fold cross-validation.

For cross-validation, the full dataset from study 1 and study 2 was randomly divided into four groups, each containing 25% of the participants (Tc measurements belonging to the same participant were kept in the same group). Four different subsets of three groups (i.e. 3 25% of the studied profiles) were constituted to form four different index groups. Each remaining 25% of the studied profiles constituted a separate test group, generating four independent test groups. Then, a final model was separately identified using the four different index groups. To assess the predictive performance of the final model, the parameter estimates from each of the four subsets (i.e. index group) were used to predict the individual Tc time series in the respective test group.

Various evaluation criteria were used to assess the model performance. These were RMSE, Bland-Altman limits of agreement (LoA) [16] and percentage of prediction-data deviation (i.e. error) that were within �0.1, 0.3 and 0.5�C [percentage of target attainment (PTA)].

The prediction error is computed using:

accessories, Kevlar helmet, rifle replica and a backpack filled with additional accessories, for the foot march. All back packs used in the study were packed in the same configuration. The foot march was composed of three rounds of 4 km followed by one round each of 3 km and 1 km marches on the treadmill at 5.3 km/h and 0% gradient, with each exercise bout separated by 15 min seated rest. Water was provided ad libitum to all participants. Environmental conditions in the climatic chamber represented those present in hot-humid environments, with a mean dry bulb temperature of 32C, relative humidity of 70%, solar radiation of 250 W/m<sup>2</sup> and wind speed of 1.5 m/s. The mean completion time of the full 16 km route march was 255 min.

A total of 43 male volunteers [age = 24 (18–33 years), bodyweight = 66.4 (49.9–89.3 kg),

in FBO, performed a military 16 km foot march together as a group in the field. The foot march was conducted in the morning with cloudy skies (mean dry bulb temperature, relative humidity and wind speed during the trials were 27C, 86% and 1.1 m/s, respectively). The foot march was composed of three rounds of 4 km followed by one round each of 3 km and 1 km marches on paved terrain, with each exercise bout separated by 15 min seated rest. All participants had ad libitum access to fluid from their water containers, which were refilled during each recess

For all heat profiling studies, Tc, HR and ST were recorded every 15 s using a chest belt physiological monitoring system (Equivital EQ02 LifeMonitor®, Hidalgo Ltd., Cambridge, UK) with an associated ingestible thermometer capsule (Philips Respironics, Murrysville, PA). Participants ingested one thermometer capsule at least 8 h prior to the foot march in order to ensure that the capsule had travelled far enough in the intestinal tract to avoid errors from ingested fluids. Each participant's real-time data were checked for accurate reporting of Tc, HR and ST prior to the trials. Tc data were not used if there were evident signs of fluid signatures

For data modelling in the present study, Tc, HR and ST measured using the physiological monitoring system were reduced to 1 min intervals by taking the median of four 15 s samples

Predictive performance of each model against data from study 1 and study 2 was assessed separately using in-sample and out-of-sample analyses. Conducting an in-sample analysis entailed using the model to estimate all observed Tc that formed the database for model training. Out-of-sample analysis: estimating observed Tc time series that was not part of the

For cross-validation, the full dataset from study 1 and study 2 was randomly divided into four groups, each containing 25% of the participants (Tc measurements belonging to the same participant were kept in the same group). Four different subsets of three groups (i.e. 3 25%

(rapid decrease in Tc to below 32C and slow recovery to normal body temperature).

database for model training: was implemented using a four-fold cross-validation.

), BSA = 1.79 (1.54–2.09 m2

)], outfitted

2.1.2. Study 2 (field study)

122 Kalman Filters - Theory for Advanced Applications

2.1.3. Physiological measures

for each 1 min epoch.

2.2. Assessment of model performance

height = 1.72 (1.58–1.92 m), BMI = 22.4 (17.7–27.6 kg/m2

period. The total duration of the trials was approximately 285 min.

$$\mathbf{e}\_{\mathbf{t},\mathbf{i}} = \widehat{\mathbf{T}} \mathbf{c}\_{\mathbf{t},\mathbf{i}} - \mathbf{T} \mathbf{c}\_{\mathbf{t},\mathbf{i}} \tag{1}$$

, where Tcct,<sup>i</sup> denotes the predicted value of Tc at time t for the ith participant and Tct,i is the measured (based on the thermometer capsule) value of Tc.

RMSE, a measure of the precision in the predicted Tc, is computed using:

$$\text{RMSE} = \left(\frac{1}{NT} \frac{1}{T} \sum\_{i}^{N} \sum\_{t}^{T} \mathbf{e}\_{t,i}^{2}\right)^{1/2} \tag{2}$$

where N and T denote the total number of participants in the relevant dataset and the total number of Tc measurements per participant, respectively.

LoA, which indicates the limits within which 95% of all prediction errors should fall assuming that the errors are normally distributed, is computed using:

$$\text{LoA} = \text{bias} + 1.96 \times (\text{SD of } \mathbf{e}\_{\text{t}, \text{i}}) \tag{3}$$

where bias mean error ð Þ¼ <sup>1</sup> N 1 T P<sup>N</sup> i P<sup>T</sup> <sup>t</sup> et,<sup>i</sup> and SD is the standard deviation of the difference between the predicted and observed Tc.

### 3. Kalman filter models

In this section, we describe the KF approaches proposed by Buller and his co-authors [13–15], as well as the EKF [11] and the OKF models developed by our group. In the state-space models, Tc is not directly observed but considered as a latent state variable, while the other measurable physiological variables (e.g. HR, ST) are used as observable exogenous variables.

#### 3.1. Kalman filter

The KF algorithm uses observed exogenous variables to estimate the latent or unobservable variable. The algorithm recursively operates on streams of noisy input variables to produce statistically optimal estimate of the state variable in a hypothesised state system. Without loss of generality, the system can be represented by a state-space model:

$$\text{Observation}: \mathbf{X}\_{\mathbf{t}} = \mathbf{h}(\mathbf{Y}\_{\mathbf{t}}) + \mathbf{v}\_{\mathbf{t}\prime}\mathbf{v}\_{\mathbf{t}} \sim \mathbf{N}(\mathbf{0}, \mathbf{R}), \tag{4}$$

$$\text{Time update}: \text{Y}\_t = \phi\_0 + \phi\_1 \text{Y}\_{t-1} + \theta\_1 \text{X}\_{t-1} + \theta\_2 \text{U}\_{t-1} + \epsilon\_b, \epsilon\_t \sim \text{N}(0, \sigma^2), \tag{5}$$

$$\text{Transition}: \text{Y}\_{\text{t}} = \mathbf{g}(\text{Y}\_{\text{t}-1}, \mathbf{U}\_{\text{t}-1}) + \boldsymbol{\omega}\_{\text{b}} \,\boldsymbol{\omega}\_{\text{t}} \sim \text{N}(\mathbf{0}, \mathbf{Q})\_{\text{t}} \tag{6}$$

where the functions h(�) and g(�) are differentiable for each state. The transition function is derived from the observation function and the time update equations. The innovations vt, e<sup>t</sup> and ω<sup>t</sup> are assumed to follow a Gaussian distribution with mean zero and constant variance. The partial derivatives of the Jacobian matrix can be derived as:

$$\mathbf{G}\_{\mathbf{t}} = \frac{\partial \mathbf{g}}{\partial \mathbf{Y}}\Big|\_{\widehat{\mathbf{Y}}\_{\mathbf{t}-1}, \mathbf{u}\_{\mathbf{t}-1}}\tag{7}$$

3.2. Extended Kalman filter

3.3. Online Kalman filter

predict Tc:

4. Results

range of Tc were 38.2 and [32.0, 40.1] <sup>o</sup>

ments were greater than or equal to 39.0�C.

OKF:

EKF:

Our group extended the aforementioned work by proposing an EKF model in which both HR and ST are considered in the time update function and the nonlinear dependence is used in the time update function [11]. Moreover, work-rest regime-switching models were proposed to describe the different Tc dependency on HR and ST during the march (work) and the recess (rest) states. By permitting different formulations for the march and the rest time periods, we were able to harness the a priori knowledge of the work-rest cycles in the developmental data

March work ð Þ : Tct <sup>¼</sup> <sup>φ</sup><sup>0</sup> <sup>þ</sup> <sup>φ</sup>1Tct�<sup>1</sup> <sup>þ</sup> <sup>φ</sup>2HRt�<sup>1</sup> <sup>þ</sup> <sup>φ</sup>3STt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0; <sup>σ</sup><sup>2</sup>

Recess rest ð Þ : Tct <sup>¼</sup> <sup>ϕ</sup><sup>0</sup> <sup>þ</sup> <sup>ϕ</sup>1Tct�<sup>1</sup> <sup>þ</sup> <sup>ϕ</sup>2HRt�<sup>1</sup> <sup>þ</sup> <sup>ϕ</sup>3STt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0; <sup>σ</sup><sup>2</sup>

The classical KF-type models depend on the previous forecasts of Tc, which may introduce significant uncertainty in the estimates when the forecast horizon increases and the prediction errors accumulate. To avoid concatenating forecast errors, we propose using a direct predictive model that relies on the dependence of Tc on its initial value and the latest information of the observed exogenous variables. We name this direct predictive model the online KF (OKF) model. Similar to the EFK model, the OKF model incorporated a regime-switching framework to better account for the varying dependence of Tc on the observed exogenous variables during work and rest periods. At each stage, the latest values of Tc, HR and ST are used to

March work ð Þ : Tct <sup>¼</sup> <sup>φ</sup>0t <sup>þ</sup> <sup>φ</sup>1tTc0 <sup>þ</sup> <sup>φ</sup>2tHRt�<sup>1</sup> <sup>þ</sup> <sup>φ</sup>3tSTt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>1t, <sup>e</sup>1t � N 0; <sup>σ</sup><sup>2</sup>

Recess rest ð Þ : Tct <sup>¼</sup> <sup>ϕ</sup>0t <sup>þ</sup> <sup>ϕ</sup>1tTc0 <sup>þ</sup> <sup>ϕ</sup>2tHRt�<sup>1</sup> <sup>þ</sup> <sup>ϕ</sup>3tSTt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>2t, <sup>e</sup>2t � N 0; <sup>σ</sup><sup>2</sup>

The EKF and the OKF models were seeded with the actual starting Tc as measured by the ingestible thermometer capsule, with the assumption that initial Tc during real-life events

A total of 17,646 Tc-HR-ST data points were available for model development. The mean and

could be either estimated or measured prior to the start of a physical activity.

<sup>t</sup> <sup>þ</sup> <sup>α</sup>4Tc3

<sup>t</sup> <sup>þ</sup> <sup>β</sup>4Tc<sup>3</sup>

<sup>t</sup> þ vt, var vð Þ¼ <sup>t</sup> R1

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

http://dx.doi.org/10.5772/intechopen.71205

<sup>t</sup> þ vt, var vð Þ¼ <sup>t</sup> R2

C, respectively. Approximately 5% of all Tc measure-

1 

2 

1t (19)

2t (20)

(17)

125

(18)

to enhance Tc estimates. Our EFK model is formulated as follows:

HRt <sup>¼</sup> <sup>α</sup><sup>1</sup> <sup>þ</sup> <sup>α</sup>2Tct <sup>þ</sup> <sup>α</sup>3Tc<sup>2</sup>

HRt <sup>¼</sup> <sup>β</sup><sup>1</sup> <sup>þ</sup> <sup>β</sup>2Tct <sup>þ</sup> <sup>β</sup>3Tc2

$$\mathbf{H}\_{\mathbf{t}} = \frac{\partial \mathbf{h}}{\partial \mathbf{Y}}\Big|\_{\widehat{\mathbf{Y}}\_{\mathbf{t}}^{\*}}.\tag{8}$$

The KF algorithm consists of two steps: predict and update. At any forecast origin t, we have. Predict:

$$\hat{\mathbf{y}}\_{\mathbf{t}}^{\*} = \mathbf{g}(\hat{\mathbf{y}}\_{\mathbf{t}-1}, \mathbf{u}\_{\mathbf{t}-1}) \tag{9}$$

$$\mathbf{P}\_{\mathbf{t}}^{\*} = \mathbf{G}\_{\mathbf{t}} \mathbf{P}\_{\mathbf{t}-1} \mathbf{G}\_{\mathbf{t}}^{\mathrm{T}} + \mathbf{Q} \tag{10}$$

Update:

$$
\widehat{\mathbf{y}}\_{t} = \widehat{\mathbf{y}}\_{t}^{\*} + \mathbf{K}\_{t} \{ \mathbf{x}\_{t} - \mathbf{h} \left( \widehat{\mathbf{y}}\_{t}^{\*} \right) \}\tag{11}
$$

$$\mathbf{P\_{t}} = (\mathbf{1} - \mathbf{K\_{t}}\mathbf{H\_{t}})\mathbf{P\_{t}^{\*}}\tag{12}$$

where the Kalman Gain Kt <sup>¼</sup> <sup>P</sup><sup>∗</sup> <sup>t</sup> HT <sup>t</sup> HtP<sup>∗</sup> <sup>t</sup> HT <sup>t</sup> <sup>þ</sup> <sup>R</sup> � ��<sup>1</sup> .

Buller et al. [13] proposed a KF model to predict Tc by tracking the observed exogenous HR time series. The KF model is represented as:

$$\mathbf{T}\mathbf{c}\_{t} = \boldsymbol{\varphi}\_{0} + \boldsymbol{\varphi}\_{1}\mathbf{T}\mathbf{c}\_{t-1} + \boldsymbol{\epsilon}\_{b}\,\boldsymbol{\epsilon}\_{t} \sim \mathbf{N}\{0, \sigma\_{1}^{2}\}\tag{13}$$

$$\mathbf{HR}\_t = \alpha\_1 + \alpha\_2 \mathbf{T} \mathbf{c}\_t + \mathbf{v}\_t \text{ var}(\mathbf{v}\_t) = \mathbf{R}. \tag{14}$$

To incorporate the nonlinear dependence between Tc and HR, Buller et al. [14, 15] further proposed a quadratic state space model, which was found to provide better fit in real data analysis:

$$\mathbf{T}\mathbf{c}\_{t} = \boldsymbol{\varphi}\_{0} + \boldsymbol{\varphi}\_{1}\mathbf{T}\mathbf{c}\_{t-1} + \mathbf{e}\_{t\prime}\mathbf{e}\_{t} \sim \mathbf{N}\{0, \sigma\_{1}^{2}\}\tag{15}$$

$$\mathbf{R} \cdot \mathbf{H} \mathbf{R}\_t = \alpha\_1 + \alpha\_2 \mathbf{T} \mathbf{c}\_t + \alpha\_3 \mathbf{T} \mathbf{c}\_t^2 + \mathbf{v}\_t \cdot \mathbf{var}(\mathbf{v}\_t) = \mathbf{R}. \tag{16}$$

#### 3.2. Extended Kalman filter

Our group extended the aforementioned work by proposing an EKF model in which both HR and ST are considered in the time update function and the nonlinear dependence is used in the time update function [11]. Moreover, work-rest regime-switching models were proposed to describe the different Tc dependency on HR and ST during the march (work) and the recess (rest) states. By permitting different formulations for the march and the rest time periods, we were able to harness the a priori knowledge of the work-rest cycles in the developmental data to enhance Tc estimates. Our EFK model is formulated as follows:

EKF:

(7)

statistically optimal estimate of the state variable in a hypothesised state system. Without loss

where the functions h(�) and g(�) are differentiable for each state. The transition function is derived from the observation function and the time update equations. The innovations vt, e<sup>t</sup> and ω<sup>t</sup> are assumed to follow a Gaussian distribution with mean zero and constant variance.

> Gt <sup>¼</sup> <sup>∂</sup><sup>g</sup> ∂Y � � � � byt�<sup>1</sup>,ut�<sup>1</sup>

> > Ht <sup>¼</sup> <sup>∂</sup><sup>h</sup> ∂Y � � � � by∗ t

The KF algorithm consists of two steps: predict and update. At any forecast origin t, we have.

<sup>t</sup> <sup>¼</sup> <sup>g</sup> <sup>b</sup>yt�<sup>1</sup>; ut�<sup>1</sup>

<sup>t</sup> <sup>þ</sup> Kt xt � <sup>h</sup> <sup>y</sup>b<sup>∗</sup>

.

Pt <sup>¼</sup> ð Þ <sup>1</sup> � KtHt <sup>P</sup><sup>∗</sup>

Buller et al. [13] proposed a KF model to predict Tc by tracking the observed exogenous HR

Tct <sup>¼</sup> <sup>φ</sup><sup>0</sup> <sup>þ</sup> <sup>φ</sup>1Tct�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0; <sup>σ</sup><sup>2</sup>

To incorporate the nonlinear dependence between Tc and HR, Buller et al. [14, 15] further proposed a quadratic state space model, which was found to provide better fit in real data analysis:

Tct <sup>¼</sup> <sup>φ</sup><sup>0</sup> <sup>þ</sup> <sup>φ</sup>1Tct�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0; <sup>σ</sup><sup>2</sup>

HRt <sup>¼</sup> <sup>α</sup><sup>1</sup> <sup>þ</sup> <sup>α</sup>2Tct <sup>þ</sup> <sup>α</sup>3Tc<sup>2</sup>

t

<sup>t</sup> <sup>¼</sup> GtPt�1GT

yb∗

P∗

<sup>b</sup>yt <sup>¼</sup> <sup>y</sup>b<sup>∗</sup>

<sup>t</sup> HT <sup>t</sup> HtP<sup>∗</sup> <sup>t</sup> HT <sup>t</sup> <sup>þ</sup> <sup>R</sup> � ��<sup>1</sup>

Observation : Xt ¼ h Yð Þþ<sup>t</sup> vt, vt � N 0ð Þ ;R , (4)

Transition : Yt ¼ g Yð Þþ <sup>t</sup>�<sup>1</sup>; Ut�<sup>1</sup> ωt, ω<sup>t</sup> � N 0ð Þ ; Q , (6)

: (8)

� � (9)

<sup>t</sup> þ Q (10)

<sup>t</sup> (12)

� � (13)

� � (15)

<sup>t</sup> þ vt, var vð Þ¼ <sup>t</sup> R: (16)

� � � � (11)

1

1

HRt ¼ α<sup>1</sup> þ α2Tct þ vt, var vð Þ¼ <sup>t</sup> R: (14)

Time update : Yt <sup>¼</sup> <sup>ϕ</sup><sup>0</sup> <sup>þ</sup> <sup>ϕ</sup>1Yt�<sup>1</sup> <sup>þ</sup> <sup>θ</sup>1Xt�<sup>1</sup> <sup>þ</sup> <sup>θ</sup>2Ut�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0; <sup>σ</sup><sup>2</sup> � �, (5)

of generality, the system can be represented by a state-space model:

124 Kalman Filters - Theory for Advanced Applications

The partial derivatives of the Jacobian matrix can be derived as:

Predict:

Update:

where the Kalman Gain Kt <sup>¼</sup> <sup>P</sup><sup>∗</sup>

time series. The KF model is represented as:

$$\begin{aligned} \text{March} \left( \text{work} \right) : \text{Tc}\_{t} &= q\_{0} + q\_{1} \text{Tc}\_{t-1} + q\_{2} \text{HR}\_{t-1} + q\_{3} \text{ST}\_{t-1} + \epsilon\_{t}, \epsilon\_{t} \sim \text{N} \left( 0, \sigma\_{1}^{2} \right) \\ \text{HR}\_{t} &= \alpha\_{1} + \alpha\_{2} \text{Tc}\_{t} + \alpha\_{3} \text{Tc}\_{t}^{2} + \alpha\_{4} \text{Tc}\_{t}^{3} + \text{v}\_{t}, \text{var}(\mathbf{v}\_{t}) = \mathbf{R}\_{1} \end{aligned} \tag{17}$$

$$\begin{aligned} \text{Resses (rest)}: \text{Tc}\_{t} &= \phi\_{0} + \phi\_{1}\text{Tc}\_{t-1} + \phi\_{2}\text{HR}\_{t-1} + \phi\_{3}\text{ST}\_{t-1} + \mathbf{e}\_{\nu}\text{e}\_{t} \sim \text{N} \{0, \sigma\_{2}^{2}\} \\ \text{HR}\_{t} &= \beta\_{1} + \beta\_{2}\text{Tc}\_{t} + \beta\_{3}\text{Tc}\_{t}^{2} + \beta\_{4}\text{Tc}\_{t}^{3} + \mathbf{v}\_{t}\text{var}(\mathbf{v}\_{t}) = \mathbf{R}\_{2} \end{aligned} \tag{18}$$

#### 3.3. Online Kalman filter

The classical KF-type models depend on the previous forecasts of Tc, which may introduce significant uncertainty in the estimates when the forecast horizon increases and the prediction errors accumulate. To avoid concatenating forecast errors, we propose using a direct predictive model that relies on the dependence of Tc on its initial value and the latest information of the observed exogenous variables. We name this direct predictive model the online KF (OKF) model. Similar to the EFK model, the OKF model incorporated a regime-switching framework to better account for the varying dependence of Tc on the observed exogenous variables during work and rest periods. At each stage, the latest values of Tc, HR and ST are used to predict Tc:

OKF:

$$\text{March} \left( \text{work} \right) : \text{T} \mathbf{c}\_{\text{t}} = \mathbf{q}\_{0\text{t}} + \mathbf{q}\_{1\text{t}} \text{T} \mathbf{c}\_{\text{0}} + \mathbf{q}\_{2\text{t}} \text{HR}\_{\text{t}-1} + \mathbf{q}\_{3\text{t}} \text{ST}\_{\text{t}-1} + \mathbf{e}\_{\text{It}} \text{ } \mathbf{e}\_{\text{1t}} \sim \text{N} \left( \mathbf{0}, \sigma\_{\text{1t}}^{2} \right) \tag{19}$$

$$\text{Recess}\left(\text{rest}\right):\quad \text{Tc}\_{\text{t}} = \phi\_{0\text{t}} + \phi\_{1\text{t}}\text{Tc}\_{0} + \phi\_{2\text{t}}\text{HR}\_{\text{t}-1} + \phi\_{3\text{t}}\text{ST}\_{\text{t}-1} + \epsilon\_{2\text{t}}, \epsilon\_{2\text{t}} \sim \text{N}\left(0, \sigma\_{2\text{t}}^{2}\right) \tag{20}$$

The EKF and the OKF models were seeded with the actual starting Tc as measured by the ingestible thermometer capsule, with the assumption that initial Tc during real-life events could be either estimated or measured prior to the start of a physical activity.

#### 4. Results

A total of 17,646 Tc-HR-ST data points were available for model development. The mean and range of Tc were 38.2 and [32.0, 40.1] <sup>o</sup> C, respectively. Approximately 5% of all Tc measurements were greater than or equal to 39.0�C.

#### 4.1. Final model

For the sake of illustration, parameter estimates for the final EKF and OKF models trained using data from Study 1 (Laboratory Study) are reproduced in this paper. The EKF model is described in the equations below.

$$\begin{aligned} \text{March (work)}: \text{Tc}\_{\text{t}} &= 0.36630 + 0.98368 \text{Tc}\_{\text{t}-1} + 0.00038 \text{HR}\_{t-1} \\ &+ 0.00586 \text{ST}\_{t-1} + \text{e}\_{t}, \text{e}\_{t} \sim \text{N}(0, 0.00051) \end{aligned} \tag{21}$$

$$\begin{aligned} \text{HR}\_{t} &= 6793.30385 - 673.08458 \text{Tc}\_{t} + 21.01836 \text{Tc}\_{t}^{2} - 0.20822 \text{Tc}\_{t}^{3} + \text{v}\_{t} \text{ var}(\text{v}\_{t}) = 280.3643 \text{t} \\ \text{Recess (rest)}: \text{Tc}\_{\text{t}} &= 0.32403 + 0.98296 \text{Tc}\_{\text{t}-1} + 0.00060 \text{HR}\_{t-1} \\ &+ 0.00604 \text{ST}\_{t-1} + \text{e}\_{t}, \text{e}\_{t} \sim \text{N}(0, 0.00126) \end{aligned}$$

$$\text{HR}\_{t} = 380042.09964 - 29325.80131 \text{Tc}\_{t} + 753.958237 \text{Tc}\_{t}^{2} - 6.45618 \text{Tc}\_{t}^{3} + \text{v}\_{t} \text{ var}(\text{v}\_{t}) = 292.55107. \tag{22}$$

The transition functions are:

$$\begin{aligned} \text{March (work)}: \text{Tc}\_{\text{t}} &= 2.96438 + 0.72626 \text{Tc}\_{\text{t}-1} + 0.00804 \text{Tc}\_{\text{t}-1}^2 - 0.00008 \text{Tc}\_{\text{t}-1}^3 \\ &+ 0.00586 \text{ST}\_{\text{t}-1} + \epsilon\_{\text{t}} \text{ } \epsilon\_{\text{t}} \sim \text{N}(0, 0.00055), \end{aligned} \tag{23}$$

$$\begin{aligned} \text{Reces (rest)}: \text{Tc}\_{\text{t}} &= 228.97647 - 16.66092 \text{Tc}\_{\text{t}-1} + 0.45362 \text{Tc}\_{\text{t}-1}^2 \\ &- 0.00388 \text{Tc}\_{\text{t}-1}^3 + 0.00604 \text{ST}\_{\text{t}-1} + \epsilon\_{\text{t}}, \epsilon\_{\text{t}} \sim \text{N}(0, 0.00136). \end{aligned} \tag{24}$$

The equations for the final OKF model are provided below, with different values for the four model parameters [φ0t,φ1t,φ2t,φ3t] at different time points. The corresponding author may be contacted for values of these parameters.

$$\text{March} \left( \text{work} \right) : \text{Tc}\_{\text{t}} = \text{q}\_{\text{0t}} + \text{q}\_{\text{1t}} \text{Tc}\_{\text{0}} + \text{q}\_{\text{2t}} \text{HR}\_{\text{t}-1} + \text{q}\_{\text{3t}} \text{ST}\_{\text{t}-1} + \text{e}\_{\text{1b}} \text{e}\_{\text{1t}} \sim \text{N} \left( \text{0}, \sigma\_{\text{1t}}^{2} \right) \tag{25}$$

$$\text{Recess (rest)}: \text{Tc}\_{\text{ft}} = \phi\_{\text{ft}} + \phi\_{\text{1t}}\text{Tc}\_{\text{0}} + \phi\_{\text{2t}}\text{HR}\_{\text{t}-1} + \phi\_{\text{3t}}\text{ST}\_{\text{t}-1} + \epsilon\_{\text{2t}}, \epsilon\_{\text{2t}} \sim \text{N}(\text{0}, \sigma\_{\text{2t}}^2). \tag{26}$$

identity. Combined across study 1 and study 2, the OKF model reduced the RMSE by 0.18C. In addition, for both study 1 and study 2, the proportions of prediction errors within 0.1, 0.3 and 0.5C under the OKF model were also higher compared to those under the EKF model. In particular, the PTA 0.3C under the OKF model was 75%, which was about 25% higher compared to the PTA 0.3C under the EKF model. Collectively, the results indicated that the overall performance of the OKF model was superior to that of the EKF model based on the

Figure 1. Diagnostic plots for assessment of the EKF (A) and OKF (B) models trained using study 1 data. For each model, the left side subplot shows the scatter plot of observed Tc versus predicted Tc together with the line of identity (black line) and the loess smooth plot (gray dashed line); the middle subplot shows the Bland-Altman plot showing bias (solid line)

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

http://dx.doi.org/10.5772/intechopen.71205

127

Model RMSE (C) LoA (C) PTA 0.1C (%) PTA 0.3C (%) PTA 0.5C (%)

and 1.96 SD (dashed line); and the right side subplot shows the histogram of prediction error.

EKF 0.37 0.02 0.72 24 60 82 OKF 0.25 0.00 0.49 40 78 95

Table 1. RMSE, LoA and PTA for the final EKF and OKF models trained using study 1 data.

developmental data.

#### 4.2. In-sample analysis

Figure 1 and Table 1 summarise the performance of the final EKF model and the final OKF model on the study 1 data. Figure 2 and Table 2 summarise the performance of the final EKF model and the final OKF model on the study 2 data.

For both study 1 and study 2, the agreement between the observed and predicted Tc across the range of Tc was greater in the OKF model compared to the EKF model. For instance, under study 1, the LoA attained with the OKF model was [�0.49, 0.49]�C while that derived from the EKF model was [�0.70, 0.74]�C. For Study 2, the scatter plot of the observed versus predicted Tc departed from the line of identity markedly (observed Tc = 0.42 � predicted Tc + 22.15; units = � C) under the EKF model. By contrast, the scatter plot of the observed Tc versus the OKF model-predicted Tc for the same set of data was randomly distributed along the line of

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain http://dx.doi.org/10.5772/intechopen.71205 127

4.1. Final model

described in the equations below.

126 Kalman Filters - Theory for Advanced Applications

The transition functions are:

4.2. In-sample analysis

units = �

contacted for values of these parameters.

model and the final OKF model on the study 2 data.

HRt <sup>¼</sup> <sup>6793</sup>:<sup>30385</sup> � <sup>673</sup>:08458Tct <sup>þ</sup> <sup>21</sup>:01836Tc<sup>2</sup>

HRt <sup>¼</sup> <sup>380042</sup>:<sup>09964</sup> � <sup>29325</sup>:80131Tct <sup>þ</sup> <sup>753</sup>:95823Tc<sup>2</sup>

For the sake of illustration, parameter estimates for the final EKF and OKF models trained using data from Study 1 (Laboratory Study) are reproduced in this paper. The EKF model is

March work ð Þ : Tct ¼ 0:36630 þ 0:98368Tct�<sup>1</sup> þ 0:00038HRt�<sup>1</sup>

Recess rest ð Þ : Tct ¼ 0:32403 þ 0:98296Tct�<sup>1</sup> þ 0:00060HRt�<sup>1</sup>

The equations for the final OKF model are provided below, with different values for the four model parameters [φ0t,φ1t,φ2t,φ3t] at different time points. The corresponding author may be

March work ð Þ : Tct <sup>¼</sup> <sup>φ</sup>0t <sup>þ</sup> <sup>φ</sup>1tTc0 <sup>þ</sup> <sup>φ</sup>2tHRt�<sup>1</sup> <sup>þ</sup> <sup>φ</sup>3tSTt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>1t, <sup>e</sup>1t � N 0; <sup>σ</sup><sup>2</sup>

Recess rest ð Þ : Tct <sup>¼</sup> <sup>ϕ</sup>0t <sup>þ</sup> <sup>ϕ</sup>1tTc0 <sup>þ</sup> <sup>ϕ</sup>2tHRt�<sup>1</sup> <sup>þ</sup> <sup>ϕ</sup>3tSTt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>2t, <sup>e</sup>2t � N 0; <sup>σ</sup><sup>2</sup>

Figure 1 and Table 1 summarise the performance of the final EKF model and the final OKF model on the study 1 data. Figure 2 and Table 2 summarise the performance of the final EKF

For both study 1 and study 2, the agreement between the observed and predicted Tc across the range of Tc was greater in the OKF model compared to the EKF model. For instance, under study 1, the LoA attained with the OKF model was [�0.49, 0.49]�C while that derived from the EKF model was [�0.70, 0.74]�C. For Study 2, the scatter plot of the observed versus predicted Tc departed from the line of identity markedly (observed Tc = 0.42 � predicted Tc + 22.15;

OKF model-predicted Tc for the same set of data was randomly distributed along the line of

C) under the EKF model. By contrast, the scatter plot of the observed Tc versus the

March work ð Þ : Tct <sup>¼</sup> <sup>2</sup>:<sup>96438</sup> <sup>þ</sup> <sup>0</sup>:72626Tct�<sup>1</sup> <sup>þ</sup> <sup>0</sup>:00804Tc2

Recess rest ð Þ : Tct <sup>¼</sup> <sup>228</sup>:<sup>97647</sup> � <sup>16</sup>:66092Tct�<sup>1</sup> <sup>þ</sup> <sup>0</sup>:45362Tc<sup>2</sup>

� <sup>0</sup>:00388Tc3

þ 0:00586STt�<sup>1</sup> þ et, e<sup>t</sup> � N 0ð Þ ; 0:00051

<sup>t</sup> � <sup>0</sup>:20822Tc<sup>3</sup>

þ 0:00604STt�<sup>1</sup> þ et, e<sup>t</sup> � N 0ð Þ ; 0:00126

<sup>t</sup> � <sup>6</sup>:45618Tc<sup>3</sup>

<sup>þ</sup> <sup>0</sup>:00586STt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0ð Þ ; <sup>0</sup>:<sup>00055</sup> , (23)

<sup>t</sup> þ vt, var vð Þ¼ <sup>t</sup> 280:36443

<sup>t</sup>�<sup>1</sup> � <sup>0</sup>:00008Tc3

t�1

<sup>t</sup>�<sup>1</sup> <sup>þ</sup> <sup>0</sup>:00604STt�<sup>1</sup> <sup>þ</sup> <sup>e</sup>t, <sup>e</sup><sup>t</sup> � N 0ð Þ ; <sup>0</sup>:<sup>00136</sup> : (24)

<sup>t</sup> þ vt, var vð Þ¼ <sup>t</sup> 292:55107:

t�1

1t (25)

2t : (26)

(21)

(22)

Figure 1. Diagnostic plots for assessment of the EKF (A) and OKF (B) models trained using study 1 data. For each model, the left side subplot shows the scatter plot of observed Tc versus predicted Tc together with the line of identity (black line) and the loess smooth plot (gray dashed line); the middle subplot shows the Bland-Altman plot showing bias (solid line) and 1.96 SD (dashed line); and the right side subplot shows the histogram of prediction error.


Table 1. RMSE, LoA and PTA for the final EKF and OKF models trained using study 1 data.

identity. Combined across study 1 and study 2, the OKF model reduced the RMSE by 0.18C. In addition, for both study 1 and study 2, the proportions of prediction errors within 0.1, 0.3 and 0.5C under the OKF model were also higher compared to those under the EKF model. In particular, the PTA 0.3C under the OKF model was 75%, which was about 25% higher compared to the PTA 0.3C under the EKF model. Collectively, the results indicated that the overall performance of the OKF model was superior to that of the EKF model based on the developmental data.

Figure 2. Diagnostic plots for assessment of the EKF (A) and OKF (B) models trained using study 2 data. For each model, the left side subplot shows the scatter plot of observed Tc versus predicted Tc together with the line of identity (black line) and the loess smooth plot (gray dashed line); the middle subplot shows the Bland–Altman plot showing bias (solid line) and 1.96 SD (dashed line); and the right side subplot shows the histogram of prediction error.


Table 2. RMSE, LoA and PTA for the final EKF and OKF models trained using study 2 data.

#### 4.3. Out-of-sample analysis

Tables 3–6 report the RMSE, LoA and PTA 0.1, 0.3 and 0.5C obtained in each of the four index sets under study 1 and study 2 based on the EKF and OKF approaches. Similar to the insample analysis, the comparison between the observed and predicted Tc showed a smaller RMSE and a greater agreement under the OKF model compared to the EKF model.

When averaged across all the index sets and both study 1 and study 2, the RMSE fell by 0.03C and the PTA increased by 13% under the OKF model vis-a-vis the EKF model. In addition, the overall agreement between the observed and predicted Tc was closer under the OKF model. These trends were also evident at the index set level. Using index set 1 of study 1 dataset as an example, the RMSE under the EKF model was 0.41C, which was larger compared to the OKF model's RMSE (0.23C). As a further indication of the superior performance of the OKF model,

Index Set RMSE (C) LoA (C) PTA 0.1 C (%) PTA 0.3 C (%) PTA 0.5 C (%)

Index Set RMSE (C) LoA (C) PTA 0.1C (%) PTA 0.3C (%) PTA 0.5C (%)

Index Set RMSE (C) LoA (C) PTA 0.1C (%) PTA 0.3C (%) PTA 0.5C (%)

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

http://dx.doi.org/10.5772/intechopen.71205

129

Index Set RMSE (C) LoA (C) PTA 0.1C (%) PTA 0.3C (%) PTA 0.5C (%)

 0.23 0.06 0.43 40 80 98 0.45 0.08 0.87 23 57 75 0.31 0.08 0.58 32 69 89 0.34 0.05 0.65 29 74 91 Overall 0.33 0.00 0.63 31 70 88 Table 4. RMSE, LoA and PTA for the four different Study 1 index sets derived using the OKF model.

 0.41 0.19 0.71 33 62 72 0.42 0.04 0.82 18 57 78 0.30 0.06 0.58 34 69 87 0.37 0.13 0.68 20 53 87 Overall 0.38 0.04 0.70 27 60 81 Table 3. RMSE, LoA and PTA for the four different study 1 index sets derived using the EKF model.

 0.47 0.02 0.92 21 55 76 0.47 0.25 0.78 17 48 70 0.43 0.08 0.83 23 57 80 0.58 0.07 1.12 12 36 59 Overall 0.49 0.06 0.91 18 49 71 Table 5. RMSE, LoA and PTA for the four different study 2 index sets derived using the EKF model.

 0.53 0.00 1.04 27 70 87 0.45 0.18 0.81 26 61 83 0.39 0.06 0.75 31 68 87 0.56 0.06 1.09 24 65 84 Overall 0.48 0.01 0.92 27 66 85 Table 6. RMSE, LoA and PTA for the four different study 2 index sets derived using the OKF model.


Table 3. RMSE, LoA and PTA for the four different study 1 index sets derived using the EKF model.




Table 5. RMSE, LoA and PTA for the four different study 2 index sets derived using the EKF model.


Table 6. RMSE, LoA and PTA for the four different study 2 index sets derived using the OKF model.

4.3. Out-of-sample analysis

128 Kalman Filters - Theory for Advanced Applications

Tables 3–6 report the RMSE, LoA and PTA 0.1, 0.3 and 0.5C obtained in each of the four index sets under study 1 and study 2 based on the EKF and OKF approaches. Similar to the insample analysis, the comparison between the observed and predicted Tc showed a smaller

Figure 2. Diagnostic plots for assessment of the EKF (A) and OKF (B) models trained using study 2 data. For each model, the left side subplot shows the scatter plot of observed Tc versus predicted Tc together with the line of identity (black line) and the loess smooth plot (gray dashed line); the middle subplot shows the Bland–Altman plot showing bias (solid line)

Model RMSE (C) LoA (C) PTA 0.1C (%) PTA 0.3C (%) PTA 0.5C (%)

and 1.96 SD (dashed line); and the right side subplot shows the histogram of prediction error.

Table 2. RMSE, LoA and PTA for the final EKF and OKF models trained using study 2 data.

EKF 0.51 0.07 0.99 18 49 70 OKF 0.27 0.00 0.54 33 75 92

When averaged across all the index sets and both study 1 and study 2, the RMSE fell by 0.03C and the PTA increased by 13% under the OKF model vis-a-vis the EKF model. In addition, the overall agreement between the observed and predicted Tc was closer under the OKF model.

RMSE and a greater agreement under the OKF model compared to the EKF model.

These trends were also evident at the index set level. Using index set 1 of study 1 dataset as an example, the RMSE under the EKF model was 0.41C, which was larger compared to the OKF model's RMSE (0.23C). As a further indication of the superior performance of the OKF model, the LoA under the OKF model was narrower compared to that under the EKF model [(0.49, 0.37) C versus (0.52, 0.9) C].

EKF model was also observed to expand in magnitude with increasing time for both the

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

http://dx.doi.org/10.5772/intechopen.71205

131

In this study, the EKF and OKF models were validated against Tc measurements obtained from volunteers who participated in a high intensity foot march typically performed in the military. When pooled across study 1 and study 2, approximately 5% of all Tc measurements were equal to or greater than 39C. This represented a respectable data volume for model assessment at the high thermal work zone. Using only measures of HR and ST, our results showed that the models estimated Tc with a small overall bias of 0.03C, which was within the individual physiological variation of 0.25C [17]. In addition, the overall RMSE of the EKF and OKF models (0.31 and 0.45C) were also comparable to those found in other comparisons of different measures of human core temperature (rectal probe versus oesophageal probe, rectal probe

versus thermometer capsule and oesophageal probe versus thermometer capsule) [18].

The aforementioned observations notwithstanding, our results clearly indicated differences in the accuracy of the EKF and OKF approaches in Tc time series prediction during the studied high intensity foot march in both laboratory and outfield conditions. Classical Kalman filter strategies fundamentally rely on known model and noise information. Consequently, as depicted by results from the EKF approach, they cannot compensate for the effect of modelprocess mismatch and concatenating noise uncertainty. Our results showed that the OKF approach can estimate Tc continuously across time with less error than EKF model. Moreover, prediction bias arising from the OKF model appeared to be more stable in magnitude over time compared to that of the EKF model. This is significant in the practical settings because a progressively larger prediction error under a longer forecast horizon may lead to more false positives or false negatives for high thermal work strain. If the EKF model is deployed for tracking individualised heat strain, healthy workers with no imminent heat injury risk may be withdrawn from the physical activity prematurely (reducing work efficiency and processes) or actual heat casualties may not be identified, with the second scenario (false negatives) a more problematic one compared to the first (false positives). This makes the OKF method a more promising approach than the EKF method for predicting Tc based on real-time wearable

Technologies that reliably assess Tc in a non-invasive manner are expected to play a crucial role in supporting the development of tools, methods and techniques to enhance productivity, safety and well-being of military, first responders and industrial workers. During military training and operations, real-time monitoring of Tc can allow each soldier's thermophysiological state to be assessed, which permits commanders to take effective measures to intervene and mitigate heat injuries. Monitoring of Tc of every firefighter in the fireground can provide objective information to either empower the trooper to stay in longer to finish a job or

laboratory and field datasets.

sensor data in a continuous manner.

5. Discussion

Figure 3 shows a comparison between the mean observed and EKF/OKF-predicted Tc time series for study 1 and study 2. The results showed that the mean Tc versus time profile generated by the OKF model largely matched that of the observed mean Tc time series. By contrast, mean Tc predictions produced from the EKF model were observed to deviate from the observed mean Tc and lie outside of the 95% confidence interval of the Tc measurements at various time periods during the foot march.

Figure 4 compares the mean error time series from the EKF and OKF models in study 1 and study 2. While the mean errors (prediction bias) were observed to be generally stable and contained to under approximately 0.1C across all time instances for the OKF model, those of the EKF model were comparatively larger in magnitude. In addition, the mean error from the

Figure 3. Comparison between the mean observed and predicted Tc time series for study 1 and study 2. For each study, the mean observed, EFK model-predicted and OKF model-predicted Tc time series are plotted in continuous dashed and dotted lines, respectively. The 95% confidence interval for the observed Tc time series is shown as a grey area.

Figure 4. Comparison between the mean error time series generated from the EKF model and the OKF model for study 1 and study 2. For each study, the mean error time series produced by the EFK model and the OKF model are plotted in dashed and dotted lines, respectively.

EKF model was also observed to expand in magnitude with increasing time for both the laboratory and field datasets.

### 5. Discussion

the LoA under the OKF model was narrower compared to that under the EKF model [(0.49,

Figure 3 shows a comparison between the mean observed and EKF/OKF-predicted Tc time series for study 1 and study 2. The results showed that the mean Tc versus time profile generated by the OKF model largely matched that of the observed mean Tc time series. By contrast, mean Tc predictions produced from the EKF model were observed to deviate from the observed mean Tc and lie outside of the 95% confidence interval of the Tc measurements at

Figure 4 compares the mean error time series from the EKF and OKF models in study 1 and study 2. While the mean errors (prediction bias) were observed to be generally stable and contained to under approximately 0.1C across all time instances for the OKF model, those of the EKF model were comparatively larger in magnitude. In addition, the mean error from the

Figure 3. Comparison between the mean observed and predicted Tc time series for study 1 and study 2. For each study, the mean observed, EFK model-predicted and OKF model-predicted Tc time series are plotted in continuous dashed and

Figure 4. Comparison between the mean error time series generated from the EKF model and the OKF model for study 1 and study 2. For each study, the mean error time series produced by the EFK model and the OKF model are plotted in

dotted lines, respectively. The 95% confidence interval for the observed Tc time series is shown as a grey area.

0.37)

C versus (0.52, 0.9)

130 Kalman Filters - Theory for Advanced Applications

dashed and dotted lines, respectively.

various time periods during the foot march.

C].

In this study, the EKF and OKF models were validated against Tc measurements obtained from volunteers who participated in a high intensity foot march typically performed in the military. When pooled across study 1 and study 2, approximately 5% of all Tc measurements were equal to or greater than 39C. This represented a respectable data volume for model assessment at the high thermal work zone. Using only measures of HR and ST, our results showed that the models estimated Tc with a small overall bias of 0.03C, which was within the individual physiological variation of 0.25C [17]. In addition, the overall RMSE of the EKF and OKF models (0.31 and 0.45C) were also comparable to those found in other comparisons of different measures of human core temperature (rectal probe versus oesophageal probe, rectal probe versus thermometer capsule and oesophageal probe versus thermometer capsule) [18].

The aforementioned observations notwithstanding, our results clearly indicated differences in the accuracy of the EKF and OKF approaches in Tc time series prediction during the studied high intensity foot march in both laboratory and outfield conditions. Classical Kalman filter strategies fundamentally rely on known model and noise information. Consequently, as depicted by results from the EKF approach, they cannot compensate for the effect of modelprocess mismatch and concatenating noise uncertainty. Our results showed that the OKF approach can estimate Tc continuously across time with less error than EKF model. Moreover, prediction bias arising from the OKF model appeared to be more stable in magnitude over time compared to that of the EKF model. This is significant in the practical settings because a progressively larger prediction error under a longer forecast horizon may lead to more false positives or false negatives for high thermal work strain. If the EKF model is deployed for tracking individualised heat strain, healthy workers with no imminent heat injury risk may be withdrawn from the physical activity prematurely (reducing work efficiency and processes) or actual heat casualties may not be identified, with the second scenario (false negatives) a more problematic one compared to the first (false positives). This makes the OKF method a more promising approach than the EKF method for predicting Tc based on real-time wearable sensor data in a continuous manner.

Technologies that reliably assess Tc in a non-invasive manner are expected to play a crucial role in supporting the development of tools, methods and techniques to enhance productivity, safety and well-being of military, first responders and industrial workers. During military training and operations, real-time monitoring of Tc can allow each soldier's thermophysiological state to be assessed, which permits commanders to take effective measures to intervene and mitigate heat injuries. Monitoring of Tc of every firefighter in the fireground can provide objective information to either empower the trooper to stay in longer to finish a job or warn the trooper to exit the fireground sooner. In addition, the use of physiological monitoring, coupled with work physiology and ergonomics concepts, can foster the creation of innovative workforce management procedures allowing enhancements not only in productivity, but also in civilian workers' well-being and safety.

Author details

, Ying Chen<sup>1</sup>

Singapore, Republic of Singapore

Singapore, Republic of Singapore

Singapore, Republic of Singapore

Medicine. 2001;72(1):32-37

Republic of Singapore

References

17-20

, Weiping Priscilla Fan<sup>2</sup>

Fire Protection Association. Quincy, MA; 2016. p. 33

Journal of Applied Physiology. 1994;77(1):216-222

2016;2(6). DOI: 10.15436/2378-6841.16.1123

, Yu Li Lydia Law2

\*Address all correspondence to: skokyong@dso.org.sg

, Si Hui Maureen Lee<sup>2</sup>

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

, Kai Wei Jason Lee2,3 and Kok-Yong Seng2,4\*

1 Department of Statistics and Applied Probability, Faculty of Science, National University of

2 Defence Medical and Environmental Research Institute, DSO National Laboratories,

3 Department of Physiology, Yong Loo Lin School of Medicine, National University of

4 Department of Pharmacology, Yong Loo Lin School of Medicine, National University of

[1] Update: Heat injuries, active component, U.S. Armed Forces, 2012. MSMR. 2013;20(3):

[2] Fahy RF, PR LB, Molis JL, editors. Firefighter Fatalities in the United States-2015. National

[3] Cadarette BS, Levine L, Staab JE, Kolka MA, Correa M, Whipple M, Sawka MN. Heat strain imposed by toxic agent protective systems. Aviation, Space, and Environmental

[4] Montain SJ, Sawka MN, Cadarette BS, Quigley MD, McKay JM. Physiological tolerance to uncompensable heat stress: effects of exercise intensity, protective clothing, and climate.

[5] Gunga HC, Werner A, Stahn A, Steinach M, Schlabs T, Koralewski E, Kunz D, Belavý DL, Felsenberg D, Sattler F, Koch J. The double sensor–A non-invasive device to continuously monitor core temperature in humans on earth and in space. Respiratory Physiology and

[6] Coughlin SS, Stewart J. Use of consumer wearable devices to promote physical activity: A review of health intervention studies. Journal of Environment and Health Sciences.

Neurobiology. 2009;169(Suppl 1):S63-S68. DOI: 10.1016/j.resp.2009.04.005

[7] Fick AV. On liquid diffusion. Philosophical Magazine Series 4. 1855;10(63):30-39

, Junxian Ong<sup>2</sup>

http://dx.doi.org/10.5772/intechopen.71205

,

133

Jia Guo<sup>1</sup>

Poh Ling Tan<sup>2</sup>

The main limitation of the present study is the usage of only Tc measurements from the military foot march for modelling. Such developmental data may limit the model's ability to reliably calculate Tc of human subjects in non-military tasks, e.g. first responders operating in uncompensable heat stress environments, civilian construction workers and professional sports athletes geared with light clothing. In the future, the strong influence of ST on Tc in our mathematical model will be verified in human subjects operating in clothing systems that either severely limit heat dissipation or facilitate sweat evaporation under less humid conditions. The current study did not assess the reliability of the model on repeated Tc measures derived on different trial occasions. Future work will include testing our Kalman filter model's reliability and precision on different test occasions based on repeated measures data from the same subjects. Last, while we showed that the OKF approach can estimate Tc with less error than the EKF model, appreciable variability in the Tc still remains unexplained by HR and ST. Future work will include the evaluation of breathing rate to improve Tc estimations since hyperthermia has been shown to increase ventilation [19].

### 6. Conclusions

In this paper, we have reported two different Kalman filter approaches for predicting real-time Tc trajectories of subjects engaged in a high intensity physical activity. In particular, we introduced the OKF model where the time update equation depends only on the initial value of Tc and time-current values of the exogenous variables. Both models leverage time-varying values of ST and HR to predict subject-specific Tc. Overall, Tc predictions from the OKF model matched the observed Tc better compared to those from the EFK models. Future work includes testing and qualification of our model against additional heat strain datasets including those derived from non-foot march tasks, and investigation of the influence of further exogenous observations, such as body acceleration, on Tc. While this approach may not be a complete replacement for direct Tc measurement, it offers a simple and promising new method to estimate subject-specific Tc in a non-invasive manner, and is accurate and practical enough for real-time monitoring of thermal work strain.

### Acknowledgements

This study was funded by the Ministry of Defence in Singapore. We thank all volunteers who participated in this study. The authors are also grateful to Adam Chai and Leonard Chan for suggestions on model development.

## Author details

warn the trooper to exit the fireground sooner. In addition, the use of physiological monitoring, coupled with work physiology and ergonomics concepts, can foster the creation of innovative workforce management procedures allowing enhancements not only in productivity,

The main limitation of the present study is the usage of only Tc measurements from the military foot march for modelling. Such developmental data may limit the model's ability to reliably calculate Tc of human subjects in non-military tasks, e.g. first responders operating in uncompensable heat stress environments, civilian construction workers and professional sports athletes geared with light clothing. In the future, the strong influence of ST on Tc in our mathematical model will be verified in human subjects operating in clothing systems that either severely limit heat dissipation or facilitate sweat evaporation under less humid conditions. The current study did not assess the reliability of the model on repeated Tc measures derived on different trial occasions. Future work will include testing our Kalman filter model's reliability and precision on different test occasions based on repeated measures data from the same subjects. Last, while we showed that the OKF approach can estimate Tc with less error than the EKF model, appreciable variability in the Tc still remains unexplained by HR and ST. Future work will include the evaluation of breathing rate to improve Tc estimations since

In this paper, we have reported two different Kalman filter approaches for predicting real-time Tc trajectories of subjects engaged in a high intensity physical activity. In particular, we introduced the OKF model where the time update equation depends only on the initial value of Tc and time-current values of the exogenous variables. Both models leverage time-varying values of ST and HR to predict subject-specific Tc. Overall, Tc predictions from the OKF model matched the observed Tc better compared to those from the EFK models. Future work includes testing and qualification of our model against additional heat strain datasets including those derived from non-foot march tasks, and investigation of the influence of further exogenous observations, such as body acceleration, on Tc. While this approach may not be a complete replacement for direct Tc measurement, it offers a simple and promising new method to estimate subject-specific Tc in a non-invasive manner, and is accurate and practical enough

This study was funded by the Ministry of Defence in Singapore. We thank all volunteers who participated in this study. The authors are also grateful to Adam Chai and Leonard Chan for

but also in civilian workers' well-being and safety.

132 Kalman Filters - Theory for Advanced Applications

hyperthermia has been shown to increase ventilation [19].

for real-time monitoring of thermal work strain.

Acknowledgements

suggestions on model development.

6. Conclusions

Jia Guo<sup>1</sup> , Ying Chen<sup>1</sup> , Weiping Priscilla Fan<sup>2</sup> , Si Hui Maureen Lee<sup>2</sup> , Junxian Ong<sup>2</sup> , Poh Ling Tan<sup>2</sup> , Yu Li Lydia Law2 , Kai Wei Jason Lee2,3 and Kok-Yong Seng2,4\*

\*Address all correspondence to: skokyong@dso.org.sg

1 Department of Statistics and Applied Probability, Faculty of Science, National University of Singapore, Republic of Singapore

2 Defence Medical and Environmental Research Institute, DSO National Laboratories, Republic of Singapore

3 Department of Physiology, Yong Loo Lin School of Medicine, National University of Singapore, Republic of Singapore

4 Department of Pharmacology, Yong Loo Lin School of Medicine, National University of Singapore, Republic of Singapore

### References


[8] Richmond VL, Davey S, Griggs K, Havenith G. Prediction of core body temperature from multiple variables. The Annals of Occupational Hygiene. 2015;59(9):1168-1178. DOI: 10.1093/annhyg/mev054

**Chapter 7**

Provisional chapter

**Application of Kalman Filtering in Dynamic Prediction**

DOI: 10.5772/intechopen.71616

Application of Kalman Filtering in Dynamic Prediction

This chapter aims to dynamically improve the method of predicting financial distress based on Kalman filtering. Financial distress prediction (FDP) is an important study area of corporate finance. The widely used discriminant models currently for financial distress prediction have deficiencies in dynamics. Based on the state-space method, we establish two models that are used to describe the dynamic process and discriminant rules of financial distress, respectively, that is, a process model and a discriminant model. These two models collectively are called dynamic prediction models for financial distress. The operation of the dynamic prediction is achieved by Kalman filtering algorithm, and further, a general n-step-ahead prediction algorithm based on Kalman filtering is derived for prospective prediction. We also conduct an empirical study for China's manufacturing industry, and the results have proved the accuracy and advance of

Keywords: financial distress prediction, pattern recognition, state space model,

Research on financial distress prediction (FDP) is an important area of corporate finance. Early prediction methods are univariate analysis (UA), multiple discriminant analysis (MDA), logistic model, probit model, and so on [1–5]. With the development of computer technology, some new methods based on artificial intelligence technology with distributed computing capabilities that can deal with problems of nonlinear systems are widely introduced into the field of financial distress prediction. These methods include neural network (NN), genetic algorithm (GA), rough set theory (RST), case-based reasoning (CBR) and support vector machine (SVM), and so on [6–14]. Each model established for financial distress prediction, whether based on statistical methods or artificial intelligence methods, has advantages and disadvantages under

> © The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

**for Corporate Financial Distress**

for Corporate Financial Distress

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

predicting financial distress in such case.

stochastic process, optimal estimation

http://dx.doi.org/10.5772/intechopen.71616

Qian Zhuang

Qian Zhuang

Abstract

1. Introduction


### **Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress** Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

DOI: 10.5772/intechopen.71616

### Qian Zhuang Qian Zhuang

[8] Richmond VL, Davey S, Griggs K, Havenith G. Prediction of core body temperature from multiple variables. The Annals of Occupational Hygiene. 2015;59(9):1168-1178. DOI:

[9] Yamakage M, Namiki A. Deep temperature monitoring using a zero-heat-flow method.

[10] Yokota M, Moran DS, Berglund LG, Stephenson LA, Kolka MA. Noninvasive warning indicator of the 'Red Zone' of potential thermal injury and performance impairment: A pilot study. In: International Conference of Environmental Ergonomics; Lund Univer-

[11] Seng KY, Chen Y, Chai AKM, Wang T, Fun DCY, Teo YS, Tan PMS, Ang WH, Lee JKW. Tracking body core temperature in military thermal environments: An extended Kalman filter approach. In: 2016 IEEE 13th International Conference on Wearable and Implantable Body Sensor Networks (BSN). San Francisco: IEEE; 2016. p. 296-299. DOI: 10.1109/

[12] Kalman RE. A new approach to linear filtering and prediction problems. ASME Journal

[13] Buller MJ, Tharion WJ, Hoyt RW, Jenkins OC. Estimation of human internal temperature from wearable physiological sensors. In: Proceedings of the 22nd Conference on Innovative Applications of Artificial Intelligence (IAAI); Atlanta, GA. July 11–15: IAAI;2010:

[14] Buller MJ, Tharion WJ, Cheuvront SN, Montain SJ, Kenefick RW, Castellani J, Latzka WA, Roberts WS, Richter M, Jenkins OC, Hoyt RW. Estimation of human core temperature from sequential heart rate observations. Physiological Measurement. 2013;34(7):781-798.

[15] Buller MJ, Tharion WJ, Duhamel CM, Yokota M. Real-time core body temperature estimation from heart rate for first responders wearing different levels of personal protective equipment. Ergonomics. 2015;58(11):1830-1841. DOI: 10.1080/00140139.2015.1036792 [16] Bland JM, Altman DG. Statistical methods for assessing agreement between two methods

[17] Consolazio CF, Johnson RE, Pecora LJ. Physiological variability in young men. In: Consolazio CF, Johnson RE, Pecora LJ, editors. Physiological Measurements of Metabolic

[18] O'Brien C, Hoyt RW, Buller MJ, Castellani JW, Young AJ. Telemetry pill measurement of core temperature in humans during active heating and cooling. Medicine and Science in

[19] Fujii N, Honda Y, Ogawa T, Tsuji B, Kondo N, Koga S, Nishiyasu T. Short-term exerciseheat acclimation enhances skin vasodilation but not hyperthermic hyperpnea in humans exercising in a hot environment. European Journal of Applied Physiology. 2012;112(1):

Sports and Exercise. 1998;30(3):468-472. DOI: 10.1097/00005768-199803000-00020

10.1093/annhyg/mev054

134 Kalman Filters - Theory for Advanced Applications

sity, Sweden. 2005. p. 514-517

BSN.2016.7516277

1763-1768

Journal of Anesthesia. 2003;17(2):108-115

of Basic Engineering. 1960;82(Series D):35-45

of clinical measurements. Lancet. 1986;1(8476):307-310

Functions. New York: McGraw Hill; 1963. p. 453-480

295-307. DOI: 10.1007/s00421-011-1980-6

DOI: 10.1088/0967-3334/34/7/781

Additional information is available at the end of the chapter Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.71616

#### Abstract

This chapter aims to dynamically improve the method of predicting financial distress based on Kalman filtering. Financial distress prediction (FDP) is an important study area of corporate finance. The widely used discriminant models currently for financial distress prediction have deficiencies in dynamics. Based on the state-space method, we establish two models that are used to describe the dynamic process and discriminant rules of financial distress, respectively, that is, a process model and a discriminant model. These two models collectively are called dynamic prediction models for financial distress. The operation of the dynamic prediction is achieved by Kalman filtering algorithm, and further, a general n-step-ahead prediction algorithm based on Kalman filtering is derived for prospective prediction. We also conduct an empirical study for China's manufacturing industry, and the results have proved the accuracy and advance of predicting financial distress in such case.

Keywords: financial distress prediction, pattern recognition, state space model, stochastic process, optimal estimation

### 1. Introduction

Research on financial distress prediction (FDP) is an important area of corporate finance. Early prediction methods are univariate analysis (UA), multiple discriminant analysis (MDA), logistic model, probit model, and so on [1–5]. With the development of computer technology, some new methods based on artificial intelligence technology with distributed computing capabilities that can deal with problems of nonlinear systems are widely introduced into the field of financial distress prediction. These methods include neural network (NN), genetic algorithm (GA), rough set theory (RST), case-based reasoning (CBR) and support vector machine (SVM), and so on [6–14]. Each model established for financial distress prediction, whether based on statistical methods or artificial intelligence methods, has advantages and disadvantages under

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

different conditions. Let us take the most widely used multiple discriminant analysis (MDA) and back-propagation neural network (BPNN) for example. MDA has the advantage of simplicity and good interpretation, but the deficiency in its application is limited by strict assumptions that sometimes cannot be satisfied. Besides, MDA is a static discriminant model [2, 3, 6, 15, 20]. For the application of BPNN, it does not need any probability distribution assumption. BPNN is considered as an effective tool of pattern recognition for nonlinear systems. Therefore, many researchers have tried to apply triple BPNN in financial distress prediction, using the nonlinear pattern recognition capability of BPNN for classification of different financial state [7, 8, 15].

Section 2. Then, a whole process of dynamic prediction for corporate financial distress is elaborated in Section 3. Section 4 presents empirical analysis for China's manufacturing indus-

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

http://dx.doi.org/10.5772/intechopen.71616

137

Based on the state-space method, we establish two models, being used to describe the dynamic process and discriminant rules of financial distress, respectively, that is, a process model and a discriminant model. These two models collectively are called dynamic prediction models for financial distress. We see the evolution of financial distress for a company as a stochastic process and establish a process model, which is used to describe the dynamic process of development of the financial state. We define the financial state as a set of vectors, which summarizes all the information necessary about the past behavior of the company except for the external effects of the inputs, so that it can uniquely describe the behavior of the company in the near future [24]. The financial state of a company often cannot be observed directly, but only some signal indicators associated with the financial state can be observed. Therefore, we establish a discriminant model, which is used to describe the correlation between the financial state and the signal indicators. The discriminant model can be a recursive form of any statistical model or artificial intelligence model, theoretically. At first, we take the linear models, which are simple and intuitive as an example and establish dynamic prediction models for

where Xt is the financial state of a company in period t; Zt is the signal indicators of the company in period t; Wt-1 is the process noise of the financial state in period t�1; Vt is the observation noise of the signal indicators in period t; At|<sup>t</sup> � <sup>1</sup> is used to describe the dynamic process of the financial state transferring from period t�1 to t; Ht is used to describe the mathematical relations between the financial state and the signal indicators in period t. Eq. (1)

Assume that the process noise and the observation noise are Gaussian white noises, which are

where, Qt is a p � p-dimensional symmetric nonnegative definite covariance matrix of process noise Wt; Rt is a m � m-dimensional symmetric positive definite covariance matrix of observa-

j h i <sup>¼</sup> Qtδtj

j h i <sup>¼</sup> Rtδtj

E Wt ½ �¼ <sup>0</sup>, EWtW<sup>T</sup>

E Vt ½ �¼ <sup>0</sup>, EVtV<sup>T</sup>

E WtV<sup>T</sup> j h i <sup>¼</sup> <sup>0</sup>

Xt ¼ At t<sup>j</sup> �<sup>1</sup>Xt�<sup>1</sup> þ Wt�<sup>1</sup> (1)

Zt ¼ HtXt þ Vt (2)

(3)

2. Dynamic prediction models based on Kalman filtering algorithm

try. Section 5 draws conclusions and discusses future research.

is a process model; and Eq. (2) is a discriminant model.

mutually independent and normally distributed, i.e.

tion noise Vt; δtj is Kronecker - δ function.

8 >>>>><

>>>>>:

financial distress, as

The prediction often achieved through a cross-sectional analysis at different time points. That is, the sample data of period t1, t2, … before financial distress are studied by BPNN, respectively, and the features are extracted, based on what the judgment for the financial state of next new period is made [16, 17, 20]. This treatment is a relatively complete cross-sectional analysis. But the conclusions on discrimination among different time points are lack of logistic links. Therefore, this prediction is not completely dynamic. Furthermore, BPNN is a static neural network even when directly used in time-series prediction (Neural networks can be divided into static or dynamic neural networks based on whether they contain feedback loops or delay. BPNN is a backpropagation network without feedback and belongs to static neural networks.). There are some inherent problems such as overfitting, for example, the fitting error of training data has reduced, but the prediction error has increased at the same time. Even if the data are normalized, the effect is not satisfactory when the testing data are not sufficient [13, 18–20].

Actually, corporate financial distress is a gradual and cumulative process, which is developed from a healthy state. The mutation is often the result at which the gradual change and cumulation have reached the critical condition. It is neither reasonable nor logical if only the cross-sectional data at the time point prior to the occurrence of financial distress are used to make a determination for the corporate future state. It should take into account two aspects at least when conducting the research on financial distress prediction: firstly, the alternative data for prediction should contain all the historical information; secondly, the prediction method is dynamic designed for financial distress characterized by cumulative variation [21–23]. However, the current discriminant models have some deficiencies in dynamic prediction. Also, there is a problem of massive data processing. This chapter attempts to make a dynamic improvement on prediction methods for financial distress based on Kalman filtering algorithm in order to solve the above problems.

The main contribution of the paper is that it constructs a state-space model of corporate financial distress from the perspective of the cumulative effect of historical information on current state and improves Kalman filtering algorithm for dynamic prediction. A whole process of dynamic prediction for corporate financial distress is developed from a long period of time, and time-series data of high-frequency are collected for optimal estimation of financial state, which is seen as a stochastic process. The advantage of the model is proved by an empirical research, and the result shows that it can give relatively accurate warning before the occurrence of financial distress.

The rest of this chapter is organized as follows. Dynamic prediction models consisting of a process model and a discriminant model based on Kalman filtering algorithm are described in Section 2. Then, a whole process of dynamic prediction for corporate financial distress is elaborated in Section 3. Section 4 presents empirical analysis for China's manufacturing industry. Section 5 draws conclusions and discusses future research.

### 2. Dynamic prediction models based on Kalman filtering algorithm

different conditions. Let us take the most widely used multiple discriminant analysis (MDA) and back-propagation neural network (BPNN) for example. MDA has the advantage of simplicity and good interpretation, but the deficiency in its application is limited by strict assumptions that sometimes cannot be satisfied. Besides, MDA is a static discriminant model [2, 3, 6, 15, 20]. For the application of BPNN, it does not need any probability distribution assumption. BPNN is considered as an effective tool of pattern recognition for nonlinear systems. Therefore, many researchers have tried to apply triple BPNN in financial distress prediction, using the nonlinear pattern recognition capability of BPNN for classification of different financial

The prediction often achieved through a cross-sectional analysis at different time points. That is, the sample data of period t1, t2, … before financial distress are studied by BPNN, respectively, and the features are extracted, based on what the judgment for the financial state of next new period is made [16, 17, 20]. This treatment is a relatively complete cross-sectional analysis. But the conclusions on discrimination among different time points are lack of logistic links. Therefore, this prediction is not completely dynamic. Furthermore, BPNN is a static neural network even when directly used in time-series prediction (Neural networks can be divided into static or dynamic neural networks based on whether they contain feedback loops or delay. BPNN is a backpropagation network without feedback and belongs to static neural networks.). There are some inherent problems such as overfitting, for example, the fitting error of training data has reduced, but the prediction error has increased at the same time. Even if the data are normalized, the effect is not satisfactory when the testing data are not sufficient [13, 18–20].

Actually, corporate financial distress is a gradual and cumulative process, which is developed from a healthy state. The mutation is often the result at which the gradual change and cumulation have reached the critical condition. It is neither reasonable nor logical if only the cross-sectional data at the time point prior to the occurrence of financial distress are used to make a determination for the corporate future state. It should take into account two aspects at least when conducting the research on financial distress prediction: firstly, the alternative data for prediction should contain all the historical information; secondly, the prediction method is dynamic designed for financial distress characterized by cumulative variation [21–23]. However, the current discriminant models have some deficiencies in dynamic prediction. Also, there is a problem of massive data processing. This chapter attempts to make a dynamic improvement on prediction methods for financial distress based on Kalman filtering algorithm

The main contribution of the paper is that it constructs a state-space model of corporate financial distress from the perspective of the cumulative effect of historical information on current state and improves Kalman filtering algorithm for dynamic prediction. A whole process of dynamic prediction for corporate financial distress is developed from a long period of time, and time-series data of high-frequency are collected for optimal estimation of financial state, which is seen as a stochastic process. The advantage of the model is proved by an empirical research, and the result shows that it can give relatively accurate warning before

The rest of this chapter is organized as follows. Dynamic prediction models consisting of a process model and a discriminant model based on Kalman filtering algorithm are described in

state [7, 8, 15].

136 Kalman Filters - Theory for Advanced Applications

in order to solve the above problems.

the occurrence of financial distress.

Based on the state-space method, we establish two models, being used to describe the dynamic process and discriminant rules of financial distress, respectively, that is, a process model and a discriminant model. These two models collectively are called dynamic prediction models for financial distress. We see the evolution of financial distress for a company as a stochastic process and establish a process model, which is used to describe the dynamic process of development of the financial state. We define the financial state as a set of vectors, which summarizes all the information necessary about the past behavior of the company except for the external effects of the inputs, so that it can uniquely describe the behavior of the company in the near future [24]. The financial state of a company often cannot be observed directly, but only some signal indicators associated with the financial state can be observed. Therefore, we establish a discriminant model, which is used to describe the correlation between the financial state and the signal indicators. The discriminant model can be a recursive form of any statistical model or artificial intelligence model, theoretically. At first, we take the linear models, which are simple and intuitive as an example and establish dynamic prediction models for financial distress, as

$$X\_t = A\_{t|t-1} X\_{t-1} + W\_{t-1} \tag{1}$$

$$\mathbf{Z}\_t = \mathbf{H}\_t \mathbf{X}\_t + \mathbf{V}\_t \tag{2}$$

where Xt is the financial state of a company in period t; Zt is the signal indicators of the company in period t; Wt-1 is the process noise of the financial state in period t�1; Vt is the observation noise of the signal indicators in period t; At|<sup>t</sup> � <sup>1</sup> is used to describe the dynamic process of the financial state transferring from period t�1 to t; Ht is used to describe the mathematical relations between the financial state and the signal indicators in period t. Eq. (1) is a process model; and Eq. (2) is a discriminant model.

Assume that the process noise and the observation noise are Gaussian white noises, which are mutually independent and normally distributed, i.e.

$$\begin{cases} E[W\_t] = 0, & E\left[W\_t W\_j^T\right] = \mathbb{Q}\_t \delta\_{t\dot{\jmath}} \\\\ E[V\_t] = 0, & E\left[V\_t V\_{\dot{\jmath}}^T\right] = R\_t \delta\_{t\dot{\jmath}} \\\\ E\left[W\_t V\_{\dot{\jmath}}^T\right] = 0 \end{cases} \tag{3}$$

where, Qt is a p � p-dimensional symmetric nonnegative definite covariance matrix of process noise Wt; Rt is a m � m-dimensional symmetric positive definite covariance matrix of observation noise Vt; δtj is Kronecker - δ function.

The above equations can be solved by Kalman filtering algorithm. The Kalman filter is named after Rudolph E. Kalman, who in 1960 published his famous paper describing a recursive solution to the discrete-data linear filtering problem. The Kalman filter is essentially a set of mathematical equations that implement a predictor–corrector type estimator that is optimal in the sense that it minimizes the estimated error covariance, when some presumed conditions are met [25, 26]. Kalman filter is widely used for its relative simplicity and robust nature. Rarely do the conditions necessary for optimality actually exist, and yet, the filter apparently works well for many applications in spite of this situation. Application of Kalman filter in dynamic prediction for corporate financial state consists of five steps [27, 28]:

The first step is to compute the one-step prediction of the financial state Xb t t<sup>j</sup> �<sup>1</sup> under the conditions of known Xb <sup>t</sup>�1jt�1, which is the optimal estimation of the financial state at time t�1

$$
\widehat{X}\_{t|t-1} = A\_{t|t-1} \widehat{X}\_{t-1|t-1} \tag{4}
$$

The second step is to compute the error covariance matrix Pt|<sup>t</sup> � <sup>1</sup> for one-step prediction

$$P\_{t|t-1} = A\_{t|t-1} P\_{t-1|t-1} A\_{t|t-1}^T + Q\_{t-1} \tag{5}$$

The third step is to compute the Kalman gain Kt, which is a blending factor that is used to adjust the discrepancy between the predicted observation HtXbt t<sup>j</sup> �<sup>1</sup> and the actual observation Zt, in order to obtain the optimal estimation Xb t t<sup>j</sup> closer to the actual financial state

$$K\_t = P\_{t|t-1} H\_t^T \left[ H\_t P\_{t|t-1} H\_t^T + R\_t \right]^{-1} \tag{6}$$

3. A whole process of dynamic prediction for corporate financial distress

Figure 1. A complete picture of the operation of the Kalman filter in dynamic prediction for corporate financial state.

0 0 ˆ *<sup>X</sup>* <sup>0</sup> <sup>0</sup> *P*

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

,... ˆ , ˆ <sup>11</sup> <sup>2</sup> <sup>2</sup> *X X*

, ,... *Z*<sup>1</sup> *Z*<sup>2</sup>

http://dx.doi.org/10.5772/intechopen.71616

139

] <sup>ˆ</sup> [ <sup>ˆ</sup> <sup>ˆ</sup> <sup>−</sup><sup>1</sup> <sup>−</sup><sup>1</sup> <sup>=</sup> <sup>+</sup> <sup>−</sup> *<sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>X</sup> <sup>X</sup> <sup>K</sup> <sup>Z</sup> <sup>H</sup> <sup>X</sup>*

1

−

<sup>1</sup> <sup>1</sup> [ ]

<sup>−</sup> <sup>−</sup> <sup>=</sup> <sup>+</sup> *<sup>t</sup> <sup>T</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>T</sup> <sup>K</sup> <sup>t</sup> Pt <sup>t</sup> Ht <sup>H</sup> <sup>P</sup> <sup>H</sup> <sup>R</sup>*

<sup>1</sup> [ ] <sup>−</sup> = − *<sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> P I K H P*

As previously described, corporate financial distress is a gradual and cumulative process, which is developed from a healthy state, and so the prediction should be long-term and continuous and the continuously updated time-series data should be collected for the dynamic prediction, which could be the fresh input into the Kalman filter in order to obtain the optimal estimation closer to the actual state. The whole process of dynamic prediction for corporate

From Figure 2, we can see that if we want to predict the corporate financial state at time t + 2, we just need to know the optimal estimation of the corporate financial state at time t and the signal indicators observed at time t + 1. The rest may be deduced by analogy; if we want to predict the corporate financial state at time t + n, we just need to know the optimal estimation of the corporate financial state at time t + n2 and the signal indicators observed at time t + n1. This continuous prediction does not require saving the observed data in the past. Every time the new signal indicators are observed, they are put into the Kalman filter as fresh. It helps solve the problems of storing, calling, and processing the massive data and thus

Further, if we want to predict the corporate financial state n-step ahead, we can obtain the n-stepahead prediction algorithm derived from the basic Kalman filtering algorithm according to the

financial distress is described as follows.

*<sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>t</sup> <sup>X</sup> <sup>A</sup> <sup>X</sup>* <sup>ˆ</sup> <sup>ˆ</sup> <sup>+</sup><sup>1</sup> <sup>+</sup><sup>1</sup> <sup>=</sup> <sup>−</sup><sup>1</sup> = <sup>−</sup><sup>1</sup> <sup>−</sup><sup>1</sup> <sup>−</sup><sup>1</sup> <sup>−</sup><sup>1</sup> + *<sup>t</sup>*−<sup>1</sup> *<sup>T</sup> Pt <sup>t</sup> At <sup>t</sup> Pt <sup>t</sup> At <sup>t</sup> <sup>Q</sup>*

greatly improving the speed of operation on the computer.

dynamic prediction process described above.

The fourth step is to correct the one-step predicted financial state Xb t t<sup>j</sup> �<sup>1</sup> according to the principle of minimum error covariance and thus obtain the optimal estimation Xbt t<sup>j</sup> of the financial state

$$
\widehat{X}\_{t|t} = \widehat{X}\_{t|t-1} + K\_t \left[ Z\_t - H\_t \widehat{X}\_{t|t-1} \right] \tag{7}
$$

The fifth step is to compute the error covariance matrix Pt|<sup>t</sup> of the updated financial state estimation Xbt t<sup>j</sup>

$$P\_{t|t} = [I - K\_t H\_t] P\_{t|t-1} \tag{8}$$

These are the basic equations of Kalman filtering for a stochastic linear discrete financial system. The actual filtering process is an ongoing "predicting-correcting" process of a recursive nature. Figure 1 below offers a complete picture of the operation of the Kalman filter in dynamic prediction for corporate financial state.

The Kalman filter does not require storing large amount of data in solving the problem. Once new data are observed, new filtering value can be calculated at any time. Therefore, this method facilitates real-time processing and is easy to implement on the computer.

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress http://dx.doi.org/10.5772/intechopen.71616 139

The above equations can be solved by Kalman filtering algorithm. The Kalman filter is named after Rudolph E. Kalman, who in 1960 published his famous paper describing a recursive solution to the discrete-data linear filtering problem. The Kalman filter is essentially a set of mathematical equations that implement a predictor–corrector type estimator that is optimal in the sense that it minimizes the estimated error covariance, when some presumed conditions are met [25, 26]. Kalman filter is widely used for its relative simplicity and robust nature. Rarely do the conditions necessary for optimality actually exist, and yet, the filter apparently works well for many applications in spite of this situation. Application of Kalman filter in

The first step is to compute the one-step prediction of the financial state Xb t t<sup>j</sup> �<sup>1</sup> under the conditions of known Xb <sup>t</sup>�1jt�1, which is the optimal estimation of the financial state at time t�1

The second step is to compute the error covariance matrix Pt|<sup>t</sup> � <sup>1</sup> for one-step prediction

The third step is to compute the Kalman gain Kt, which is a blending factor that is used to adjust the discrepancy between the predicted observation HtXbt t<sup>j</sup> �<sup>1</sup> and the actual observation

<sup>t</sup> HtPt t<sup>j</sup> �<sup>1</sup>H<sup>T</sup>

The fourth step is to correct the one-step predicted financial state Xb t t<sup>j</sup> �<sup>1</sup> according to the principle of minimum error covariance and thus obtain the optimal estimation Xbt t<sup>j</sup> of the

Xbt t<sup>j</sup> ¼ Xbt t<sup>j</sup> �<sup>1</sup> þ Kt Zt � HtXbt t<sup>j</sup> �<sup>1</sup>

The fifth step is to compute the error covariance matrix Pt|<sup>t</sup> of the updated financial state

These are the basic equations of Kalman filtering for a stochastic linear discrete financial system. The actual filtering process is an ongoing "predicting-correcting" process of a recursive nature. Figure 1 below offers a complete picture of the operation of the Kalman filter in

The Kalman filter does not require storing large amount of data in solving the problem. Once new data are observed, new filtering value can be calculated at any time. Therefore, this

method facilitates real-time processing and is easy to implement on the computer.

<sup>t</sup> þ Rt

h i

Pt t<sup>j</sup> �<sup>1</sup> <sup>¼</sup> At t<sup>j</sup> �<sup>1</sup>Pt�1jt�<sup>1</sup>A<sup>T</sup>

Zt, in order to obtain the optimal estimation Xb t t<sup>j</sup> closer to the actual financial state

Kt <sup>¼</sup> Pt t<sup>j</sup> �<sup>1</sup>H<sup>T</sup>

financial state

estimation Xbt t<sup>j</sup>

dynamic prediction for corporate financial state.

Xb t t<sup>j</sup> �<sup>1</sup> ¼ At t<sup>j</sup> �<sup>1</sup>Xb<sup>t</sup>�1jt�<sup>1</sup> (4)

t t<sup>j</sup> �<sup>1</sup> <sup>þ</sup> Qt�<sup>1</sup> (5)

(7)

� ��<sup>1</sup> (6)

Pt t<sup>j</sup> ¼ I � KtHt ½ �Pt t<sup>j</sup> �<sup>1</sup> (8)

dynamic prediction for corporate financial state consists of five steps [27, 28]:

138 Kalman Filters - Theory for Advanced Applications

Figure 1. A complete picture of the operation of the Kalman filter in dynamic prediction for corporate financial state.

### 3. A whole process of dynamic prediction for corporate financial distress

As previously described, corporate financial distress is a gradual and cumulative process, which is developed from a healthy state, and so the prediction should be long-term and continuous and the continuously updated time-series data should be collected for the dynamic prediction, which could be the fresh input into the Kalman filter in order to obtain the optimal estimation closer to the actual state. The whole process of dynamic prediction for corporate financial distress is described as follows.

From Figure 2, we can see that if we want to predict the corporate financial state at time t + 2, we just need to know the optimal estimation of the corporate financial state at time t and the signal indicators observed at time t + 1. The rest may be deduced by analogy; if we want to predict the corporate financial state at time t + n, we just need to know the optimal estimation of the corporate financial state at time t + n2 and the signal indicators observed at time t + n1. This continuous prediction does not require saving the observed data in the past. Every time the new signal indicators are observed, they are put into the Kalman filter as fresh. It helps solve the problems of storing, calling, and processing the massive data and thus greatly improving the speed of operation on the computer.

Further, if we want to predict the corporate financial state n-step ahead, we can obtain the n-stepahead prediction algorithm derived from the basic Kalman filtering algorithm according to the dynamic prediction process described above.

Ptþn t<sup>j</sup> <sup>¼</sup> <sup>Y</sup><sup>n</sup>

equations simplify to

<sup>i</sup>¼<sup>1</sup> Atþi t<sup>j</sup> <sup>þ</sup>i�<sup>1</sup>Pt t<sup>j</sup>

<sup>þ</sup> Atþn t<sup>j</sup> <sup>þ</sup>n�<sup>1</sup>Qtþn�<sup>2</sup>A<sup>T</sup>

Ptþn t<sup>j</sup> <sup>¼</sup> <sup>A</sup><sup>n</sup>

financial state should be satisfied.

<sup>l</sup> ¼ � NM

<sup>2</sup> lg 2ð Þ� <sup>π</sup>

accuracy of dynamic prediction.

1 2 X M

t¼1

þX<sup>n</sup>þ<sup>1</sup> j¼2

Y<sup>n</sup> <sup>i</sup>¼<sup>1</sup> AT

Pt t<sup>j</sup> AT � �<sup>n</sup> <sup>þ</sup> <sup>A</sup><sup>n</sup>�<sup>1</sup>

A<sup>n</sup>þ1�<sup>j</sup>

uted with mean of 0 and variance of Ftþ<sup>1</sup> <sup>¼</sup> Htþ<sup>1</sup>Ptþ1jtH<sup>T</sup>

lg Ft j j � <sup>1</sup> 2 X M

<sup>t</sup>þi t<sup>j</sup> <sup>þ</sup>i�<sup>1</sup> <sup>þ</sup> <sup>Y</sup><sup>n</sup>

Assume that the system parameters At and Qt have nothing to do with the time, then the above

<sup>X</sup>b<sup>t</sup>þn t<sup>j</sup> <sup>¼</sup> <sup>A</sup><sup>n</sup>

Q A<sup>T</sup> � �<sup>n</sup>�<sup>1</sup>

Based on the Eqs. (9)–(12), we could use data at shorter time interval to predict n-step ahead, but the prerequisite of sufficiently long-term data to find out the trend of development of the

In the dynamic prediction models for financial distress established in Section 2, we suppose that the financial state X cannot be observed. But in reality, whether the company is trapped in financial distress at time t-1 and before can be known at time t, that is part of X can be observed. We put this part of observed information into a likelihood equation in order to improve the accuracy of

> ð∞ S

where, Sc is the critical value; xt + 1 equals etþ<sup>1</sup> <sup>¼</sup> xtþ<sup>1</sup> � <sup>b</sup>xtþ1j<sup>t</sup>, and the latter is normally distrib-

1 ffiffiffiffiffiffi <sup>2</sup><sup>π</sup> <sup>p</sup> Pt e �1 2 xt�x^<sup>t</sup> Pt � �<sup>2</sup>

t¼1

This additional estimation equation is used every year, no matter if 1 year is divided into n periods. If standing at managers' position and suppose we know the corporate financial state at time t�1, when we stay at time t, and then the additional estimation equation can be embedded in the general n-step-ahead prediction algorithm every time to help improve the

If M is the last year that X can be observed, then the additional estimation equation is

dynamic prediction. The probability of the company being trapped in financial distress is

P Xð Þ¼ <sup>t</sup> > Sc

p xð Þ¼ <sup>t</sup>

t¼1 e T <sup>t</sup> Fet <sup>þ</sup><sup>X</sup> M

<sup>t</sup>þn t<sup>j</sup> <sup>þ</sup>n�<sup>1</sup> <sup>þ</sup> Qtþn�<sup>1</sup>

Q A<sup>T</sup> � �<sup>n</sup>þ1�<sup>j</sup>

<sup>j</sup>¼<sup>2</sup> Atþj t<sup>j</sup> <sup>þ</sup>j�<sup>1</sup>Qt

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

<sup>þ</sup> <sup>⋯</sup> <sup>þ</sup> AQA<sup>T</sup> <sup>þ</sup> <sup>Q</sup> <sup>¼</sup> An

Y<sup>n</sup> <sup>j</sup>¼<sup>1</sup> AT

Xbt t<sup>j</sup> (11)

p xð Þ<sup>t</sup> dxt (13)

lg P Xð Þ <sup>t</sup> > Sc ½ �δð Þþ t lg P Xð Þ <sup>t</sup> < Sc f g ½ �½ � 1 � δð Þt

<sup>t</sup>þ<sup>1</sup> <sup>þ</sup> Rtþ1. Then

Pt t<sup>j</sup> <sup>A</sup><sup>T</sup> � �<sup>n</sup>

<sup>t</sup>þj t<sup>j</sup> <sup>þ</sup>j�<sup>1</sup> þ ⋯

http://dx.doi.org/10.5772/intechopen.71616

(10)

141

(12)

(14)

(15)

Figure 2. A whole process of dynamic prediction for corporate financial distress.

The general n-step-ahead prediction algorithm is derived as

$$
\widehat{X}\_{t+n|t} = A\_{t+n|t+n-1} A\_{t+n-1|t+n-2} \cdots A\_{t+1|t} \\
\widehat{X}\_{t|t} = \prod\_{i=1}^{n} A\_{t+i|t+i-1} \widehat{X}\_{t|t} \tag{9}
$$

The n-step-ahead prediction error variance matrix is

$$\begin{aligned} P\_{t+n|t} &= \prod\_{i=1}^{n} A\_{t+i|t+i-1} P\_{t|t} \prod\_{i=1}^{n} A\_{t+i|t+i-1}^{T} + \prod\_{j=2}^{n} A\_{t+j|t+j-1} Q\_{t} \prod\_{j=1}^{n} A\_{t+j|t+j-1}^{T} + \cdots \\ &+ A\_{t+n|t+n-1} Q\_{t+n-2} A\_{t+n|t+n-1}^{T} + Q\_{t+n-1} \end{aligned} \tag{10}$$

Assume that the system parameters At and Qt have nothing to do with the time, then the above equations simplify to

$$
\widehat{X}\_{t+n|t} = A^n \widehat{X}\_{t|t} \tag{11}
$$

$$\begin{aligned} P\_{t+n|t} &= A^n P\_{t|t} \left( A^T \right)^n + A^{n-1} Q \left( A^T \right)^{n-1} + \dots + A Q A^T + Q = A^n P\_{t|t} \left( A^T \right)^n \\ &+ \sum\_{j=2}^{n+1} A^{n+1-j} Q \left( A^T \right)^{n+1-j} \end{aligned} \tag{12}$$

Based on the Eqs. (9)–(12), we could use data at shorter time interval to predict n-step ahead, but the prerequisite of sufficiently long-term data to find out the trend of development of the financial state should be satisfied.

In the dynamic prediction models for financial distress established in Section 2, we suppose that the financial state X cannot be observed. But in reality, whether the company is trapped in financial distress at time t-1 and before can be known at time t, that is part of X can be observed. We put this part of observed information into a likelihood equation in order to improve the accuracy of dynamic prediction. The probability of the company being trapped in financial distress is

$$P(X\_t > S\_c) = \int\_S^\infty p(\mathbf{x}\_t) d\mathbf{x}\_t \tag{13}$$

where, Sc is the critical value; xt + 1 equals etþ<sup>1</sup> <sup>¼</sup> xtþ<sup>1</sup> � <sup>b</sup>xtþ1j<sup>t</sup>, and the latter is normally distributed with mean of 0 and variance of Ftþ<sup>1</sup> <sup>¼</sup> Htþ<sup>1</sup>Ptþ1jtH<sup>T</sup> <sup>t</sup>þ<sup>1</sup> <sup>þ</sup> Rtþ1. Then

$$p(\mathbf{x}\_t) = \frac{1}{\sqrt{2\pi}P\_t} e^{-\frac{1}{2}\left(\frac{\mathbf{x}\_t - \dot{\mathbf{x}}\_t}{P\_t}\right)^2} \tag{14}$$

If M is the last year that X can be observed, then the additional estimation equation is

The general n-step-ahead prediction algorithm is derived as

Figure 2. A whole process of dynamic prediction for corporate financial distress.

The n-step-ahead prediction error variance matrix is

140 Kalman Filters - Theory for Advanced Applications

<sup>X</sup><sup>b</sup> <sup>t</sup>þn t<sup>j</sup> <sup>¼</sup> Atþn t<sup>j</sup> <sup>þ</sup>n�<sup>1</sup>Atþn�1jtþn�<sup>2</sup>⋯Atþ1jtXbt t<sup>j</sup> <sup>¼</sup> <sup>Y</sup><sup>n</sup>

<sup>i</sup>¼<sup>1</sup> Atþi t<sup>j</sup> <sup>þ</sup>i�<sup>1</sup>X<sup>b</sup> t t<sup>j</sup> (9)

$$I = -\frac{\text{NM}}{2} \text{lg}(2\pi) - \frac{1}{2} \sum\_{t=1}^{M} \text{lg}|F\_{t}| - \frac{1}{2} \sum\_{t=1}^{M} e\_{t}^{T} \text{Fe}\_{t} + \sum\_{t=1}^{M} \left\{ \text{lg}[P(X\_{t} > \mathcal{S}\_{t})] \delta(t) + \text{lg}[P(X\_{t} < \mathcal{S}\_{t})] [1 - \delta(t)] \right\} \tag{15}$$

This additional estimation equation is used every year, no matter if 1 year is divided into n periods. If standing at managers' position and suppose we know the corporate financial state at time t�1, when we stay at time t, and then the additional estimation equation can be embedded in the general n-step-ahead prediction algorithm every time to help improve the accuracy of dynamic prediction.

## 4. Empirical analysis

### 4.1. Data description and experiment design

Manufacturing industry is a major industry in China. "Made in China" has an important impact on the global economy. Therefore, prediction of corporate financial distress for China's manufacturing industry is of great significance. Generally, the manufacturing companies have complete production processes, equilibrious production cycle, as well as a more stable trend of development of the financial state. The characteristics of these companies can be well described using the existing financial indicators, and the dynamic prediction method described above can be put into practice for these manufacturing companies.

In this research, the data for our experiment are collected from the Shanghai Stock Exchange and Shenzhen Stock Exchange databases in China. ST (special treatment) companies because of financial problems are selected as distress samples; meanwhile, companies of similar asset size that have never been special treated are selected as healthy samples. The ST time is treated as period T. For a 6-month interval, the data 8 years or 16 periods before ST are selected as time-series sets for the distress samples. The time span of the paired samples is the same as the distress samples.

According to the above principles, the data of 152 listed companies are collected, and the time span is year 2002 to year 2009, year 2003 to year 2010, year 2004 to year 2011, respectively. A total of 60 ST companies and 60 paired companies of the first half of year 2010 and 2011 are treated as training set, which is used to derive the model. A total of 16 ST companies and 16 paired companies of the first half of year 2012 are treated as testing set, which is used to test the effect of the model.

From the holistic perspective, we select 29 financial indicators covering four aspects of profitability, solvency, management efficiency, and market reaction as alternative signal indicators. The effect of the corporate financial problems may be amplified or reduced in information transmission mechanism of the market, and the problems may be exposed to the open market in advance or with a delay. If the problems are exposed in advance, the indicators can be used as a pilot signal of financial distress prediction; if delayed exposure, it can also be served as comprehensive evaluation of financial distress or the signal for the trend of development in the future. These are indicators of market reaction. The 29 signal indicators are listed in Table 1.

A three-dimensional database is established consisting of 16 periods' time-series data of the above 152 sample enterprises, the financial state of which is represented by 27 signal indicators each (As operating profit margin growth (Z5) and interest coverage ratio (Z12) have much missing data, we ignore these two subsets of the data, leaving the rest 27 subsets.). The dynamic prediction method described above is based on the trend of the time-series data. The centralized tendency of signal indicators of profitability, solvency, management efficiency, and market reaction is shown in Figures 3–6 (Some indicators of management efficiency and market reaction show cyclical fluctuations, so we amend these indicators by smoothing. Figures 5 and 6 have been amended.).

Then, we use nonparametric test of Mann-Whitney U to find out when the difference between distress samples and healthy samples occurs. The results show that the gap between the two is maximized 2 years before ST time and the significant difference occurs 4 years before ST time, that is, the earliest time to accurately predict the occurrence of financial distress should be

Type Code Signal indicators

Solvency Z<sup>8</sup> Current ratio

Management efficiency Z<sup>15</sup> Total assets turnover

Market reaction Z<sup>22</sup> Earnings per share

Table 1. Comprehensive signal indicators of financial distress prediction.

Profitability Z<sup>1</sup> Operating profit margin

Z<sup>2</sup> Net profit margin Z<sup>3</sup> Return on assets Z<sup>4</sup> Return on equity

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

Z<sup>9</sup> Quick ratio Z<sup>10</sup> Cash debt ratio Z<sup>11</sup> Debt coverage ratio Z<sup>12</sup> Interest coverage ratio Z<sup>13</sup> Liabilities to assets ratio Z<sup>14</sup> Liabilities to equity ratio

Z<sup>16</sup> Fixed asset turnover Z<sup>17</sup> Current assets turnover Z<sup>18</sup> Inventory turnover

Z<sup>23</sup> Net assets per share

Z<sup>27</sup> Price to book ratio

Z<sup>19</sup> Accounts receivable turnover Z<sup>20</sup> Cash ratio of main business Z<sup>21</sup> Cash return on assets

Z<sup>24</sup> Operating revenue per share Z<sup>25</sup> Capital reserve per share Z<sup>26</sup> Retained earnings per share

Z<sup>28</sup> Equity to invested capital ratio Z<sup>29</sup> Net cash flow per share

Z<sup>5</sup> Operating profit margin growth Z<sup>6</sup> Operating revenue growth Z<sup>7</sup> Total assets growth

http://dx.doi.org/10.5772/intechopen.71616

143

4 years before ST time.

From Figures 3–6, we can see most indicators show a certain trend, which is the foundation of dynamic prediction.


Table 1. Comprehensive signal indicators of financial distress prediction.

4. Empirical analysis

142 Kalman Filters - Theory for Advanced Applications

effect of the model.

Figures 5 and 6 have been amended.).

dynamic prediction.

4.1. Data description and experiment design

can be put into practice for these manufacturing companies.

Manufacturing industry is a major industry in China. "Made in China" has an important impact on the global economy. Therefore, prediction of corporate financial distress for China's manufacturing industry is of great significance. Generally, the manufacturing companies have complete production processes, equilibrious production cycle, as well as a more stable trend of development of the financial state. The characteristics of these companies can be well described using the existing financial indicators, and the dynamic prediction method described above

In this research, the data for our experiment are collected from the Shanghai Stock Exchange and Shenzhen Stock Exchange databases in China. ST (special treatment) companies because of financial problems are selected as distress samples; meanwhile, companies of similar asset size that have never been special treated are selected as healthy samples. The ST time is treated as period T. For a 6-month interval, the data 8 years or 16 periods before ST are selected as time-series sets for the distress samples. The time span of the paired samples is the same as the distress samples.

According to the above principles, the data of 152 listed companies are collected, and the time span is year 2002 to year 2009, year 2003 to year 2010, year 2004 to year 2011, respectively. A total of 60 ST companies and 60 paired companies of the first half of year 2010 and 2011 are treated as training set, which is used to derive the model. A total of 16 ST companies and 16 paired companies of the first half of year 2012 are treated as testing set, which is used to test the

From the holistic perspective, we select 29 financial indicators covering four aspects of profitability, solvency, management efficiency, and market reaction as alternative signal indicators. The effect of the corporate financial problems may be amplified or reduced in information transmission mechanism of the market, and the problems may be exposed to the open market in advance or with a delay. If the problems are exposed in advance, the indicators can be used as a pilot signal of financial distress prediction; if delayed exposure, it can also be served as comprehensive evaluation of financial distress or the signal for the trend of development in the future. These are indicators of market reaction. The 29 signal indicators are listed in Table 1. A three-dimensional database is established consisting of 16 periods' time-series data of the above 152 sample enterprises, the financial state of which is represented by 27 signal indicators each (As operating profit margin growth (Z5) and interest coverage ratio (Z12) have much missing data, we ignore these two subsets of the data, leaving the rest 27 subsets.). The dynamic prediction method described above is based on the trend of the time-series data. The centralized tendency of signal indicators of profitability, solvency, management efficiency, and market reaction is shown in Figures 3–6 (Some indicators of management efficiency and market reaction show cyclical fluctuations, so we amend these indicators by smoothing.

From Figures 3–6, we can see most indicators show a certain trend, which is the foundation of

Then, we use nonparametric test of Mann-Whitney U to find out when the difference between distress samples and healthy samples occurs. The results show that the gap between the two is maximized 2 years before ST time and the significant difference occurs 4 years before ST time, that is, the earliest time to accurately predict the occurrence of financial distress should be 4 years before ST time.

Figure 3. The centralized tendency of signal indicators of profitability for distress samples and healthy samples.

Figure 4. The centralized tendency of signal indicators of solvency for distress samples and healthy samples.

#### 4.2. Experiment results and analysis

We use principal component analysis to eliminate the effect of multicollinearity on the original variables. We extract first 10 principal components, and the accumulative contribution rate is above 92% each for 152 companies. These principal components are linear combinations of the original signal indicators, which can be served as part of discriminant models for each company.

company may fall into severe financial distress; when the predictive value is higher than 0.205, the company is well operated; and when the predictive value is between 0.796 and 0.205, it is

Figure 6. The centralized tendency of signal indicators of market reaction for distress samples and healthy samples.

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

Figure 5. The centralized tendency of signal indicators of management efficiency for distress samples and healthy

 Z22 Z23 Z24 Z25 Z26 Z27 Z28 Z29

 Z15 Z16 Z17 Z18 Z19 Z20 Z21

> Z22 Z23 Z24 Z25 Z26 Z27 Z28 Z29

> Z15 Z16 Z17 Z18 Z19 Z20 Z21

145

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

http://dx.doi.org/10.5772/intechopen.71616

Periods

Periods

Then, we test the effect of the dynamic prediction models using the data of testing set. Subject to space restrictions, we just list dynamic prediction figures for six companies, among which first three are ST companies, while the other three are non-ST companies. Names and stock codes of the companies are Sichuan Chemical Company Limited (000155), MCC Meili Paper Industry Co., Ltd. (000815), Guangzhou Guangri Stock Co., Ltd. (600894), Xinxiang Chemical Fiber Co., Ltd. (000949), Nantong Jiangshan Agrochemical & Chemicals Co., Ltd. (600389), Nanzhi Co., Ltd., and Fujian (600163), in turn. Dynamic prediction figures for these six com-

possible that the company is getting into financial distress.

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

Periods

Periods

samples.

panies are shown in Figure 7.

The parameters of process model are estimated from the data of training set and also using the data of training set, the judgment for the threshold of financial distress is set as an interval, which has lower and upper confidence limit.

The results show that the lower confidence limit is 0.796 and the upper confidence limit is 0.205. When the predictive value of a company's financial state is lower than 0.796, the

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress http://dx.doi.org/10.5772/intechopen.71616 145

Figure 5. The centralized tendency of signal indicators of management efficiency for distress samples and healthy samples.

Figure 6. The centralized tendency of signal indicators of market reaction for distress samples and healthy samples.

4.2. Experiment results and analysis

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

Periods

144 Kalman Filters - Theory for Advanced Applications

Periods

which has lower and upper confidence limit.

pany.


We use principal component analysis to eliminate the effect of multicollinearity on the original variables. We extract first 10 principal components, and the accumulative contribution rate is above 92% each for 152 companies. These principal components are linear combinations of the original signal indicators, which can be served as part of discriminant models for each com-

Figure 4. The centralized tendency of signal indicators of solvency for distress samples and healthy samples.


T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

Periods

 Z8 Z9 Z10 Z11 Z13 Z14

 Z1 Z2 Z3 Z4 Z6 Z7

Periods

 Z8 Z9 Z10 Z11 Z13 Z14

Figure 3. The centralized tendency of signal indicators of profitability for distress samples and healthy samples.

 Z1 Z2 Z3 Z4 Z6 Z7

The parameters of process model are estimated from the data of training set and also using the data of training set, the judgment for the threshold of financial distress is set as an interval,

The results show that the lower confidence limit is 0.796 and the upper confidence limit is 0.205. When the predictive value of a company's financial state is lower than 0.796, the company may fall into severe financial distress; when the predictive value is higher than 0.205, the company is well operated; and when the predictive value is between 0.796 and 0.205, it is possible that the company is getting into financial distress.

Then, we test the effect of the dynamic prediction models using the data of testing set. Subject to space restrictions, we just list dynamic prediction figures for six companies, among which first three are ST companies, while the other three are non-ST companies. Names and stock codes of the companies are Sichuan Chemical Company Limited (000155), MCC Meili Paper Industry Co., Ltd. (000815), Guangzhou Guangri Stock Co., Ltd. (600894), Xinxiang Chemical Fiber Co., Ltd. (000949), Nantong Jiangshan Agrochemical & Chemicals Co., Ltd. (600389), Nanzhi Co., Ltd., and Fujian (600163), in turn. Dynamic prediction figures for these six companies are shown in Figure 7.

The testing results show that almost all the curves of predictive value fits the ones of real value

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

http://dx.doi.org/10.5772/intechopen.71616

147

Of 16 distress testing samples, 15 companies give mild alarm in period T9 (4 years ahead), and 13 companies give severe alarm in period T7 and period T5 (3 years ahead and 2 years ahead). All the 16 companies give severe alarm in period T3 (1 year ahead). This shows that the information the dynamic model absorbed and produced almost covers the characteristics of financial distress. An accurate warning can be made 4 years before financial distress, and the accuracy is 93.8% (We also take triple BPNN to make a comparison. The results show that the accuracy of prediction 1 year ahead to 4 years ahead is 100, 93.8, 62.5, and 43.8%, respectively. The accuracy sharply declines 3 years ahead. It shows that the triple BPNN has better effect for short-term prediction rather than long-term

For healthy testing samples, none is lower than the severe alarm limit. But sometimes, the predictive values appear slightly below the mild alarm limit, showing that there have been cases of temporary deviation from healthy state for healthy testing samples. The dynamic model conducts a track and thereafter modifies. This shows that the model can objectively

In this chapter, we focus on the dynamic nature of corporate financial distress and establish dynamic prediction models consisting of a process model and a discriminant model, which are used to describe the dynamic process and discriminant rules of financial distress, respectively. The operation of the dynamic prediction is achieved by Kalman filtering algorithm, and a general n-step-ahead prediction algorithm based on Kalman filter is derived for prospective prediction. To validate the prediction performance of this method, we conduct an empirical study for China's manufacturing industry. The empirical results have proved the accuracy and advance of predicting financial distress using this dynamic model. The accuracy of prediction 4 years before financial distress is 93.8%. In addition, this method also solves the problem of massive data processing as it does not require storing large amounts of historical data and thus

In this research, we suppose the dynamic process of financial distress is linear. The Kalman filtering algorithm will be applied to a nonlinear dynamic model in the future research, and it

This research is supported by National Natural Science Foundation of China (Grant no.

71602188) and National Social Science Foundation of China (Grant no. 15ZDB167).

track and effectively predict the overall financial state of a company from a long run.

for 32 testing samples.

prediction.)

5. Conclusions and future work

can achieve real-time processing of data.

will offer a wider range of applications.

Acknowledgements

Figure 7. Dynamic prediction figures for part of testing samples.

The testing results show that almost all the curves of predictive value fits the ones of real value for 32 testing samples.

Of 16 distress testing samples, 15 companies give mild alarm in period T9 (4 years ahead), and 13 companies give severe alarm in period T7 and period T5 (3 years ahead and 2 years ahead). All the 16 companies give severe alarm in period T3 (1 year ahead). This shows that the information the dynamic model absorbed and produced almost covers the characteristics of financial distress. An accurate warning can be made 4 years before financial distress, and the accuracy is 93.8% (We also take triple BPNN to make a comparison. The results show that the accuracy of prediction 1 year ahead to 4 years ahead is 100, 93.8, 62.5, and 43.8%, respectively. The accuracy sharply declines 3 years ahead. It shows that the triple BPNN has better effect for short-term prediction rather than long-term prediction.)

For healthy testing samples, none is lower than the severe alarm limit. But sometimes, the predictive values appear slightly below the mild alarm limit, showing that there have been cases of temporary deviation from healthy state for healthy testing samples. The dynamic model conducts a track and thereafter modifies. This shows that the model can objectively track and effectively predict the overall financial state of a company from a long run.

### 5. Conclusions and future work

In this chapter, we focus on the dynamic nature of corporate financial distress and establish dynamic prediction models consisting of a process model and a discriminant model, which are used to describe the dynamic process and discriminant rules of financial distress, respectively. The operation of the dynamic prediction is achieved by Kalman filtering algorithm, and a general n-step-ahead prediction algorithm based on Kalman filter is derived for prospective prediction. To validate the prediction performance of this method, we conduct an empirical study for China's manufacturing industry. The empirical results have proved the accuracy and advance of predicting financial distress using this dynamic model. The accuracy of prediction 4 years before financial distress is 93.8%. In addition, this method also solves the problem of massive data processing as it does not require storing large amounts of historical data and thus can achieve real-time processing of data.

In this research, we suppose the dynamic process of financial distress is linear. The Kalman filtering algorithm will be applied to a nonlinear dynamic model in the future research, and it will offer a wider range of applications.

### Acknowledgements

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

146 Kalman Filters - Theory for Advanced Applications

Periods

 Real Prediction Upper limit Lower limit

 Real Prediction Upper limit Lower limit

 Real Prediction upper limit Lower limit




600389 600163

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

 Real Prediction Upper limit Lower limit

 Real Prediction Upper limit Lower limit

 Real Prediction Upper limit Lower limit

Periods

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

Periods

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

Periods

Periods

T-15 T-13 T-11 T-9 T-7 T-5 T-3 T-1

Periods

Figure 7. Dynamic prediction figures for part of testing samples.



0

2

4

6

> This research is supported by National Natural Science Foundation of China (Grant no. 71602188) and National Social Science Foundation of China (Grant no. 15ZDB167).

## Author details

### Qian Zhuang

Address all correspondence to: zhuangcpu@163.com

School of International Pharmaceutical Business, China Pharmaceutical University, Nanjing, Jiangsu, China

[11] Park CS, Han I. A case-based reasoning with the feature weights derived by analytic hierarchy process for bankruptcy prediction. Expert Systems with Applications.

Application of Kalman Filtering in Dynamic Prediction for Corporate Financial Distress

http://dx.doi.org/10.5772/intechopen.71616

149

[12] Shin KS, Lee TS, Kim HJ. An application of support vector machines in bankruptcy prediction model. Expert Systems with Applications. 2005;28:127-135. DOI: 10.1016/j.

[13] Lee MC, To C. Comparison of support vector machine and back propagation neural network in evaluating the enterprise financial distress. International Journal of Artificial

[14] Chaudhuria A, De K. Fuzzy support vector machine for bankruptcy prediction. Applied

[15] Altman EI, Marco G, Varetto F. Corporate distress diagnosis: Comparisons using linear discriminant analysis and neural networks. Journal of Banking & Finance. 1994;18:505-

[16] Giovanis E. A study of panel logit model and adaptive neuro-fuzzy inference system in the prediction of financial distress periods. World Academy of Science, Engineering and

[17] Ravisankar P, Ravi V. Financial distress prediction in banks using group method of data handling neural network, counter propagation neural network and fuzzy ARTMAP.

[18] Bahrammirzaee A. A comparative survey of artificial intelligence applications in finance: Artificial neural networks, expert system and hybrid intelligent systems. Neural Com-

[19] Tsenga FM, YC H. Comparing four bankruptcy prediction models: Logit, quadratic interval logit, neural and fuzzy neural networks. Expert Systems with Applications.

[20] Rafieia FM, Manzarib SM, Bostanianb S. Financial health prediction models using artificial neural networks, genetic algorithm and multivariate discriminant analysis: Iranian

[21] Sun J, Li H. Dynamic financial distress prediction using instance selection for the disposal of concept drift. Expert Systems with Applications. 2011;38:2566-2576. DOI: 10.1016/j.

[22] Konstantaras K, Siriopoulos C. Estimating financial distress with a dynamic model: Evidence from family owned enterprises in a small open economy. Journal of Multina-

[23] Giarda E. Persistency of financial distress amongst Italian households: Evidence from dynamic models for binary panel data. Journal of Banking & Finance. 2013;37:3425-3434.

tional Financial Management. 2011;21:239-255. DOI: 10.1016/j.mulfin.2011.04.001

Knowledge-Based Systems. 2010;23:823-831. DOI: 10.1016/j.knosys.2010.05.007

puting and Applications. 2010;19:1165-1195. DOI: 10.1007/s00521-010-0362-z

Intelligence & Applications. 2010;1:31-43. DOI: 10.5121/ijaia.2010.1303

Soft Computing. 2011;11:2472-2486. DOI: 10.1016/j.asoc.2010.10.003

2002;23:255-264. DOI: 10.1016/S0957-4174(02)00045-3

529. DOI: 10.1016/0378-4266(94)90007-8

2010;37:1846-1853. DOI: 10.1016/j.eswa.2009.07.081

evidence. Expert Systems with Applications. 2011;38:10210-10217

Technology. 2010;64:646-652

eswa.2010.08.046

DOI: 10.1016/j.jbankfin.2013.05.005

eswa.2004.08.009

### References


[11] Park CS, Han I. A case-based reasoning with the feature weights derived by analytic hierarchy process for bankruptcy prediction. Expert Systems with Applications. 2002;23:255-264. DOI: 10.1016/S0957-4174(02)00045-3

Author details

148 Kalman Filters - Theory for Advanced Applications

Address all correspondence to: zhuangcpu@163.com

(Supplement). 1966;4:71-111. DOI: 10.2307/2490171

School of International Pharmaceutical Business, China Pharmaceutical University, Nanjing,

[1] Beaver WH. Financial ratios as predictors of failure. Journal of Accounting Research

[2] Altman EI. Financial ratios, discriminant analysis and the prediction of corporate bankruptcy. The Journal of Finance. 1968;23:589-609. DOI: 10.1111/j.1540-6261.1968.tb00843.x

[3] Altman EI, Haldeman RG, Narayanan P. Zeta analysis: A new model to identify bank-

[4] Martin D. Early warning of bank failure: A logit regression approach. Journal of Banking

[5] Ohlson JA. Financial ratios and the probabilistic prediction of bankruptcy. Journal of

[6] DS W, Liang L, Yang ZJ. Analyzing the financial distress of Chinese public companies using probabilistic neural networks and multivariate discriminate analysis. Socio-

[7] Shen H, Cui J, Zhou ZB, Min H. BP-neural network model for financial risk warning in medicine listed company. In: Proceedings of 2011 Fourth International Joint Conference on Computational Sciences and Optimization (CSO); May 2011; Yunnan, China: IEEE;

[8] Zhou X, Wang JY, Xie W, Hong Y. Research on the optimal methods of financial distress prediction based on BP neural networks. In: Proceedings of the 2012 Second International Conference on Electric Information and Control Engineering; 06–08 Apr 2012; Jiangxi,

[9] Sun J, He KY, Li H. SFFS-PC-NN optimized by genetic algorithm for dynamic prediction of financial distress with longitudinal data streams. Knowledge-Based Systems. 2011;24:

[10] Cao Y, Wan GY, Wang FQ. Predicting financial distress of Chinese listed companies using rough set theory and support vector machine. Asia-Pacific Journal of Operational

Economic Planning Sciences. 2008;42:206-220. DOI: 10.1016/j.seps.2006.11.002

ruptcy risk of corporations. Journal of Banking & Finance. 1977;1:29-54

& Finance. 1977;1:249-276. DOI: 10.1016/0378-4266(77)90022-X

Accounting Research. 1980;18:109-131. DOI: 10.2307/2490395

China: IEEE; 2012. pp. 735-738. DOI: 10.1109/ICEICE.2012.1070

Research. 2011;28:95-109. DOI: 10.1142/S0217595911003077

2011. pp. 767-770. DOI: 10.1109/CSO.2011.97

1013-1023. DOI: 10.1016/j.knosys.2011.04.013

Qian Zhuang

Jiangsu, China

References


[24] Durbin J, Koopman SJ. Time Series Analysis by State Space Methods. 2nd ed. Oxford, UK: Oxford University Press; 2012. DOI: 10.1093/acprof:oso/9780199641178.001.0001

**Chapter 8**

**Provisional chapter**

**Predicting Collisions in Mobile Robot Navigation by**

The growing trend of the use of robots in many areas of daily life makes it necessary to search for approaches to improve efficiency in tasks performed by robots. For that reason, we show, in this chapter, the application of the Kalman filter applied to the navigation of mobile robots, specifically the Time-to-contact (TTC) problem. We present a summary of approaches that have been taken to address the TTC problem. We use a monocular vision-based approach to detect potential obstacles and follow them over time through their apparent size change. Our approach collects information about obstacle data and models the behavior while the robot is approaching the obstacle, in order to predict collisions. We highlight some characteristics of the Kalman filter applied to our problem. Finally, we show of our results applied to sequences composed of 210 frames in different real scenarios. The results show a fast convergence of the model to the data and good fit

**Keywords:** Kalman filter, Time-to-contact, avoiding collisions, robot navigation,

**Predicting Collisions in Mobile Robot Navigation by** 

DOI: 10.5772/intechopen.71653

© 2016 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution,

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

and reproduction in any medium, provided the original work is properly cited.

Nowadays, many robotic entities have been developed in order to make many human activities more efficient. In fact, it is common to find robots in hospitals, factories, and even in homes, which help to automate many tasks autonomously or semi-autonomously. However, many problems can arise when mobile autonomous robots must travel in uncertain and unknown environments. For this reason, techniques, programs, and sensors have been developed over time to address such tasks as localization, communication, path planning, and collision avoidance. Faced with

**Kalman Filter**

**Abstract**

Antonio Marín

**Kalman Filter**

Angel Sánchez, Homero Ríos,

Gustavo Quintana and Antonio Marín

http://dx.doi.org/10.5772/intechopen.71653

even with noisy measures.

forecasting

**1. Introduction**

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

Angel Sánchez, Homero Ríos, Gustavo Quintana and


**Provisional chapter**

### **Predicting Collisions in Mobile Robot Navigation by Kalman Filter Kalman Filter**

**Predicting Collisions in Mobile Robot Navigation by** 

DOI: 10.5772/intechopen.71653

Angel Sánchez, Homero Ríos, Gustavo Quintana and Antonio Marín Antonio Marín Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

Angel Sánchez, Homero Ríos, Gustavo Quintana and

http://dx.doi.org/10.5772/intechopen.71653

#### **Abstract**

[24] Durbin J, Koopman SJ. Time Series Analysis by State Space Methods. 2nd ed. Oxford, UK: Oxford University Press; 2012. DOI: 10.1093/acprof:oso/9780199641178.001.0001 [25] Kalman RE. A new approach to linear filtering and prediction problems. Journal of Basic

[26] Brown RG, PYC H. Introduction to Random Signals and Applied Kalman Filtering. 3rd

[27] Arnold T, Bertus M, Godbey JM. A simplified approach to understanding the Kalman filter technique. The Engineering Economist. 2008;53:140-155. DOI: 10.2139/ssrn.715301

[28] Shi Y, Fang HZ. Kalman filter-based identification for systems with randomly missing measurements in a network environment. International Journal of Control. 2010;83:

Engineering. 1960;82:35-45. DOI: 10.1115/1.3662552

ed. USA: John Wiley & Sons, Inc.; 1997

150 Kalman Filters - Theory for Advanced Applications

538-551. DOI: 10.1080/00207170903273987

The growing trend of the use of robots in many areas of daily life makes it necessary to search for approaches to improve efficiency in tasks performed by robots. For that reason, we show, in this chapter, the application of the Kalman filter applied to the navigation of mobile robots, specifically the Time-to-contact (TTC) problem. We present a summary of approaches that have been taken to address the TTC problem. We use a monocular vision-based approach to detect potential obstacles and follow them over time through their apparent size change. Our approach collects information about obstacle data and models the behavior while the robot is approaching the obstacle, in order to predict collisions. We highlight some characteristics of the Kalman filter applied to our problem. Finally, we show of our results applied to sequences composed of 210 frames in different real scenarios. The results show a fast convergence of the model to the data and good fit even with noisy measures.

**Keywords:** Kalman filter, Time-to-contact, avoiding collisions, robot navigation, forecasting

### **1. Introduction**

Nowadays, many robotic entities have been developed in order to make many human activities more efficient. In fact, it is common to find robots in hospitals, factories, and even in homes, which help to automate many tasks autonomously or semi-autonomously. However, many problems can arise when mobile autonomous robots must travel in uncertain and unknown environments. For this reason, techniques, programs, and sensors have been developed over time to address such tasks as localization, communication, path planning, and collision avoidance. Faced with

© 2016 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. © 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

these problems, robots must be able to sense their environment and understand it to make the best decisions. From these tasks, we will analyze the task of avoiding obstacles by mobile robots, using the well-known term "Time-to-contact" or TTC.

TTC is a biologically inspired method for obstacle detection and reactive control of motion. TTC was first studied and defined in [1] as "*the distance to an obstacle divided by the relative velocity between them*." In other words, TTC is the elapsed time before an observer (the center of projection) makes contact with the surface being viewed if the current relative motion between the observer (e.g., a robot's camera) and the surface were to continue without changes, i.e., under constant relative velocity. TTC is usually expressed in terms of the speed and the distance of the considered obstacle. The classical equation to compute TTC is given by Eq. (1)

$$\text{TTC} = -\frac{\text{Z}}{\frac{d\text{Z}}{dt}}\tag{1}$$

The main idea of this chapter is to address this problem, modeling the growth of objects as the camera approaches the obstacle, in order to avoid detection obstacles in each frame once a precise model is built. First, we highlight some important works in the literature to give an overview of the different approaches that have been used to address this problem, discussing advantages and disadvantages of them. In the next section, we will give a brief description of the whole process that we use and how we address the problem using the Kalman Filter. Subsequently, we describe some experiments and results that we have made, to conclude

Predicting Collisions in Mobile Robot Navigation by Kalman Filter

http://dx.doi.org/10.5772/intechopen.71653

153

The problem of estimating the Time-to-contact continues to be approached with different techniques. This is due to the fact that there are some factors that can prevent the robot from recognizing its environment reliably, such as the change of light intensity in the environment, erroneous segmentation of obstacles, or errors due to sinuous floors (especially with mobile

Perhaps, the most practical and accurate approach is to use specialized sensors embedded in robots, such as sonars [2, 3]. Depth sensing used in the literature for robotic navigation and egomotion has been performed by binocular vision (stereo vision) [4, 5]. Other studies [6] have estimated TTC using paracatadioptric sensors with good results in real time. Although ultrasonic range sensors have large field of view, cross-talk problems might appear if more than one sensor is used simultaneously. As a result, "*the frequency of obstacle detection is limited by the number of sensors in use and the time required for an echo to return from an obstacle*" [7].

In order to minimize the energy consumption and cost, we decided to use passive sensors such as one camera only, i.e., monocular vision. Several studies have employed monocular vision to estimate TTC. For example, motion has been computed from images in space and spectral domains, and specifically TTC has been estimated using temporal change in power spectra between successive images [8]; however, switching from time domain to frequency domain involves extra processing. Additionally, TTC can be estimated for different goals (e.g., docking and landing) [9, 10] from the focus of expansion (FOE), however, these approaches are based on estimating optical flow, and hence they "*are iterative, need to work at multiple scales, tend to be computationally expensive and require a significant effort to implement properly*" [11].

Other method to estimate TTC is by "Direct method," which works directly with the derivatives of image brightness and does not require feature detection, feature tracking, or estimate of the optical flow [12]. Despite this method has achieved good results to approach surfaces, there are cases where the accuracy is compromised (e.g., when the robot approaches untextured walls

Finally, TTC has been computed using changes in the obstacle's size. For instance, studies in [13, 14] have used the fact that animals and insects obtain information from the apparent size *S* of objects and the temporal changes in the size. This information is usually called the

with some conclusions and future work.

and thus changing of the brightness is zero).

**2. Background**

robots on wheel).

where Z is the distance between the observer and the obstacle, and \_\_\_ *dZ dt* is the velocity of the robot with respect to the obstacle. **Figure 1** shows the camera model and perception of obstacles from a mobile robot using monocular vision, where *t* represents the time, *Z* is the distance, *f* referring to the focal length, *r* is defined as the distance between the center of projection and the obstacle, and S representing the height of an obstacle.

**Figure 1.** Isometric view of the model of perception.

The main idea of this chapter is to address this problem, modeling the growth of objects as the camera approaches the obstacle, in order to avoid detection obstacles in each frame once a precise model is built. First, we highlight some important works in the literature to give an overview of the different approaches that have been used to address this problem, discussing advantages and disadvantages of them. In the next section, we will give a brief description of the whole process that we use and how we address the problem using the Kalman Filter. Subsequently, we describe some experiments and results that we have made, to conclude with some conclusions and future work.

### **2. Background**

(1)

*dt* is the velocity of the

these problems, robots must be able to sense their environment and understand it to make the best decisions. From these tasks, we will analyze the task of avoiding obstacles by mobile robots,

TTC is a biologically inspired method for obstacle detection and reactive control of motion. TTC was first studied and defined in [1] as "*the distance to an obstacle divided by the relative velocity between them*." In other words, TTC is the elapsed time before an observer (the center of projection) makes contact with the surface being viewed if the current relative motion between the observer (e.g., a robot's camera) and the surface were to continue without changes, i.e., under constant relative velocity. TTC is usually expressed in terms of the speed and the distance of

> \_\_\_ *dZ dt*

robot with respect to the obstacle. **Figure 1** shows the camera model and perception of obstacles from a mobile robot using monocular vision, where *t* represents the time, *Z* is the distance, *f* referring to the focal length, *r* is defined as the distance between the center of projection and

the considered obstacle. The classical equation to compute TTC is given by Eq. (1)

where Z is the distance between the observer and the obstacle, and \_\_\_ *dZ*

using the well-known term "Time-to-contact" or TTC.

152 Kalman Filters - Theory for Advanced Applications

*TTC* = −\_\_\_*<sup>Z</sup>*

the obstacle, and S representing the height of an obstacle.

**Figure 1.** Isometric view of the model of perception.

The problem of estimating the Time-to-contact continues to be approached with different techniques. This is due to the fact that there are some factors that can prevent the robot from recognizing its environment reliably, such as the change of light intensity in the environment, erroneous segmentation of obstacles, or errors due to sinuous floors (especially with mobile robots on wheel).

Perhaps, the most practical and accurate approach is to use specialized sensors embedded in robots, such as sonars [2, 3]. Depth sensing used in the literature for robotic navigation and egomotion has been performed by binocular vision (stereo vision) [4, 5]. Other studies [6] have estimated TTC using paracatadioptric sensors with good results in real time. Although ultrasonic range sensors have large field of view, cross-talk problems might appear if more than one sensor is used simultaneously. As a result, "*the frequency of obstacle detection is limited by the number of sensors in use and the time required for an echo to return from an obstacle*" [7].

In order to minimize the energy consumption and cost, we decided to use passive sensors such as one camera only, i.e., monocular vision. Several studies have employed monocular vision to estimate TTC. For example, motion has been computed from images in space and spectral domains, and specifically TTC has been estimated using temporal change in power spectra between successive images [8]; however, switching from time domain to frequency domain involves extra processing. Additionally, TTC can be estimated for different goals (e.g., docking and landing) [9, 10] from the focus of expansion (FOE), however, these approaches are based on estimating optical flow, and hence they "*are iterative, need to work at multiple scales, tend to be computationally expensive and require a significant effort to implement properly*" [11].

Other method to estimate TTC is by "Direct method," which works directly with the derivatives of image brightness and does not require feature detection, feature tracking, or estimate of the optical flow [12]. Despite this method has achieved good results to approach surfaces, there are cases where the accuracy is compromised (e.g., when the robot approaches untextured walls and thus changing of the brightness is zero).

Finally, TTC has been computed using changes in the obstacle's size. For instance, studies in [13, 14] have used the fact that animals and insects obtain information from the apparent size *S* of objects and the temporal changes in the size. This information is usually called the

**Figure 2.** Methodology to performance the TTC forecasting.

"tau-margin" defined as Eq. (2). Tau-margin is derived from Eq. (1) by using a characteristic size of the obstacle on the image [15] and the approximation that the obstacle is planar and parallel to the image plane.

$$
\tau = -\frac{S}{\frac{dS}{dt}}\tag{2}
$$

**3. Estimating Time-to-contact**

**3.1. Segmentation process**

approaches a bright green sphere.

**3.2. Calculating apparent size**

"apparent size."

in **Figure 2**.

In the following sections, we will give an outline of the processes used in each module, shown

Predicting Collisions in Mobile Robot Navigation by Kalman Filter

http://dx.doi.org/10.5772/intechopen.71653

155

In a controlled experimental environment, we detect obstacles by color, and analyze the height of the segmented region by enclosing it in a rectangle. The colors are pre-calibrated. **Figure 3** shows examples of two experimental cases and their segmentation by color. In the first scenario, the robot approaches an opaque red cylinder. In the second case, the robot

**Figure 4** represents a mobile robot model, where *S* is representing the size of the detected object, *r* represents the distance between the mobile robot and the detected obstacle, and *θ* the proportional the aperture of the angle to the object's size projected on the image called

**Figure 5** illustrates how the apparent size of the objects is expanded while it is approaching the camera. From a perspective view, T regions decrease in the image and the apparent size S′ (S projected on the image) grows proportionally as the robot approaches the obstacle. The

**Figure 3.** Example of segmentation by color process with experimental scenarios.

However, a last focus on which we are interested is based on modeling the robot's movement. The study [16] has calculated TTC in vehicular motion using several scenarios. The idea is promising; however, due to the use of interest points, a mechanism needs to be implemented for grouping these points into different regions representing different obstacles.

In this brief summary, we can see that many approaches have been proposed, however, more approaches are still emerging because there are factors that condition the accuracy of the TTC estimate. But, we decided to use monocular vision to minimize costs of specialized sensors (in terms of energy and money).

The approach we have worked on is to model the apparent sizes of the segmented obstacle in each number of frames, in order to predict the Time-to-contact, that is, in how many frames the robot could collide with that obstacle. Since the TTC is estimated by analyzing how the apparent size of the object is changing with respect to time, we can find errors if the segmentation is not correct, which would lead to an incorrect acceleration or deceleration of the robot and to a possible collision.

When constructing models of a phenomenon, we base the predictions on previous data, which leads the robot to "understand" the behavior of its environment, if it has a constant speed. Having explained the importance of modeling, we decided to incorporate the Kalman Filter to address this problem and have reliable predictions. **Figure 2** shows the methodology used to estimate and forecast TTC.

## **3. Estimating Time-to-contact**

In the following sections, we will give an outline of the processes used in each module, shown in **Figure 2**.

### **3.1. Segmentation process**

In a controlled experimental environment, we detect obstacles by color, and analyze the height of the segmented region by enclosing it in a rectangle. The colors are pre-calibrated. **Figure 3** shows examples of two experimental cases and their segmentation by color. In the first scenario, the robot approaches an opaque red cylinder. In the second case, the robot approaches a bright green sphere.

### **3.2. Calculating apparent size**

"tau-margin" defined as Eq. (2). Tau-margin is derived from Eq. (1) by using a characteristic size of the obstacle on the image [15] and the approximation that the obstacle is planar and

> \_\_\_ *dS dt*

However, a last focus on which we are interested is based on modeling the robot's movement. The study [16] has calculated TTC in vehicular motion using several scenarios. The idea is promising; however, due to the use of interest points, a mechanism needs to be implemented

In this brief summary, we can see that many approaches have been proposed, however, more approaches are still emerging because there are factors that condition the accuracy of the TTC estimate. But, we decided to use monocular vision to minimize costs of specialized sensors (in

The approach we have worked on is to model the apparent sizes of the segmented obstacle in each number of frames, in order to predict the Time-to-contact, that is, in how many frames the robot could collide with that obstacle. Since the TTC is estimated by analyzing how the apparent size of the object is changing with respect to time, we can find errors if the segmentation is not correct, which would lead to an incorrect acceleration or deceleration of the robot

When constructing models of a phenomenon, we base the predictions on previous data, which leads the robot to "understand" the behavior of its environment, if it has a constant speed. Having explained the importance of modeling, we decided to incorporate the Kalman Filter to address this problem and have reliable predictions. **Figure 2** shows the methodology

for grouping these points into different regions representing different obstacles.

(2)

parallel to the image plane.

154 Kalman Filters - Theory for Advanced Applications

terms of energy and money).

and to a possible collision.

used to estimate and forecast TTC.

*τ* = −\_\_*<sup>S</sup>*

**Figure 2.** Methodology to performance the TTC forecasting.

**Figure 4** represents a mobile robot model, where *S* is representing the size of the detected object, *r* represents the distance between the mobile robot and the detected obstacle, and *θ* the proportional the aperture of the angle to the object's size projected on the image called "apparent size."

**Figure 5** illustrates how the apparent size of the objects is expanded while it is approaching the camera. From a perspective view, T regions decrease in the image and the apparent size S′ (S projected on the image) grows proportionally as the robot approaches the obstacle. The

**Figure 3.** Example of segmentation by color process with experimental scenarios.

*θ* = 2[*arc*(

only upon its predecessor. We assume that *Wt*

**3.3. Modeling process**

In Eq. (4), *Wt*

*W*1

Pr(*Wt*


the application to our problem.

**Figure 6.** Geometrical view of the camera model.

*S*′ \_\_ \_\_2

So, suppose we have a mobile robot moving towards an obstacle and we need to be generating a model of the size of the obstacle, that is, as it approaches the obstacle, the camera detects that the obstacle is growing. This is a scenario for the Kalman Filter, because the method is a part of the temporal and tracking models, which when applied to our problem means the tracking of the apparent size of any obstacle over time. The main characteristic of the temporal

*w<sup>t</sup>* = *μp* + *Fwt*−1 + ϵ (5)

the transfer matrix or transition matrix, which relates the mean of the state at time t to the state at time *t* − 1, and ε is a random variable (usually called the process noise) associated with random events or forces that directly affect the actual state of the system, and which is normally

In Eq. (4), we can see that it is a recursive model, because we assume that each state depends

Below, we give a brief description of the specific case Kalman filter. It is not our intention to explain in detail the Kalman filter, we only want to highlight some characteristics and explain

,…, *Wt* − 2 given its immediate predecessor *Wt* − 1, and just model the conditional relationship

is an n-dimensional vector of the state components, *F* is an n-by-n matrix called

models is that they relate the state of the system to time *t* − 1 and *t* as shown by Eq. (5)

distributed and determines how closely related the states are at times *t* and *t* − 1 [16].

*<sup>f</sup>* )] (4)

http://dx.doi.org/10.5772/intechopen.71653

157

Predicting Collisions in Mobile Robot Navigation by Kalman Filter

is conditionally independent of the states

**Figure 4.** View of the mobile robot approaching an obstacle.

**Figure 5.** Perspective view of the approaching process.

best case is when the obstacle approaching the camera is alienated with it. In this case, to find the value of *θ*, the triangle ACD (see **Figure 6**) is divided into two right triangles (ABD and BCD) and from opposite angles by a vertex, we can estimate *θ*<sup>1</sup> by Eq. (3). Since *θ*<sup>1</sup>  = *θ*<sup>2</sup> , rearranging Eq. (3) we obtain *θ* as is shown in Eq. (4)

$$
\tan\left(\theta\_1\right) = \frac{\frac{S'}{2}}{f} \tag{3}
$$

Predicting Collisions in Mobile Robot Navigation by Kalman Filter http://dx.doi.org/10.5772/intechopen.71653 157

$$\theta = 2 \left[ \arcsin\left(\frac{\frac{S}{2}}{f}\right) \right] \tag{4}$$

#### **3.3. Modeling process**

So, suppose we have a mobile robot moving towards an obstacle and we need to be generating a model of the size of the obstacle, that is, as it approaches the obstacle, the camera detects that the obstacle is growing. This is a scenario for the Kalman Filter, because the method is a part of the temporal and tracking models, which when applied to our problem means the tracking of the apparent size of any obstacle over time. The main characteristic of the temporal models is that they relate the state of the system to time *t* − 1 and *t* as shown by Eq. (5)

$$\mathbf{w}\_{t} = \boldsymbol{\mu}\_{p} + F\mathbf{w}\_{t-1} + \mathbf{e} \tag{5}$$

In Eq. (4), *Wt* is an n-dimensional vector of the state components, *F* is an n-by-n matrix called the transfer matrix or transition matrix, which relates the mean of the state at time t to the state at time *t* − 1, and ε is a random variable (usually called the process noise) associated with random events or forces that directly affect the actual state of the system, and which is normally distributed and determines how closely related the states are at times *t* and *t* − 1 [16].

In Eq. (4), we can see that it is a recursive model, because we assume that each state depends only upon its predecessor. We assume that *Wt* is conditionally independent of the states *W*1 ,…, *Wt* − 2 given its immediate predecessor *Wt* − 1, and just model the conditional relationship Pr(*Wt* |*Wt* − 1) [17].

Below, we give a brief description of the specific case Kalman filter. It is not our intention to explain in detail the Kalman filter, we only want to highlight some characteristics and explain the application to our problem.

**Figure 6.** Geometrical view of the camera model.

best case is when the obstacle approaching the camera is alienated with it. In this case, to find the value of *θ*, the triangle ACD (see **Figure 6**) is divided into two right triangles (ABD and

> *S*′ \_\_ \_\_2

by Eq. (3). Since *θ*<sup>1</sup>

*<sup>f</sup>* (3)

 = *θ*<sup>2</sup>

, rear-

BCD) and from opposite angles by a vertex, we can estimate *θ*<sup>1</sup>

ranging Eq. (3) we obtain *θ* as is shown in Eq. (4)

**Figure 5.** Perspective view of the approaching process.

**Figure 4.** View of the mobile robot approaching an obstacle.

156 Kalman Filters - Theory for Advanced Applications

*tan*(*θ*1) =

#### *3.3.1. Description of Kalman filter*

The Kalman filter is a set of mathematical equations, described first time in [18], where a recursive solution to the discrete data linear filtering problem is presented. This method has been extensively researched and applied in various fields because it provides us an efficient computational (recursive) mechanism to estimate the state of a process. The filter is powerful because it involves estimations of past, present, and even future states. Kalman filter involves these elements with the use of knowledge of the system and measurement device, the statistical description of the system noises and any available information about initial conditions of the variables of interest [19].

After, the robot takes another measurement based on color segmentation at time *t*<sup>2</sup>

these measures, and to obtain a new one with its own variation (Gaussian distribution) Eqs. (6) and (7) are used, where can be seen that the new value is just a weighted combination of the two measured means and the weighting is determined by the relative uncertainties of the two measurements (conditional mean). The weight in these equations can be seen as: if *σθ*<sup>1</sup>

variability. Also, the uncertainty in the estimate of new *θ* has been decreased by combining

<sup>2</sup>) *<sup>θ</sup>*<sup>1</sup> <sup>+</sup> (

*σθ*1 2 \_\_\_\_\_\_ *σθ*1 <sup>2</sup> + *σθ*<sup>2</sup>

*σθ*2 2 \_\_\_\_\_\_ *σθ*1 <sup>2</sup> + *σθ*<sup>2</sup>

> <sup>2</sup> <sup>=</sup> *σθ*<sup>1</sup> <sup>2</sup> *σθ*<sup>2</sup> 2 \_\_\_\_\_\_ *σθ*1 <sup>2</sup> + *σθ*<sup>2</sup>

Now that we know how to obtain a next measure, we can continue with this process *N* times (*N* measurements). This is because we can combine the first two, then the third with the combination of the first two, the fourth with the combination of the first three, and so on [16]. This is what happens when we are tracking the *θ* over time, we obtain one measure followed by

Usually, Eq. (6) is rewritten as Eq. (8), and Eq. (7) as Eq. (9) because with this new forms, we

2 \_\_\_\_\_\_ *σθ*1 <sup>2</sup> + *σθ*<sup>2</sup>

> 2 \_\_\_\_\_\_ *σθ*1 <sup>2</sup> + *σθ*<sup>2</sup> <sup>2</sup>) *σθ*<sup>1</sup>

2 \_\_\_\_\_\_ *σθ*1 <sup>2</sup> + *σθ*<sup>2</sup>

can separate the old information from de new information. The new information (*θ*<sup>2</sup>

<sup>2</sup> <sup>=</sup> (<sup>1</sup> <sup>−</sup> *σθ*<sup>1</sup>

Finally, Eq. (10) shows our optimal iterative update factor, which is known as the *update gain K*, and so, we obtain the recursive form described in Eqs. (11) and (12). For a more detailed

<sup>ˆ</sup>*θ*<sup>2</sup> = *θ*<sup>1</sup> + *K*(*θ*<sup>2</sup> − *θ*1) (11)

<sup>2</sup> <sup>=</sup> (1 <sup>−</sup> *<sup>K</sup>*) *σθ*<sup>1</sup>

Finally, once the behavior has been modeled, it will be possible to forecast TTC by Eq. (2).

ˆ2

with a variance *σθ*<sup>2</sup>

(that is, more variability), *σθ*<sup>2</sup>

fore, is obtained *θ*<sup>2</sup>

greater than *σθ*<sup>2</sup>

the two pieces of information [19]

another followed by another.

called *innovation*

*<sup>μ</sup>* <sup>=</sup> *<sup>θ</sup>*<sup>12</sup> <sup>=</sup> (

*σ*<sup>12</sup>

<sup>ˆ</sup>*θ*<sup>2</sup> <sup>=</sup> *<sup>θ</sup>*<sup>1</sup> <sup>+</sup> *σθ*<sup>1</sup>

explanation, we suggest to the reader have a look in [19]

*<sup>K</sup>* <sup>=</sup> *σθ*<sup>1</sup>

<sup>ˆ</sup>*σθ*<sup>2</sup>

*σ*

, and there-

is

159

has less

 − *θ*<sup>1</sup> ) is

(which is assumed to be less than the first). To combine

Predicting Collisions in Mobile Robot Navigation by Kalman Filter

http://dx.doi.org/10.5772/intechopen.71653

would have more weight because *σθ*<sup>2</sup>

<sup>2</sup>) *<sup>θ</sup>*<sup>2</sup> (6)

<sup>2</sup> (7)

<sup>2</sup> (*θ*<sup>2</sup> − *θ*1) (8)

<sup>2</sup> (9)

<sup>2</sup> (10)

<sup>2</sup> (12)

To begin, we must remember that the basic idea of the Kalman Filter is, under a set of assumptions, it will be possible, given a history of measurements of a system, construct a model for the state of the System that maximizes the a posteriori probability of previous measurements. We can maximize *a posteriori* probability without having a long history of measurements above. Instead, we can iteratively update our state model of a system and maintain only that model for the next iteration [16]. These iterations are formed mainly by processes of prediction, measurement, and updating of the state.

Before explaining the process used, we must remember that Kalman Filter is based on three assumptions:


In other words, the first assumption means that the state of the system at time *t* can be modeled as a matrix multiplied by the state at time *t* − 1. That is good because linear systems are more easily manipulated and practical than nonlinear. The additional assumptions that the noise is white and Gaussian means that the noise is not correlated over time and that its amplitude can be accurately modeled using a mean and a covariance (i.e., noise is fully described by its first and second moments) [16].

### *3.3.2. Kalman filter applied to TTC*

Below, a brief explanation of how the Kalman Filter is used to predict new apparent size measurements of the obstacle to avoid will be given. We emphasize that we do not model the TTC as such, but we model the behavior of the apparent size of the projected obstacle on the image because the TTC depends on this growth.

So, at some time *t* 1 , we determine the apparent size *θ* to be *θ*<sup>1</sup> . However, because of inherent measuring device inaccuracies (such as changes of light intensity or non-smooth floor mentioned above), the result of the measurements is somewhat uncertain. Then, we decide that the precision is such that the standard deviation involved is *σ*<sup>1</sup> (only one variable). Thus, we can establish the conditional probability, the value at time *t* 1 , conditioned on the observed value of the measurement *θ*<sup>1</sup> , that is, we have the probability that *θ* has a value, based upon the measurement we took. At this moment, we best estimate of the θˆ <sup>1</sup> <sup>=</sup> *<sup>θ</sup>*<sup>1</sup> and the variance *σ*ˆ *<sup>θ</sup>*<sup>1</sup> <sup>2</sup> <sup>=</sup> *σθ*<sup>1</sup> 2 .

After, the robot takes another measurement based on color segmentation at time *t*<sup>2</sup> , and therefore, is obtained *θ*<sup>2</sup> with a variance *σθ*<sup>2</sup> (which is assumed to be less than the first). To combine these measures, and to obtain a new one with its own variation (Gaussian distribution) Eqs. (6) and (7) are used, where can be seen that the new value is just a weighted combination of the two measured means and the weighting is determined by the relative uncertainties of the two measurements (conditional mean). The weight in these equations can be seen as: if *σθ*<sup>1</sup> is greater than *σθ*<sup>2</sup> (that is, more variability), *σθ*<sup>2</sup> would have more weight because *σθ*<sup>2</sup> has less variability. Also, the uncertainty in the estimate of new *θ* has been decreased by combining the two pieces of information [19]

*3.3.1. Description of Kalman filter*

158 Kalman Filters - Theory for Advanced Applications

tion, measurement, and updating of the state.

described by its first and second moments) [16].

because the TTC depends on this growth.

precision is such that the standard deviation involved is *σ*<sup>1</sup>

measurement we took. At this moment, we best estimate of the θˆ <sup>1</sup> <sup>=</sup> *<sup>θ</sup>*<sup>1</sup>

establish the conditional probability, the value at time *t*

1

**2.** The errors or noise subject to the measurements are "white."

**1.** The evolution of state space is linear.

**3.** This noise is also Gaussian.

*3.3.2. Kalman filter applied to TTC*

So, at some time *t*

of the measurement *θ*<sup>1</sup>

assumptions:

The Kalman filter is a set of mathematical equations, described first time in [18], where a recursive solution to the discrete data linear filtering problem is presented. This method has been extensively researched and applied in various fields because it provides us an efficient computational (recursive) mechanism to estimate the state of a process. The filter is powerful because it involves estimations of past, present, and even future states. Kalman filter involves these elements with the use of knowledge of the system and measurement device, the statistical description of the system noises and any available information about initial conditions of the variables of interest [19].

To begin, we must remember that the basic idea of the Kalman Filter is, under a set of assumptions, it will be possible, given a history of measurements of a system, construct a model for the state of the System that maximizes the a posteriori probability of previous measurements. We can maximize *a posteriori* probability without having a long history of measurements above. Instead, we can iteratively update our state model of a system and maintain only that model for the next iteration [16]. These iterations are formed mainly by processes of predic-

Before explaining the process used, we must remember that Kalman Filter is based on three

In other words, the first assumption means that the state of the system at time *t* can be modeled as a matrix multiplied by the state at time *t* − 1. That is good because linear systems are more easily manipulated and practical than nonlinear. The additional assumptions that the noise is white and Gaussian means that the noise is not correlated over time and that its amplitude can be accurately modeled using a mean and a covariance (i.e., noise is fully

Below, a brief explanation of how the Kalman Filter is used to predict new apparent size measurements of the obstacle to avoid will be given. We emphasize that we do not model the TTC as such, but we model the behavior of the apparent size of the projected obstacle on the image

measuring device inaccuracies (such as changes of light intensity or non-smooth floor mentioned above), the result of the measurements is somewhat uncertain. Then, we decide that the

1

, that is, we have the probability that *θ* has a value, based upon the

. However, because of inherent

(only one variable). Thus, we can

and the variance *σ*ˆ *<sup>θ</sup>*<sup>1</sup>

<sup>2</sup> <sup>=</sup> *σθ*<sup>1</sup> 2 .

, conditioned on the observed value

, we determine the apparent size *θ* to be *θ*<sup>1</sup>

$$\mu = \mathcal{O}\_{12} = \left(\frac{\sigma\_{\theta\_i}^2}{\sigma\_{\theta\_i}^2 + \sigma\_{\theta\_i}^2}\right) \mathcal{O}\_1 + \left(\frac{\sigma\_{\theta\_i}^2}{\sigma\_{\theta\_i}^2 + \sigma\_{\theta\_i}^2}\right) \mathcal{O}\_2 \tag{6}$$

$$
\sigma\_{12}^2 = \frac{\sigma\_{\theta\_i}^2 \sigma\_{\theta\_i}^2}{\sigma\_{\theta\_i}^2 + \sigma\_{\theta\_i}^2} \tag{7}
$$

Now that we know how to obtain a next measure, we can continue with this process *N* times (*N* measurements). This is because we can combine the first two, then the third with the combination of the first two, the fourth with the combination of the first three, and so on [16]. This is what happens when we are tracking the *θ* over time, we obtain one measure followed by another followed by another.

Usually, Eq. (6) is rewritten as Eq. (8), and Eq. (7) as Eq. (9) because with this new forms, we can separate the old information from de new information. The new information (*θ*<sup>2</sup>  − *θ*<sup>1</sup> ) is called *innovation*

$$\widehat{\boldsymbol{\Theta}}\_{2} = \boldsymbol{\Theta}\_{1} + \frac{\sigma\_{\boldsymbol{\theta}\_{i}}^{2}}{\sigma\_{\boldsymbol{\theta}\_{i}}^{2} + \sigma\_{\boldsymbol{\theta}\_{i}}^{2}} \left\{ \boldsymbol{\Theta}\_{2} - \boldsymbol{\Theta}\_{1} \right\} \tag{8}$$

$$\widehat{\sigma\_2^2} = \left(1 - \frac{\sigma\_{\theta\_i}^2}{\sigma\_{\theta\_i}^2 + \sigma\_{\theta\_i}^2}\right) \sigma\_{\theta\_i}^2 \tag{9}$$

Finally, Eq. (10) shows our optimal iterative update factor, which is known as the *update gain K*, and so, we obtain the recursive form described in Eqs. (11) and (12). For a more detailed explanation, we suggest to the reader have a look in [19]

$$K = \frac{\sigma\_{\theta\_i}^2}{\sigma\_{\theta\_i}^2 + \sigma\_{\theta\_i}^2} \tag{10}$$

$$
\widehat{\Theta\_2} = \Theta\_1 + K(\Theta\_2 - \Theta\_1) \tag{11}
$$

$$
\widehat{\sigma\_{\theta\_i}^2} = \left(\mathbf{1} - \mathbf{K} \right) \sigma\_{\theta\_i}^2 \tag{12}
$$

Finally, once the behavior has been modeled, it will be possible to forecast TTC by Eq. (2).

**4. Experiments and results**

objects in the robot environment.

In order to test our proposal, we design experiments in which a robot approaches two obstacles mentioned in the segmentation section (see **Figure 3**) at constant velocity and we took 210 frames (equivalent to 7 s) of these real scenarios. A camera was used as a sensor to locate the

Predicting Collisions in Mobile Robot Navigation by Kalman Filter

http://dx.doi.org/10.5772/intechopen.71653

161

**Figure 7** shows the robot used for the experiments. In **Figures 8** and **9**, the results of the filtering process are shown for the experiments with the red cylinder and green sphere, respectively. For both figures, (a) shows blue, the measurements obtained by the sensor (specifically by the process of segmentation by color in each image). As can be seen, growth of the *θ* (obtained by the camera) over time is not "smooth," due to various factors in the environment mentioned above. (b) Indicates red color, the Kalman filtering on the measurements, where it can be seen that they are very close. (c) Shows, for each case, a window of the results where there is greater error in the measurements, which leads to have errors in the prediction but it getting closer to the measurements. (d) Shows an expansion at the beginning of (b), where

**Figure 9.** Results of experiments of scenario 2 with a green sphere. (a) Measurements. (b) Filtered data. (c) Window

example, where there is greater variation. (d) Initial convergence process.

**Figure 7.** Robot based on Raspberry pi used for experiments.

**Figure 8.** Results of experiments of scenario 1 with a red cylinder. (a) Measurements. (b) Filtered data. (c) Window example, where there is greater variation. (d) Initial convergence process.

### **4. Experiments and results**

**Figure 7.** Robot based on Raspberry pi used for experiments.

160 Kalman Filters - Theory for Advanced Applications

**Figure 8.** Results of experiments of scenario 1 with a red cylinder. (a) Measurements. (b) Filtered data. (c) Window

example, where there is greater variation. (d) Initial convergence process.

In order to test our proposal, we design experiments in which a robot approaches two obstacles mentioned in the segmentation section (see **Figure 3**) at constant velocity and we took 210 frames (equivalent to 7 s) of these real scenarios. A camera was used as a sensor to locate the objects in the robot environment.

**Figure 7** shows the robot used for the experiments. In **Figures 8** and **9**, the results of the filtering process are shown for the experiments with the red cylinder and green sphere, respectively. For both figures, (a) shows blue, the measurements obtained by the sensor (specifically by the process of segmentation by color in each image). As can be seen, growth of the *θ* (obtained by the camera) over time is not "smooth," due to various factors in the environment mentioned above. (b) Indicates red color, the Kalman filtering on the measurements, where it can be seen that they are very close. (c) Shows, for each case, a window of the results where there is greater error in the measurements, which leads to have errors in the prediction but it getting closer to the measurements. (d) Shows an expansion at the beginning of (b), where

**Figure 9.** Results of experiments of scenario 2 with a green sphere. (a) Measurements. (b) Filtered data. (c) Window example, where there is greater variation. (d) Initial convergence process.

it can be seen that in both cases it takes little less than 10 frames (about 0.3 s) to converge to obtain estimates close to the measurements.

[3] Vaščák J, Hvizdoš J. Vehicle navigation by fuzzy cognitive maps using sonar and RFID technologies. In: 14th International Symposium on Applied Machine Intelligence and Informatics (SAMI); January 21-23, 2016; Herlany, Slovakia. IEEE; 2016. DOI: 10.1109/

Predicting Collisions in Mobile Robot Navigation by Kalman Filter

http://dx.doi.org/10.5772/intechopen.71653

163

[4] Stefan KG, Felix E, Thomas M. A real-time low-power stereo vision engine using semi-global matching. In: Mario Fritz, Bernt Schiele and Justus H. Piater, editors. In: 7th International Conference on Computer Vision Systems; October 13-15, 2009; Liege, Belgium. Springer, Berlin, Heidelberg; 2009. p.134-143. DOI: 10.1007/978-3-642-04667-4\_14

[5] Muffert M, Milbich T, Pfeiffer D, Franke U. May I enter the roundabout? A time-to-contact computation based on stereo-vision. In: Intelligent Vehicles Symposium (IV) 2012; June 3-7, 2012; Alcala de Henares, Spain. IEEE; 2012. pp. 565-570. DOI: 10.1109/IVS.2012.6232178

[6] Benamar F, El Fkihi S, Demonceaux C, Mouaddib E, Aboutajdine D. Gradient-based time to contact on paracatadioptric camera. In: IEEE International Conference on Image Processing, ICIP'2013; September 15-18, 2013; Melbourne, Australia. IEEE; 2013. pp. 5-9.

[7] Alenya G, Negre A, Crowly JL. Time to Contact for Obstacle Avoidance. In: Proceedings of the 4th European Conference on Mobile Robots (ECMR) 09; September 23-25, 2009;

[8] Izumi S, Yamaguchi T. Time-to-contact estimation on the scaled-matching of power spectra. In: SICE, 2007 Annual Conference; September 17-20, 2007; Takamatsu, Japan.

[9] McCarthy C, Barnes N, Mahony R.A robust docking strategy for a mobile robot using flow field divergence. IEEE Transactions on Robotics. 2008;**24**(4). DOI: 10.1109/TRO.2008.926871

[10] McCarthy C, Barnes N. A unified strategy for landing and docking using spherical flow divergence. IEEE Transactions on Pattern Analysis and Machine Intelligence.

[11] Horn BKP, Fang Y, Masaki I. Hierarchical framework for direct gradient-based time-tocontact estimation. In: IEEE Intelligent Vehicles Symposium, 2009; June 3-5, 2009; Xian,

[12] Horn BKP, Fang Y, Masaki I. Time to contact relative to a planar surface. In: IEEE Intelligent Vehicles Symposium, 2007; June 13-15, 2007, Istanbul, Turkey. IEEE. 2007.

[13] Kaneta Y, Hagisaka Y, Ito K. Determination of time to contact and application to timing control of mobile robot. In: IEEE International Conference on Robotics and Biomimetics (ROBIO), 2010; December 14-18, 2010; Tianjin, China. IEEE; 2010. pp. 161-166. DOI: 10.1109/

[14] Sanchez A, Rios H, Marin A, Verdin K, Contreras G. Estimation of time-to-contact from Tau-margin and statistical analysis of behavior. In: International Conference on Systems,

IEEE; 2008. pp. 2885-2889. DOI: 10.1109/SICE.2007.4421482

China. IEEE; 2009. pp. 1394-1400. DOI: 10.1109/IVS.2009.5164489

2012;**34**(5):1024-1031. DOI: 10.1109/TPAMI.2012.27

pp. 68-74. DOI: 10.1109/IVS.2007.4290093

ROBIO.2010.5723320

SAMI.2016.7422985

DOI: 10.1109/ICIP.2013.6738002

Dubrovnik, Croatia. 2009. pp. 19-24

### **5. Conclusions and future work**

In this chapter, an approach for estimating possible collisions was presented. A brief description of different approaches used to address the TTC problem was analyzed. Taking into account the advantages and disadvantages of these approaches, we present a way to handle the problem by modeling the behavior of the apparent size of the segmented obstacles, which the robot senses in each frame. This apparent size calculation is formally described and used to obtain measures of obstacles. We also apply Kalman filtering as a mechanism to model and predict *θ*, which will ultimately serve to predict the TTC and therefore avoid collisions. Some features of the Kalman Filter are also highlighted and we describe how it does the estimation for our problem. Finally, our approach is applied to two real cases where the modeling process is observed and the proximity to the measures taken, reducing noise of the measurements. This approach is gaining strength because it is easier to predict (given some measures taken previously) than to be looking for obstacles in each frame. In addition, the Kalman filter will correct errors if measures are incorporated sometimes. As future work, we will continue working on several scenarios and comparing this approach with some others, such as modeling and predicting using system identification techniques or time series.

### **Author details**

Angel Sánchez1 \*, Homero Ríos1 , Gustavo Quintana2 and Antonio Marín1


### **References**


[3] Vaščák J, Hvizdoš J. Vehicle navigation by fuzzy cognitive maps using sonar and RFID technologies. In: 14th International Symposium on Applied Machine Intelligence and Informatics (SAMI); January 21-23, 2016; Herlany, Slovakia. IEEE; 2016. DOI: 10.1109/ SAMI.2016.7422985

it can be seen that in both cases it takes little less than 10 frames (about 0.3 s) to converge to

In this chapter, an approach for estimating possible collisions was presented. A brief description of different approaches used to address the TTC problem was analyzed. Taking into account the advantages and disadvantages of these approaches, we present a way to handle the problem by modeling the behavior of the apparent size of the segmented obstacles, which the robot senses in each frame. This apparent size calculation is formally described and used to obtain measures of obstacles. We also apply Kalman filtering as a mechanism to model and predict *θ*, which will ultimately serve to predict the TTC and therefore avoid collisions. Some features of the Kalman Filter are also highlighted and we describe how it does the estimation for our problem. Finally, our approach is applied to two real cases where the modeling process is observed and the proximity to the measures taken, reducing noise of the measurements. This approach is gaining strength because it is easier to predict (given some measures taken previously) than to be looking for obstacles in each frame. In addition, the Kalman filter will correct errors if measures are incorporated sometimes. As future work, we will continue working on several scenarios and comparing this approach with some others, such as modeling and predicting using system identification techniques

, Gustavo Quintana2

[1] Lee DNA. Theory of visual control of braking based on information about time-to-collision.

[2] Byoung-Kyun S, Jun-Seok Y, Eok-Gon K, Yang-Keun J, Jong Bum W, Sung-Hyun H. A travelling control of mobile robot based on sonar sensors. In: 15th International Conference of Control, Automation and Systems (ICCAS); October 13-16, 2015; Busan, South Korea.

1 Research Center of Artificial Intelligence, University of Veracruz, Mexico

and Antonio Marín1

obtain estimates close to the measurements.

**5. Conclusions and future work**

162 Kalman Filters - Theory for Advanced Applications

or time series.

**Author details**

Angel Sánchez1

**References**

\*, Homero Ríos1

\*Address all correspondence to: angelsg89@hotmail.com

2 ELEC Department, Vrije Universiteit Brussel, Belgium

Perception. 1976;**5**(4):1005020. DOI: 10.1068/p050437

IEEE; 2015. pp. 13-16. DOI: 10.1109/ICCAS.2015.7364821


Signals and Image Processing (IWSSIP), 2016; May 23-25, 2016; Bratislava, Slovakia. IEEE; 2016. pp. 1-6. DOI: 10.1109/IWSSIP.2016.7502702

**Chapter 9**

Provisional chapter

**Efficient Matrix-Free Ensemble Kalman Filter**

DOI: 10.5772/intechopen.72465

**Implementations: Accounting for Localization**

Efficient Matrix-Free Ensemble Kalman Filter

Implementations: Accounting for Localization

This chapter discusses efficient and practical matrix-free implementations of the ensemble Kalman filter (EnKF) in order to account for localization during the assimilation of observations. In the EnKF context, an ensemble of model realizations is utilized in order to estimate the moments of its underlying error distribution. Since ensemble members come at high computational costs (owing to current operational model resolutions) ensemble sizes are constrained by the hundreds while, typically, their error distributions range in the order of millions. This induces spurious correlations in estimates of prior error correlations when these are approximated via the ensemble covariance matrix. Localization methods are commonly utilized in order to counteract this effect. EnKF implementations in this context are based on a modified Cholesky decomposition. Different flavours of Choleskybased filters are discussed in this chapter. Furthermore, the computational effort in all formulations is linear with regard to model resolutions. Experimental tests are performed making use of the Lorenz 96 model. The results reveal that, in terms of root-mean-square-

Elias David Niño Ruiz, Rolando Beltrán Arrieta and

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

errors, all formulations perform equivalently.

Keywords: ensemble Kalman filter, modified Cholesky decomposition,

The ensemble Kalman filter (EnKF) is a sequential Monte Carlo method for parameter and state estimation in highly nonlinear models. The popularity of the EnKF owes to its simple

> © The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Elias David Niño Ruiz, Rolando Beltrán Arrieta

Alfonso Manuel Mancilla Herrera

and Alfonso Manuel Mancilla Herrera

http://dx.doi.org/10.5772/intechopen.72465

Abstract

sampling methods

1. Introduction

