The Usage of Time Series Control Charts for Financial Process Analysis

We will deal with financial proceedings of the company using methods of SPC (Statistical Process Control), specifically through time series control charts. The paper will outline the intersection of two disciplines which are econometrics and statistical process control. The theoretical part will discuss the methodology of time series control charts and in the research part there will be this methodology demonstrated in three case studies. The first study will focus on the regulation of simulated financial flows for a company by CUSUM control chart. The second study will involve the regulation of financial flows for a heteroskedastic financial process by EWMA control chart. The last case study of our paper will be devoted to applications of ARIMA, EWMA and CUSUM control charts in the financial data that are sensitive to the mean shifting while calculating the autocorrelation in the data. In this paper, we highlight the versatility of control charts not only in manufacturing but also in managing the financial stability of cash flows.


INTRODUCTION
Traditional SPC schemes can be applied to monitoring the residuals.Subsequent work on this problem can be broadly classified into two themes; those based on time series models and those which are model-free.For the former, three general approaches have been proposed: those which monitor residuals, those based on direct observations, and those based on new statistics.A brief account of these approaches is presented in this chapter.The time series model based approach is easy to understand and effective in some situations.However, it requires identification of an appropriate time series model from a set of initial in-control data.In practice, it may not be easy to establish and may appear to be too complicated to practicing engineers.Hence, the model-free approach has recently attracted much attention.The most popular model-free approach is to form a multivariate statistic from the autocorrelated univariate process, and then monitor it with the corresponding multivariate control chart.(Krieger et al., 1992) used a multivariate CUSUM scheme.(Apley and Tsung, 2002) adapted the T 2 control chart for monitoring univariate autocorrelated process.(Atienza et al., 1997) proposed a Multivariate boxplot-T 2 control chart.(Dyer et al., 2003) adapted the use of the multivariate EWMA control chart for autocorrelated processes.Statistical financial flow proceeding means the cash flow management in company.We can avoid possible loss by the cash flow monitoring.This loss can be caused by nondelivery goods, bad financial investment, etc. Financial analysis should be done once a year.For our example, we will introduce regulation of simulated financial flows for a company by CUSUM control chart (see Case Study No 1).In other example, we will describe EWMA control chart using also monthly values (see Case Study No 2).The end of this paper will be dedicated to the ARIMA, EWMA and CUSUM control charts together with some practical example of autocorrelated data (see Case Study No 3).

CUSUM -Chart for Individual Values and for Samples Means from Normally Distributed Data
Values of x i are independent with the same normal distribution N(µ,σ 2 ) with the known population mean and with the known population standard deviation σ.We assume logical subgroups with the same volume n.Cumulative sum -CUSUM C n is defined for individual values (n = 1) as: A) on a base of original scale: (1) ) on a base of normal distribution where the mean = 0 and the standard deviation = 1: The CUSUM C n is almost the same as CUSUM S n measured in the units of standard deviation σ.Equation for C n can be written recurrently (Chandra, 2001): C 0 = 0, C n = C n-1 + (x n -µ); and with the same pronciple for S n : S 0 = 0, S n = S n-1 + U n .
Suppose that the original distribution of observed variable N(µ,σ 2 ) changes into N(µ+δ,σ 2 ) distribution for integer t (at certain moment).It means that the population mean µ will face a certain shift of δ.It also means that the shift starts at point (m, C m ) and it grows linearly with the slope δ.
But the population means shift can be more complicated.The CUSUM control chart can reflect all these changes (Harris and Ross, 1991).

CUSUM for Sample Means
We have considered mainly the individual values until now.Now, we will consider subgroups with m observations and we calculate the sample means from this subgroups.We have to work with the sample mean standard deviation . A shift of mean Δ will not be measured in the units of σ but in the units of σ x in this case.We will substitute the individual values of x i with the sample means j x and the process standard deviation σ with the sample mean standard deviation σ x in above mentioned formulas.(Lu and Reynolds, 1999)

New Process Mean Estimate
If there is a shift we can estimate a new process mean from the next formula: (3) where N + and N -is a number of selected points from a moment (Chambers and Wheeler, 1992), when C n + = 0, resp.when C n -= 0. This example shows practically sensitivity of the CUSUM control chart in comparison with the Shewhart´s control chart for the sample means.The CUSUM control chart detects process mean deviation towards the lower values (around the subgroup 20 -see Figure 1) while the Shewhart´s control chart does not detect this deviation (Harris and Ross, 1991).It does not detect a shift towards the upper values (around the subgroup 56).It only detects a big shift around the subgroup 70 (see both Figures 1 and 2) (Lu and Reynolds, 1999).

