Monitoring the Level and the Slope of the Corona

The corona is mightily upon us, with different governmental decisions having drastic consequences, but in unchartered territory. Which country is wiser, Norway or Sweden? Have Italy and Spain passed their peaks? Here we study the two crucial data series of (1) new registered covid-19 cases and (2) new covid-19 related deaths, day by day, country by country. Via log-linear modelling we build practical statistical monitoring tools for assessing both the level and the slope of these two corona processes.

Image may contain: Line, Text, Plot, Parallel, Font.

How life looks like, in 2020.

First-derivatives don't often make daily headlines, but these are strange times, and flattening of curves is on everybody's mind. In this blog post we build practical statistical monitoring tools for assessing the level and the slope of two corona-virus processes: the daily number of new registered cases of covid-19, and the daily number of covid-19 related deaths. Estimating first-derivatives comes, as with all statistical estimates, with uncertainty attached, and this blog post introduces nice uncertainty summaries regarding these how-steep-how-flat estimates.

A note of caution: We analyse the raw data as published by the European Centre for Disease Prevention and Control, and to what extent the two time series we use in this post are reflective of the unknown registered-plus-unregistered-covid-19-cases times series, we do not attempt to answer in this blog post.     

We're going to build statistical models for these series of 

$N_t$, number of new cases on day $t=0,1,2,\ldots$,

clearly with one model and assessment analysis for the first data series (new registered cases) and another for the second series (new deaths). For simplicity we refer to these as Type One and Type Two data, respectively.

The full dataset we've used for this FocuStat Blog Post story, for the seven countries Sweden, Norway, France, Italy, Germany, Spain, the USA, which we've put together via the website pointed to, can be found here, as a $54\times 14$ data matrix. It has both Type One and Type Two data, with the clock set to day zero at February 27, $t=0$, running onwards to April 20, $t=53$, which happens to be today, the date of us writing up this report.

This makes it possible for us to present analyses, assessments, and summary graphs of type Figure A, with more to come below. This figure presents first of all the raw data, for the case of Type One, for Norway and Sweden, over the time-window in question. It also shows estimated trend functions, which we come back to below. In addition to yielding well-fitted curves from well-working models, the modelling apparatus allows us to reach inferential statements, clear comparisons between different countries (the validity of which, of course, depends on the raw data being comparable between countries), and to produce at least valid shorter-term predictions, say for the coming two weeks.


Figure A: daily new registered cases, per 100,000, from February 27 to April 20, with Norway in red and Sweden in black. The dashed smooth curves are estimated trends from the fitted third-order log-linear model, and the vertical dashed blue line marks Friday March 13, where Norway decided to close down schools and universities and with yet further restrictions on travel and meetings.


Since we're interested in comparisons with several different countries we're also normalising the count data, taking population sizes into account; specifically, our count series, for both Type One and Type Two, are taken as per 100,000 people. Whether this is an adequate measure for comparing countries is not clear, and it can be argued that one ought to consider smaller geographical entities than countries, for example cities (Oslo and Finnmark might exhibit rather different corona behaviour). Our models and methods would work well also for such smaller entities, with modest modifications. At any rate, comparison on the per 100,000 scale for Sweden and Norway appears reasonable. 

At the time of writing this, 20 April, the corona processes have been taking their dramatic tours and tolls, in country after country, for some two months. In several countries the curves have managed to flatten out and even to display mild decrease, thanks to various drastic governmental interventions. So it might be a good time to assess both levels and slopes, for evaluation, the next level of planning, and nowcasting.

The data and a class of statistical models

We should state a couple of caveats up front – first, we're taking the Type One data on board as they are, in spite of certain issues. These registration data partly and unavoidably reflect the testing regimes, and there are certain error rates at work. The extent to which the registration data reflect the registered + unregistered data is unknown, and, to complicate matters, probably differs from country to country. 

The Type Two data are more drastically hard-core (a death is a death), but even with these there are debates regarding precisely what deaths are corona-decided and which might not be; see Kristiansen's editorial in (April 19).

At any rate, even though some of these issues might be worked with further, using more advanced statistical modelling on top of the directly observed data series, the first statistical ambition is to understand and analyse the data we have, which in this blog post translates to estimating and assessing levels and slopes of the Type One and Type Two data. Good models and methods for these tasks also open the door to nowcasting (short-term predictions) and also for comparisons between countries and their strategies.

