{'fraction_non_alphanumeric': 0.038101744797141054, 'fraction_numerical': 0.012875762034895943, 'mean_word_length': 4.491774891774892, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Steady state Kalman filter design for cases and deaths prediction of Covid-19 in Greece

In this work we study the applicability of the steady state Kalman filter in order to predict new cases and deaths of Covid-19. We use the actual observations of new cases and deaths. First, we deal with short term prediction, namely daily prediction. We propose the use of the golden steady state Kalman Filter, which is designed to have parameters related to the golden section. It was found that the proposed golden steady state Kalman Filter has a satisfactory behavior compared with the classical mean or average filter. Secondly, we deal with long term prediction, for example average prediction per quarantine period (14 days). We propose to process blocks of measurements of time window corresponding for example to the quarantine period in order to predict the average of cases and deaths using steady state Kalman Filter. It was found that the proposed golden steady state Kalman Filter produces more reliable predictions than the classical mean or average filter does. The use of steady state Kalman Filter for cases and deaths prediction of Covid-19 can be effective for resources and prevention measures planning.


Introduction
The ongoing pandemic of Covid-19 has driven researchers to direct their efforts towards the fight against the disease and the crisis management in health sector and border control. An important aspect in controlling the spread of Covid-19 and in resources and prevention measures planning, is the prediction of new cases and new deaths. Well established epidemiological models for long-term predictions, include variations of the Susceptible -Infectious -Recovered (SIR), such as the Susceptible -Infectious -Recovered -Dead (SIRD) [1] or the Susceptible -Exposed -Symptomatic infectious -Asymptomatic infectious -Quarantined -Hospitalized -Recovered cases -Dead (SESAQHRD) model, which focus on the basic reproduction number (R0), and the per day infection mortality and recovery rates [2]. The lack of a Covid-19 registry with traceable data obtained in a systematic manner and the lack of effective, well targeted or constant counter measures make the modeling of the Covid-19 outbreak a difficult task. Machine learning techniques have also been proposed [3], in order to face this difficulty. In [3], a moving average (MA) filter is used in order to forecast new daily cases and a Long Short Term Memory for Data Training-SAE (LSTM-SAE) network model was used to forecast the virus spreading. Time varying Kalman filters have been applied to daily predict new cases and deaths in [4]. An Autoregressive Integrated Moving Average (ARIMA) model is used in [5] to predict the epidemiological trend of the prevalence and incidence of Covid-19. Kalman Filter with the Autoregressive Integrated Moving Average (ARIMA) model is used in [6] to obtain forecasts of active cases, recoveries and deaths related to Covid-19 in Pakistan. Kalman Filters have also been proposed to estimate the future spread of Covid-19 [7] giving satisfactory results on short term estimates; their performance is poorer for long term forecasting.
The motivation of this work has been the development of tools for cases and deaths predictions, based on steady state Kalman Filter, that will allow the health system and authorities at the local or regional level to better prepare and manage the crisis. They may also be used in an early warning and emergency response system which collects ubiquitous data, such as smart city or smart building data, and combines it with historical statistical data and data collected at testing points (hospitals, borders).
The novelty of this work concerns (a) the design of a Finite Impulse Response (FIR) filter with coefficients related to the golden section (b) the design of a Steady State Kalman Filter with parameters related to the golden section, (c) the design of the FIR form of the Steady State Kalman Filter which does not require all the previous observations, (d) the applicability of the proposed filters in short term (daily) prediction as well as in long term prediction (quarantine period).
In Section "Short term daily prediction" we present the classical mean or average filter as well as the proposed golden steady state Kalman filter for short term prediction, namely daily cases and deaths prediction for Covid-19; we also present simulation results. In Section "Long term average prediction" we present the use of steady state Kalman filter for long term cases and deaths average prediction, for example average prediction per quarantine period (14 days); we also present simulation results. The conclusions are summarized in Section "Conclusions".

Short term daily prediction
The aim is to predict the Covid-19 new cases and deaths on a daily basis using previous observations (cases/deaths). Thus we need a measurement driven scalar model, where the measurement z(k) is the number of new cases or new deaths observed at time k and the state x(k) corresponds to the number of new cases and deaths at time k. Then the aim is to predict the number of new cases and deaths x(k +1/k) at time k +1 given the measurements till timek ≥ 0 , i.e. given the observations z(0), z(1), ⋯, z(k). The observations are assumed to be zero for negative time: z(k) = 0, k < 0. The prediction is the output of a filter, which has the observations in its input, as it is shown in Fig. 1. In the remaining of this section, we are going to design various filters, including Kalman filter.

Mean filter (MF) or average filter (AF)
The basic idea is that the prediction of daily cases/deaths can be computed as the mean (average) of previous observations. The prediction is the mean (average) of M last observations.
This is a Moving Average filter MA(M-1) with M equal coefficients: Note that The MA filter is a Finite Impulse Response (FIR) filter. M is the order of the MA filter.
We name the filter defined by (1) with coefficients in (2) as Mean Filter (MF) or Average Filter (AF) due to the fact that the prediction is the mean (average) of the M last observations. M = 7 (1 week), M = 14 (2 weeks -quarantine time), M = 21 (3 weeks) are proposed in this case.

Golden FIR filter (GFIR)
The basic idea is that the prediction of daily cases/deaths can be computed using weighted previous observations. The prediction is The sum of the weights is The idea is to use M last observations. Each observation will contribute to the prediction with weight a of the rest of the sum, where a is the golden section: which is the positive solution of the equation Then the weights are: The last weight results from the restriction that the sum of the weights equals to 1.
Hence the weights are related to the golden section and the coefficients of (4) are: The derived filter is also a Moving Average filter MA(M− 1) whose coefficients are: The contribution of the observations in the forecast decreases as the observations move away from the prediction time, in line with weights associated with the golden section.
This MA filter is a Finite Impulse Response (FIR) filter. We name the filter defined by (4) with coefficients in (8)

Golden steady state Kalman filter (GSSKF)
The basic idea is that the prediction of daily cases/deaths can be computed using steady state Kalman filter.
The general discrete time scalar linear model used to formulate the Kalman Filter (KF) consists of the dynamic and the statistical model. The dynamic model expresses the relationship between state and the measurement and is described by the following state space equations: for k = 0, 1, ⋯, with initial condition x(0), where x(k) is the state vector, z(k) is measurement vector, w(k) is the state noise and v(k) is the measurement noise at time k. The transition parameter F(k +1, k) describes the relation between two succeeded states. The output parameter H(k)describes the relation between the state and the measurement at the same time. Assuming that the state corresponds to the measurement, we get Assuming that the state does change very slowly from day to day, we consider that it does not change from step to step, so we get The statistical model describes the nature of state and measurements. The basic assumption is that a) the state noise is a zero mean Gaussian process with variance Q(k) and b) and the measurement noise is a zero mean Gaussian process with variance R(k). The following assumptions also hold: (a) the initial value of the state x(0) is a Gaussian random variable with mean x 0 and variance P 0 , (b) the noise stochastic processes and the random variable x(0) are independent.
The discrete time Kalman filter [8] is the most well-known algorithm that solves the filtering problem, producing the state estimation x(k/k) and the corresponding estimation error variance P(k/k) as well as the state prediction x(k +1/k) and the corresponding prediction error variance P(k + 1/k).
The state and measurement noise variances Q(k) and R(k) concern a time period before the prediction time. In fact, Q(k) is the variance of the difference of two succeeded observations and R(k) is the variance of the measurements for a time period before the prediction time. In [4] it was proposed that the noise variances can be computed on line for the time interval from the beginning till the prediction time or for a fixed backwards time interval before the prediction time. Then the noise variances are time varying and the Time Varying Kalman Filter is derived: for k = 0, 1, ⋯, with initial conditions x 0 = x(0/ − 1) and P 0 = P(0/ − 1) whereK(k)is the Kalman Filter gain.
A variation results assuming that the noise variances are constant, i. e. Q = Q(k) and R = R(k). The noise variances can be computed off-line for the time interval from the beginning of the disease till the beginning of producing predictions or for a fixed initial time interval determined by the previous pandemic wave. Then the noise variances are time invariant and the Time Invariant Kalman Filter is derived.
In the following, we propose a model with constant noise variances Q = R = 1. In this case, the Kalman Filter parameters are F = H = Q = R = 1 resulting in the random walk system.
Then the prediction is and the prediction error variance is The prediction error variance can be computed iteratively by the previous equation, known as the Riccati equation [9]. The Riccati equation can be written as: The prediction error variance tends to the steady state prediction error variance P [9] that satisfies the algebraic Riccati equation is: The algebraic Riccati equation can be written as: The positive solution is the steady state prediction error variance P: where a is the golden section in (6). Then, from (14) and (24) the steady state Kalman filter gain is Thus the steady state Kalman filter gain is K = a and is equal to the golden section.
Then the Steady State Kalman Filter is derived: for k = 0, 1, ⋯, with initial condition as derived by the equalities in (25) and (7). Thus, the Golden Steady State Kalman Filter (GSSKF) has been derived: for k = 0, 1, ⋯, with initial condition x 0 = x(0/ − 1). The parameters of this Steady State Kalman Filter are related to the golden section.
We are able to use zero initial condition x 0 = x(0/ − 1) = 0 or to use the last measurement before the prediction beginning as initial condi- This is an Autoregressive Moving Average filter ARMA(1,0) with coefficients: b 0 = a and a 1 = − a 2 We name the filter defined in (29) as Golden Steady State Kalman Filter (GSSKF) due to the fact that the prediction results from the implementation of a Steady State Kalman Filter with parameters related to the golden section.