Dynamic Control Chart EWMA
Dynamic control charts EWMA (Exponentially Weighted Moving Average) are used when the following conditions are fulfilled: are not independent, with positive autocorrelation mean is not constant, its changes are slow (Montgomery and Friedman, 1989) A sudden change in mean will only cause a control limits crossing.These dynamic charts provide not only the information about "in control" process but also about the process dynamic development.As we mentioned, we consider only data which are not independent with positive autocorrelation.We will explain it now.If the measured observations are influenced by the previous ones we can say that they are dependent.A special case of this dependence is so called autocorrelation of 1 st degree when this dependence is linear.If there is a positive autocorrelation in data then the smaller value follows after the smaller value and the higher value follows after the higher value.Data have tendency to preserve their original values.Process is not stable in a case of negative autocorrelation.If there is a negative autocorrelation in data then the higher value follows after the smaller value and the smaller value follows after the higher value.Suppose that we measure values x 1 , x 2 , x 3 , ... for the variable X in the process.Parameter λ (level of "forgetting") is calculated by trying where the function is minimal.Number n is equal to number of measured values of regulated variable.It is recommended that n is greater than 50.If the error values of one-step prediction of e k for the optimal value of parameter λ are not correlated and if they have a normal distribution then the center line CL k , control limits UCL k and LCL k for the dynamic control chart EWMA are calculated from the following formulas (Lu and Reynolds, 1999): where is a standard deviation of e k estimate, while e k values are determined for the optimal value of parameter λ (Yourstone and Montgomery, 1991).

ARIMA Control Chart
Classical Shewhart SPC concept assumes that the measured data are not autocorrelated.Even very low degree of autocorrelation data causes failure of classical Shewhart control charts.Failure has a form of a large number of points outside the regulatory limits in control diagram.This phenomenon is not unique in the case of continuous processes, where the autocorrelation data given by the inertia processes in time (chemical processes, climate processes etc.).Autocorrelation of data becomes increasingly frequent phenomenon in terms of discrete processes, in particular manufacturing processes with short production cycles, high speed production with a high degree of automation of production and also in test and control operations.In these conditions, it is possible to obtain data about each product, with the consequence that the time between measurements (recording) of two consecutive values of the monitored variables is very short.One of the ways to tackle autocorrelated data is the concept of stochastic modeling of time series using autoregressive integrated moving average models, the ARIMA model.The concept of linear stochastic autoregressive models (models AR), moving average (model MA), mixed models (the ARMA models), and ARIMA models, based on Box-Jenkins methodology is seen as a time series realization of stochastic process.Box-Jenkins methodology represents a modern concept analysis of stationary and nonstationary time series based on probability theory.Linear models AR, ARMA and MA are modeling tool for the stationary processes.These models have a characteristic shape of the autocorrelation fiction (Autocorrelation Fuction -ACF) and partial autocorrelation function (Partial Autocorrelation Function -PACF), which are an essential tools for providing information about the stochastic process.ACF and PACF estimates are used to identify the time series model.There are non-stationary processes in practice very often.Nonstationarity can be present due to the mean value changing over time or process variance changing over time.If, after the transformation of nonstationary process variance of "random walk" (so-called integrated process) using differential d-th order is the final process model to describe the stationary ARMA (p, q), the original integrated process is called an autoregressive integrated moving average process of order p, d, q, ie ARIMA (p, d, q) (Noskievičová, 2008).ARIMA control chart (Autoregresive Integrated Moving Average) is based on the principle of finding a suitable time series model and the use of control chart for residuals the model (deviations from the values actually measured values from calculated values with the model use).The general shape of the model ARIMA (p, d, q) is such (4) where is autoregressive polynomial of p-th order, is moving averages polynomial of q-th order, (grad) operator backward difference (this element is introduced when the model exhibits non-stationarity of the process), d difference order, t time, B back shift operator B • x t = (x t-1 ), ø 1 , ø 2 ,....., ø p parameters of autoregressive model, θ 1 , θ 2 ,..., θ q parameters of moving averages model, ε t this variable is called white noise, which is unpredictable fluctuations in the data, has a normal distribution with mean equal to zero and constant variance, and its values are uncorrelated.If est x t is an estimate of empirical value of x t calculated with help of right chosen ARIMA model, residuals of this model will be uncorrelated normally distributed random variables.Most commonly used in applications are ARIMA models.Let us consider the model where ξ a φ (-1 < ø <1) are unknown constants and εt is normally distributed and uncorrelated variable with the mean equal to zero and the constant standard deviation σ.This model is called autoregressive model of the first order and is denoted as AR(1).The values of the reference mark of quality, which are mutually shifted of k time periods (x t and x t-k ) have the correlation coefficient ø k .This means that autocorrelation function ACF should fall exponentially.If we expand the previous equation in the form we get equation of second order autoregressive model AR(2).Generally, variable xt is directly dependent on the values preceding x t-1 , x t-2 , etc. in the autoregressive model AR (p).If we model the dependence of data using the random component εt, then we get moving average model MA (q).Moving average model first order has an equation: .
(7) There is some correlation only between two values x t and x t-1 .It can be described as follows: p 1 = -θ |(1+ θ 2 ) .This corresponds to the shape of the autocorrelation function ACF (Noskievičková, 2008).For the modeling of practical problems is often suitable a model compound containing both an autoregressive component and the moving averages component.This model is generally known as ARMA (p, q) (Hušek, 2007).Model ARMA of the first order, i.e.ARMA (1, 1) is described by the equation: x t = ξ+ øx t-1 + ε t -θε t-1 (8) This model is often suitable for chemical and other continuous processes, where many quality characteristics can be easily modeled by the model AR (1).Measurement errors are described by random component of the model, which we assume to be random and uncorrelated.The ARMA model assumes stationarity process i.e., that the character quality reference values are around a stable mean.But often, in practice there are processes (e.g. in the chemical industry), where the values of monitored variable are "running away".Then it is convenient to model processes using appropriate model with the operator of backward difference grad, such as the ARIMA model (0, 1, 1), the equation is To increase the sensitivity of control charts ARIMA is recommended to use two-sided CUSUM control chart with the decision interval ±H or standard EWMA chart, both applied to the residuals of the model.If we pursue more quality characteristics simultaneously on a single product to multiple, we can apply to ARIMA models residuals Hotelling chart or CUSUM or EWMA charts for more variables (Noskievičová, 2008).