It turns out that essentially similar models and methods work for both Type One and Type Two data, though obviously with different sets of parameters, estimates, prognoses, etc. But in a statistical methodology sense, work we carry out for modelling, handling, interpreting data of one type of $N_1,N_2,N_3,\ldots$ can be transferred and applied to the other type. This is not to be taken for granted in advance, but is among our findings. Also, data on new deaths this week (Type Two) relate by definition to data on registered cases a few weeks back (Type One).

Though various extensions, modifications, and sophistications are possible here, both regarding the models and how to analyse them, our basic class of models takes the log-counts as a polynomial trend over time plus additive noise. The third-degree version of this has

\(Y_t = \log N_t = \beta_0+\beta_1 x_t + \beta_2 x_t^2 + \beta_3 x_t^3 + \varepsilon_t, \)

for time points $x_t=t=0,1,2,\ldots$, with the $\varepsilon_t$ being zero-mean error terms. We think about

\(m(t)=\beta_0 + \beta_1 x_t+\beta_2 x_2^2 + \beta_3 x_t^3 \)

as the trend function, unfolding over time, typically with a drastic escalation from mid March before levelling off at mid April or some weeks later, before they are expected to point down again. We shall take special interest in the present level $m(t)$ and the present slope or derivative $m'(t)$, the latter a bit harder to assess well than the first.

The model thus described turns out to be a quite good one for the Type One data, even with the further statistical modelling simplification to take the error terms as independent with the same standard deviation, say $\sigma$. The degree 3 is arrived at via some model checking and model selection work, involving the AIC and the FIC.

Of course Type One and Type Two data are different, in many regards. The first prominent feature is that the death numbers, of course, are a significant factor smaller in size; as of April 20, there are some 2,333,000 diagnosed corona cases world-wide and some 161,000 corona-defined deaths. This amounts to corona deaths being about 6.9 percent of corona diagnosed cases.

This is luckily not to be interpreted as saying that 6.9 percent of corona cases lead to death; testing volume is increasing, also in the presumed healthy population. At the same time, medical treatment gets better, in many countries. A study in the Lancet estimates the mortality rate of the coronavirus to about 3 percent, and a similar number was reported by the WHO in early March. The seasonal flu, by comparison, has a death rate of about 1 percent. For how the Covid-19 virus compares to other causes of death, see this summary in the New Atlantis, April 13.

Secondly, the death count numbers display a bit more statistical irregularity than the numbers diagnosed. In statistical modelling terms we're sometimes led to 4th order trend models, not 3rd; the residual variance is less stable; and for some countries there's further autocorrelation present (these are statements concerning the data series as per April 20; matters may stabilise over the coming few weeks).

Part of the point in our brief story is that modelling, assessments, and the building of good monitoring tools is easier and clearer on the logarithmic scale than on the original count-scale of things. Monitoring which deviations from the trend are inside normal or not becomes a clearer statistical job, as does the estimation of both level and slope, as we see below.

To showcase our models and assessment methods we choose as primary illustration the comparison between the Kingdoms of Norway and Sweden, regarding both Type One and Type Two data. Our models are in the category of "not too complicated but quite effective" for their intended purposes, which is to monitor the level and the slope. As mentioned above we're also analysing similar data series for other countries, however, and comment briefly on this below.

The new cases data series

Consider the corona-registration Type One data, the actual daily wiggly official up-and-down counts, for Norway (red) and Sweden (black), plotted in Figure A above. The vertical dashed blue line marks the Day of Intervention for Norway, Friday March 13, where schools and universities were closed down, along with various other restrictions on travel, etc.

The dashed smoother lines, in both Figures A and B, are trend estimates coming from our log-linear statistical models, briefly described above. Indeed, on the log-scale of Figure B, the smooth trend functions is

\(\hat m(t)=\hat\beta_0+\hat\beta_1 x_t + \hat\beta_2 x_t^2 + \hat\beta_3 x_t^3,\)

which is brought back to original count-scale $\exp(\hat m(t))$ in Figure A.



Figure B: the same statistical information as with Figure A, but now presented on the log-scale, where it is easier to monitor and measure trends, deviations, and shifts. Norway's action day is again marked with the blue vertical line.


The variance level for the residuals has reached a reasonable equilibrium, see Figure C, and there is even approximate normality, though this is not particularly important for our analyses.

There are various somewhat sophisticated techniques for estimating these coefficients, including weighted log-likelihood procedures with more weight given to the more recent observations, but even a straightforward least sum of squares method will work well here.