Golden FIR steady state Kalman filter (GFIRSSKF)
The basic idea is that the prediction of daily cases/deaths can be computed using the FIR form of the steady state Kalman filter.
The FIR form of the Steady State Kalman Filter (SSKF) can be implemented when A < 1 [10]. Thus, the FIR form of the Golden Steady State Kalman Filter (GSSKF) can be implemented due to the fact that Without loss of generality, let x(0/ − 1) = 0. Then (1) x(3/2) = a 2 x(2/1) + az(2) = a 5 z(0) + a 3 z(1) + az (2) x Working as in [10], let then It is obvious that this pattern holds for k ≥ M. Recall that the observations are assumed to be zero for negative time; then this pattern holds for k ≥ 0. Thus, the FIR Steady State Kalman Filter (FIRSSKF) is derived: Note that GFIRSSKF differs from GFIR in the last coefficient. The FIR implementation of the Steady State Kalman Filter requires the knowledge of a subset of previous time measurements to calculate the state estimate; there is no need of any previous estimates calculation [10]. Thus, the basic advantage of the FIR implementation of the Steady State Kalman Filter is that there is no need of all the previous observations.

Simulation results
The results presented are based on the publicly available data for Greece.
The data used concern the new cases and the new deaths in Greece for the time interval from Feb 26, 2020 till June 14, 2020 [11].
The output of each filter (prediction) is corrected computing the ceiling of the prediction, in order to produce integer predictions (pessimistic scenario).  Table 1 presents the mean percent absolute error and the mean absolute error prediction for new cases in Greece using MF, GFIR, GFIRSSKF with M = 4, M = 7, M = 14, M = 21 and GSSKF. The mean absolute error is computed as the average of the absolute difference between observation and prediction. The mean percent average absolute error is computed as the absolute difference between the average observation and average prediction divided by the average observation and multiplied by 100. Table 2 presents the mean percent absolute error and the mean absolute error prediction for new deaths in Greece using MF, GFIR, GFIRSSKF with M = 4, M = 7, M = 14, M = 21 and GSSKF.