RESEARCh mEThOD CONDUCTED
As the title of the paper explains, the primary method used for achieving the goals is the case studies research.The purpose of these studies is to illustrate how time series charts are found to be sensitive in detecting small shifts and we will utilize the fact that these control charts can be used in certain situations where the data are autocorrelated.The methodology combined quantitative data analysis with financial process simulation, which benefits the reliability of the conclusions.The CUSUM chart shows that the process is out of control (see Figure 3).Following steps are to find the main cause (-s), accept precaution (-s) and to start a new CUSUM again.If the process was adjusted it could be useful to estimate mean of the process caused by the shift.

Case Study No 2 -A Use of Control Chart EWMA
We have following financial data of a certain company (in millions of CZK).The starting value of x is 5.00.Now, we construct a control chart for data from the Tab. 1.
Tab. 1 -Entering Data for Control Chart EWMA.Source: Own Processing It is evident from the Figure 4 that the values of the process are declining -therefore there is not a constant process mean.Further, we find out if there is an autocorrelation of the 1 st degree in the process.We construct a correlation chart between the x k and x k+1 values for k = 1, 2, 3, ..., 49 (see Figure 5).

Fig. 5 -Correlation chart between the x k and x k+1 values (scatterplot). Source: QC Expert 2.5Cz
We can see from the Figure 5 now that the scatterplot is ellipse-shaped and that the ellipse main axis forms an acute angle with the x-axis.We can conclude from this exploratory data analysis that there is a significant first degree positive autocorrelation between the variables x k and x k+1 .
We calculate exact coefficient of autocorrelation between the variables x k and x k+1 .It is equal to 0.850.Thus, the strong (statistically significant) positive autocorrelation exists between the variables xk and x k+1 .Therefore we can construct the EWMA dynamic control chart.Further, we will compute predicted values for the empirically chosen values of the parameter λ from the interval <0;1>.A starting value was set to the number μ0 = 5.00.We determine the value of function (the sum of error squares) for chosen parameter λ at the same time.The calculation of the parameter λ = 0.48 is shown in Table 2.This value was found as optimal.Function S(λ) is evidently parabolic with one extreme (minimum).The Table 2 shows computing of the optimal λ parameter value.The values of λ can be found in the first and the third columns and the values of S(λ) function in the second and the fourth columns.The values of S(λ) function for 0.4, 0.5,and 0.6 are given in the first two columns of the Table 2.We can see that the function minimum is between values 0.4 and 0.5.Therefore we try values of λ equal to 0.47, 0.48 and 0.49.According to the previous calculations, the function minimum S(λ) is equal to 0.48.The final EWMA control chart is displayed on the Figure 6 where lower and upper control limits are plotted with bold full black lines, center line is plotted with line of dashes.Input values of quality feature are represented by the bold dots.We can conclude from the analysis of the Figure 6 that the process is under control except of the 14 th value.Other values are between the control limits.The 14 th value crossing can be caused by the process nonstability or by the measurement inaccuracy.