Figure C: the residuals, from February 27 to April 20, for the Norwegian (red) and Swedish (black) Type One datasets, via the third-order log-linear model. The data series have reached a reasonable equilibrium, with the standard deviation level being stable. Also, the autocorrelation level is low.


The level and the acceleration

It's now time to focus. Two parameters of primary interest are the level and the slope, and these quantities need precise enough definitions so that we can start working with them inside our log-linear model. There are indeed different nuances and variations here, but at least a starting point is to take

\(\phi_A={1\over k}\sum_{t\in I_k} (\beta_0+\beta_1x_t+\beta_2x_t^2+\beta_3x_t^3)\)

for the level parameter, i.e. the model mean parameter averaged over the last $k$ timepoints. Somewhat more involved, but similarly, we may take

\(\phi_B={1\over k}\sum_{t\in I_k} (\beta_1 + 2\beta_2x_t+3\beta_3x_t^2)\)

as the operative slope parameter, the averaged derivative over the most recent timepoints. 

Having properly decided on precise focus parameters, we can go on to the technical business of estimating them, along with clear measures of uncertainty, so that relevant monitoring and testing can be carried out. We may check

  • whether the slope is bigger for Sweden than for Norway (it is, as of today, but it might change in three weeks time);
  • whether most of the European countries are roughly in the same boat (they're not);
  • the degree to which Norway on May 15 is different from Norway on April 15, etc.

In particular, for each focus parameter, from $\phi_A$ and $\phi_B$ here to others, we can construct clear confidence curves -- see Cunen and Hjort's FocuStat Blog post on that theme.

Without going into too much of the technical details here, we note that both $\phi_A$ and $\phi_B$ may be expressed as $\phi=w^{\rm t}\beta$, a linear combination of the four $\beta_j$ coefficients. This leads to estimator $\hat\phi=w^{\rm t}\hat\beta$, which is approximately normal (well, depending on our precise modelling assumptions) with a formula for its standard deviation $\tau$ and even for its full distribution. For several of these focus parameters all of this leads to confidence curves of the type

\({\rm cc}(\phi)=| 1-2\,G_{\rm df}((\phi-\hat\phi)/\hat\tau) |,\)

with $G_{\rm df}$ the cumulative distribution function for a $t$-distribution with ${\rm df}=n-4$ degrees of freedom, $n$ being the length of the time series under investigation.

The $\phi_A$ parameter is the current expected level of the $Y_t=\log N_t$ process, which also translates to current median level $\exp(\phi_A)$ on the cases-counting scale. The $\phi_B$ is the current slope, on the log-level, which means that


is the slope parameter on the counting scale. Confidence curves shown in Figures D and F are shown for this natural-scale acceleration parameter $\exp(\phi_B)$ rather than for $\phi_B$ on the log-scale. Countries where $\exp(\phi_B)$ is a bit above 1.00 must hope that it soon enough is pushed down below 1.00.

Norway and Sweden, the new cases data

In Figure D we show confidence curves for this acceleration like parameter $\phi_B^*=\exp(\phi_B)$, working on the original counting scale, for the Type One data, for Norway and Sweden, as of April 20. The acceleration estimates, on this scale, are 0.984 for Norway, indicating a downward trend, and 1.054 for Sweden, signalling a slight but not dramatic upper trend. Translated to estimates for tomorrow's numbers, this indicates that

\(N_{t+1}\doteq 0.984\,N_t {\rm\ for\ Norway,\ } \quad N_{t+1}\doteq 1.054\,N_t {\rm\ for\ Sweden}. \)

If the situation stays stable, for say a week, this translates further to estimated factors $1.054^7=1.445$ times today's level for Sweden and $0.984^7=0.893$ times today's level for Norway; these are exponential mechanisms at work.

Surely also worth pointing to is that the two countries are at roughly the same level, after all (when numbers are normalised according to population size, as we've done in Figures A and B). Confidence curves for the level $\phi_A$ (not displayed here) show that the current Swedish level is about $\exp(1.72)=5.81$, and the Norwegian considerably lower $\exp(0.66)=1.94$, on the scale of new daily corona cases per 100,000; see Figures A and B. The difference is significant, but might even out over the coming weeks and months.

It is relevant here to point out that the difference between acceleration numbers 0.984 and 1.054 for Norway and Sweden is not significant, as of April 20, see Figure D; using data from one week ago, however, the difference was clear and significant. So the corona processes are dynamic, and initial differences might be evening out in the longer marathon run of things.

So there are certain differences between Norway and Sweden, as portrayed in Figures A, B, D, but based on the raw data and our log-linear models they do not appear to be that big. Also, just one week of incoming new data, from April 13 to April 20, have made differences smaller (we've checked, using our models and methods). Whether the differences present can be attributed to the stricter measures imposed in Norway compared to in Sweden is a complicated question that we cannot answer with these data at the present time.

Also, the much harder question of the long term economic consequences of the differing strategies must be left for the thousands of Masters and PhD theses of statistics, economics, political science, epidemiology, etc. that surely will be produced in the coming years.

Figure D: confidence curves for the acceleration or slope parameters $\exp(\phi_B)$, for Norway (red) and Sweden (black), for the Type One new corona diagnosed cases data. For tomorrow, Sweden can expect 1.054 times today's number (5.4 percent more), whereas Norway can reckon with 0.984 times today's number (1.6 percent decrease). The difference between above 1.00 Sweden and below 1.00 Norway was significant a week ago, but has evened out, and is not significant as of April 20.


Death count statistics, for seven countries

For simplicity of presentation we limited attention above to the Type One data of counting new corona cases, comparing Norway and Sweden. As mentioned in the introduction, the same type of models and hence methods essentially work also for the hard-core Type Two data, counting corona-inflicted deaths day by day, country by country.

These data exhibit somewhat more irregular behaviour, however, calling in cases for a 4th order rather than a 3rd order polynomial trend function, and also for more carefully handling and modelling of standard deviation level, say $\sigma_t$ at time $t$, and with autocorrelation.

We do not have room here for showing and discussing full analyses from our models and methods, but we have indeed properly analysed Type One and Type Two data for the seven countries Sweden, Norway, France, Italy, Germany, Spain, the USA, from February 27 to April 20. Figure E shows one type of output from such modelling work, with actual log-counts per 100,000 along with fitted trend functions, here for Norway, Sweden, France, Italy. The fitted trends are reasonable, though with different levels of accuracy for different countries. Norway clearly has a lower death rate per population size. Intriguingly and positively, these four nations appear to have levelled out, regarding the death counts, and France and Italy in particular are on their ways downwards. Also Sweden is close to its envisaged peak, the flattened curve. More accurate information can be gleaned from our slope or acceleration analysis, below.

Figure E: log-count Type Two data, i.e. number of corona deaths, per 100,000, on a log-scale, for Norway (red), Sweden (black), France (green), Italy (blue). The irregular curves are the actual log-counts, with the smoother curves coming from our 4th order log-polynomial trend models.


For the more regular corona cases counting Type One, analysis similar to that displayed in Figure D, for the other five nations, show that the $\exp(\phi_B)$ parameters are not far from the stability value 1.00, with some nations just above 1.00 (like Sweden, an upward trend, still) and others just below (like Norway, the downward trend has started).

Also for the death counts Type Two data, these acceleration parameters are quite close to 1.00, as seen in Figure F. France and Italy are the current best in class (again, as of April 20), with cleary shaped descents (acceleration less than 1.00), whereas the other five countries, including Norway and Sweden, are close to stability. We see, however, that the Swedish acceleration parameter is far less certain than the Norwegian one, reflecting more variable up-and-down deaths data on the Swedish side.  

Figure F: confidence curves for the acceleration parameters $\phi_B^*=\exp(\phi_B)$, for the corona death Type Two data, for seven countries, as of April 20. The two to the left are France and Spain, with clear downward slopes, i.e. accelerations significantly lower than 1.00. The Norwegian and Swedish parameters are similar in size, actually close to the stability level 1.00, but the Swedish is currently more uncertain.

A few notes

A. Of course there is a big literature on time series which can be brought to use here. Most of the models and methods in that big field are however geared up for mostly stationary phenomena (if not stationary in the mean level, then perhaps stationary in the slope), whereas the dramatic corona data series currently unfolding in front of us display dynamic and nonstationary characteristics. It is in this spirit we've modelled these data series more or less from scratch. We trust the analysis tools we've constructed will be useful for the broader business of monitoring changes, estimating the near future, perhaps country by country.

Machinery from Cunen, Hjort, Nygård (2020) can be used for addressing the change points, or regime shifts, and measuring their impacts.

B. Our models and methods may also be used for so-called nowcasting, or shorter-term forecasting. We may e.g. carry out simulations for the number of new corona deaths over the coming three week, country by country, where the statistical machinery involves both the fitted models and the precision of the implied parameters. We do not know precisely how other statisticians in the corona field do this, like in the Jewell and Jewell articles from earlier in April, but we could attempt to match those in our later work.

C. It is difficult to predict, particularly about the future. Another difficult task, which is nevertheless tempting to work on, is the counterfactual one, the "what would have happened if" questions. How many US lives could have been saved, if the social distancing rules had been set in motion e.g. two weeks earlier? We refrain from analyses of this type at the moment (April 20), but the questions are valid, and our type of models can be used as playing and analysis ground.

D. Our statistical models and methods work well, as seen from various model diagnostics and model selection schemes. They could nevertheless be improved upon, with a more careful modelling of the typical shapes of the trend functions. Presumably theoretical or empirical studies would lead to parametrised versions $m(t,\theta)$. Such $m(t,\theta)$ could for example be informed by, perhaps even derived from, an underlying SIR-model or one of its more complex cousins. So in a sense we've just let the data speak for themselves, without reading theoretical papers about how the trend functions should look like under different sets of circumstances. With more efforts here we would also be able to sharpen tools of meta-analysis, how to analyse say a dozen countries jointly, as opposed to analysing each separately. The II-CC-FF setup for combining information across diverse sources should be useful here, see Cunen and Hjort (2020b).

E. From the tradition and viewpoints of classically oriented university-type statisticians it might be said, as a little meta-comment, that it is refreshingly unusual to work with contemporary data, even in the operative sense of finishing a report where the latest world-data to be put into our formulae and algorithms are from today. Hjort has worked with medieval literature from the 1460ies, war and conflict data from 1824 to 2003, fisheries time series from 1859 to 2014, and Olympic history from 1924 to 2018, so doing statistics on 20 April 2020 and writing up a full story on 20 April 2020 using data up to 20 April 2020 is a change of scale.


We appreciate comments from and ongoing discussions with Ingrid Glad, Baard Meidell Johannesen, and Sidsel Kreyberg.

A few references

Claeskens, G., Hjort, N.L. (2008). Model Selection and Model Averaging. Cambridge University Press, Cambridge.

Cunen, C., Hermansen, G.H., Hjort, N.L. (2018). Confidence distributions for change-points and regime shifts. Journal of Statistical Planning and Inference vol. 195, 14-34.

Cunen, C., Hjort, N.L. (2020a). Confidence Curves for Dummies. FocuStat Blog Post, April 2020.

Cunen, C., Hjort, N.L. (2020b). Combining information across diverse sources: the II-CC-FF paradigm. Scandinavian Journal of Statistics [to appear].

Cunen, C., Hjort, N.L., Nygård, H.M. (2020). Statistical Sightings of Better Angels: analysing the distribution of battle-deaths over time. Journal of Peace Research, vol. 51, 1-16.

Hjort, N.L., Schweder, T. (2018). Confidence distributions and related themes. General introduction article to a Special Issue of the Journal of Statistical Planning and Inference dedicated to this topic, with eleven articles, and with Hjort and Schweder as guest editors; vol. 195, 1-13.

Hjort, N.L. (2020). Koronakrisen: plutselig ble statistikk allemannseie. Interview in Titan, University of Oslo.

Jewell, B.L., Jewell, N.P. (2020). The huge cost of waiting to contain the pandemic. Letter in New York Times, April 14.

Jewell, B.L., Lewnard, J.A., Jewell, B.L. (2020). Predictive mathematical models of the Covid-19 pandemic: underlying principles and value of projections. JAMA Network, April 16.

Kristiansen, N. (2020). Derfor kan vi ikke stole på tallene over døde og smittede av koronaviruset. Editorial,, April 19.

Schweder, T., Hjort, N.L. (2016). Confidence, Likelihood, Probability: Statistical Inference with Confidence Distributions. Cambridge University Press, Cambridge.

Stoltenberg, E. Aa. (2020). How dangerous is the corona virus? University of Oslo Open Day talk, March 2020.

Tags: confidence curves, coronavirus, covid-19, inference, Monitoring By Nils Lid Hjort, Emil Aas Stoltenberg
Published Apr. 21, 2020 9:58 PM - Last modified Apr. 28, 2020 10:57 PM
Add comment

Log in to comment

Not UiO or Feide account?
Create a WebID account to comment