Long term average prediction
The basic idea is to process blocks of measurements of a time window corresponding for example to the quarantine period in order to predict the average of cases and deaths using steady state Kalman Filter. Then long term prediction is derived, in the sense of predicting the average of states. So, the cases/deaths prediction concerns the prediction at time moment equal to the middle of the time window, that can be selected to correspond to a week, or a quarantine period. The length of the time window is denoted by N, i.e. the average prediction is derived every N (forward) days, for example 7 days (1 week), 14 days (quarantine period).
Assume the time invariant model with parameters F = H = Q = R = 1. Then Let us now use the average values of the state and measurement variables for every N (forward) time instants, defining them respectively as: From (34) we get i.e. Then where and Using (41) and Q = 1 we have: where and v N (j) = 1 N Using (45) and R = 1 we have: Hence the parameters of the state space model (per time instant i for the average of time window of length N) are: F = H = 1,Q = N,R = 1.
Then the algebraic Riccati equation is: and it is written as: The positive solution is the steady state prediction error variance P: Then, the steady state Kalman filter gain is and Hence, the average prediction is We name the filter defined by (52) as Average Golden Steady State Kalman Filter (AGSSKF) due to the fact that the filter results from GSSKF used for daily prediction.
Note that average prediction is derived every N (forward) days and the steady state Kalman filter parameters depend on N. In the case where N = 1 (1 day) the AGSSKF is GSSKF. N = 7 (1 week), N = 14 (2 weeksquarantine time) can be used.
We define the average values of the measurement variables for every set of N measurements: Then the average prediction for the FIR filters MF, GFIR, GFIRSSKF is with coefficients defined in (2), (8)-(9) and (33) respectively.