Case Study No 3 -A Use of Control Charts ARIMA CUSUM and EWMA
We find a suitable model for the time series of annual gross domestic product of the United Kingdom which is available in the form of base indices from 1960 to 1997 (1995 = 100).We determine the control chart sensitive to a change of the mean based on this model.Financial data are in the following table.The time series is shown on the previous figure 7. It is obvious that the time series is nonstationary, which is also confirmed by the shape of the ACF and PACF (Fig. 8) and periodogram (Fig. 9)   5.Although residual ACF and PACF indicate that non-systematic component is a type of white noise, as well as the value of "P-value" of the Box-Pierce test is relatively high (0,597248), we will also estimate the model ARIMA(0,1,1) c .The Table 5 contains its results.
Tab. 5 -Output   Forecasts are shown in Figure 15 and a time series plot with smoothed values and predictions is shown in Figure 16.From those control charts (Figure 17) can be seen that the process can be regarded as if it is statistically stable (no point is outside the control limits), so these limits can be used to verify the statistical stability of the process in the next period.The CUSUM control chart shows that the V-mask identifies the beginning of increasing heteroscedasticity in point 23, which corresponds to a year 1982 (Figure 18).Previous control charts show the same changing point in the volatility of the time series and due to increasing heteroscedasticity indicate a growing trend of time series.

DISCUSSION
Most traditional control charting procedures are grounded on the assumption that the process observations being monitored are independent and identically distributed.With the advent of high-speed data collection schemes, the assumption of independence is usually violated.That is, autocorrelation among measurements becomes an inherent characteristic of a stable process.This autocorrelation causes significant deterioration in control charting performance.To address this problem, several approaches for handling autocorrelated processes have been proposed.The most popular procedure utilizes either a Shewhart, CUSUM or EWMA chart of the residuals of the appropriately fitted ARMA model.However, procedures of this type possess poor sensitivity especially when dealing with positively autocorrelated processes.As an alternative, we have explored the application of the statistics used in a time series procedure for detecting outliers and level shifts in process monitoring.The study focused on the detection of level shifts of autocorrelated processes with particular emphasis on the important AR(1) model.The results presented showed that time series charts are found to be sensitive in detecting small shifts and we utilize the fact that these control charts can be used in certain situations where the data are autocorrelated.

CONClUSION
This paper dealt with the regulation charts applications in financial data.This kind of data is very sensitive to mean shifting and strong autocorrelation appears very often.Therefore we put a focus on dynamic regulation charts CUSUM, EWMA and ARIMA models.We highlighted the versatility of control charts not only in manufacturing but also in managing the financial stability of cash flows in this paper.A refined identification of the type of intervention affecting the process will allow users to effectively track the source of an out-of-control situation which is an important step in eliminating the special causes of variation.It is also important to note that the proposed procedure can also be applied when dealing with a more general autoregressive integrated moving average model.Autocorrelated process observations mainly arise under automated data collection schemes.Such collection schemes are typically controlled by software which can be upgraded to handle SPC functions.Under such an integrated scheme the usefulness of the proposed procedure will be optimized.Based on information from chapter 5, we would recommend a properly designed time series control charts as a control charts for individual measurements in a wide range of applications.These are almost a perfectly nonparametric (distribution-free) procedures.

Fig. 18 -
Fig. 18 -CUSUM Chart for Residuals.Source: Own Processing Models ARIMA are different from Shewhart model (x t +μ+ε 1 for t = 1, 2, …).However, if we put φ = 0 in the equation x t = ξ+ øx t-1 + ε t or θ=0 in the equation x t = μ+ ε t -θε t-1 we get Shewhart model process.Another important step in the use of ARIMA models is the choice of the appropriate SPC control chart.When residuals testing determined that they are not autocorrelated and come from a normal distribution it is possible with them to verify whether or not the process is statistically stable.Because number of observations equals one (original empirical values were detected by each unit) priority have control charts for individual values and moving range.

Table 6
, it is evident that both parameters are non-zero and the estimated model has the form (1-B)y t = 1.67905+(1-(0.569874)B)at , can be expressed as: y t = 1.67905+y t-1 +a t +0.569874a t-1 .