Simulation results
The data used concern the new cases and the new deaths in Greece for the time interval from Mar 16, 2020 till Oct 11, 2020 [11]. The prediction period is of 210 days (i.e. 30 weeks or 15 quarantine periods).  Table 3 presents the mean absolute error prediction for new cases in Greece using MF, GFIR, GFIRSSKF with M = 7, M = 14, as well as AGSSKF with N = 1 (day), N = 7 (week) and N = 14 (quarantine period). Table 4 presents the mean absolute error prediction for new deaths in Greece using MF, GFIR, GFIRSSKF with M = 7, M = 14, as well as AGSSKF with N = 1 (day), N = 7 (week) and N = 14 (quarantine period).

Conclusions
The aim of this paper was to develop prediction filters in order to predict the cases and deaths of Covid-19 in a daily basis (short term prediction) or in a quarantine period basis (long term prediction).
Aiming the cases and deaths of Covid-19 daily predictions we have used a) the classical mean or average filter, b) the proposed Golden FIR filter (GFIR) with coefficients related to the golden section, c) the developed the Golden Steady State Kalman Filter (GSSKF) with parameters related to the golden section and d) the Golden FIR Steady State Kalman Filter (GFIRSSKF) with the advantage that is that there is no need of all the previous observations. The basic results are: Fig. 3. Daily prediction of new cases in Greece using MF and AGSSKF.
-prediction using MF becomes worse as M increases -prediction using SSKF becomes better as M increases; there is no prediction improvement after some M -the FIR form of the SSKF requires the knowledge only of a subset of previous time measurements to calculate estimate -cases prediction using SSKF is better than MA prediction of order M = 14 in Greece -the mean absolute error in Greece new deaths prediction is of the order of 1 death -It was found that the proposed golden steady state Kalman Filter has a satisfactory behavior compared with the classical mean or average filter Aiming the cases and deaths of Covid-19 average predictions we proposed to process blocks of measurements of time window corresponding for example to the quarantine period. We designed the Golden Steady State Kalman Filter (GSSKF) with parameters related to the golden section.
The basic results are: -cases and deaths average prediction using SSKF is better than MA prediction -MA prediction becomes worst as the time window increases -the mean absolute error in Greece new deaths average prediction is of the order of 1 death -the proposed golden steady state Kalman Filter produces more accurate predictions than the classical mean or average filter does Thus, the developed golden steady state Kalman Filter can be used in daily or average prediction producing reliable predictions. Hence, the use of steady state Kalman Filter for cases and deaths prediction of Covid-19 can be effective for resources and prevention measures planning.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.