<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://sonorouschocolate.com/covid19/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alex</id>
	<title>Covid-19 - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="http://sonorouschocolate.com/covid19/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alex"/>
	<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php/Special:Contributions/Alex"/>
	<updated>2026-10-24T14:17:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=Growth_in_Variant_of_Concern&amp;diff=475</id>
		<title>Growth in Variant of Concern</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=Growth_in_Variant_of_Concern&amp;diff=475"/>
		<updated>2026-10-21T22:50:57Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Estimating transmission advantage using variant counts only */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written in May 2021&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Added note in July 2021&#039;&#039;: the point of the second section is to try to get a modelling advantage, in terms of better accuracy and less lag, by combining two different things, the variant counts and the total case counts. The assumption is that the variant counts are only a sample, a subset, of the total case counts, and they are delayed by around two weeks, so &amp;quot;total case counts&amp;quot; is bringing something extra to the party. The method&#039;s advantage can only last as long as there are a significant number of each variant type, but by July almost all cases in the UK were Delta so this method becomes similar to standard binomial (or, in general, multinomial) fitting of the variant types.&lt;br /&gt;
&lt;br /&gt;
The objective here is to try to understand to what extent the variant of concern B.1.617.2 (first found in India, now known as Delta) is growing in the UK, both in its own terms and in comparison to B.1.1.7 (first found in Kent, now known as Alpha). Different methods seemed to be giving different answers and this is an attempt to reconcile them.&lt;br /&gt;
&lt;br /&gt;
Most indicators considered here suggest a substantial transmission advantage of B.1.617.2 over B.1.1.7, estimated as about 60-70% country-wide, or an extra growth rate of about 10-11% per day, though possibly lower in certain places like London. Here &amp;quot;transmission advantage&amp;quot; is here taken to mean the extra biological transmissibility of B.1.617.2 together with any immune-escape advantages it may have at the current level of vaccinations and past infections. In other words, &amp;quot;transmission advantage&amp;quot; is taken to mean $$R_t(\text{B.1.617.2})/R_t(\text{B.1.1.7})$$, and not, for example, $$R_0(\text{B.1.617.2})/R_0(\text{B.1.1.7})$$. The model used here finds typical R numbers of 0.9 for B.1.1.7 and 1.5 for B.1.617.2, though they vary around the country and are notably lower in some areas. In particular, Bolton seems to have crushed the outbreak, presumably by means of intensive &amp;quot;surge&amp;quot; tactics, and Wales, without any particular country-wide surge tactics, has a considerably lower virus growth rate than the rest of the UK, maybe in part due to the significantly higher vaccination levels in that nation.&lt;br /&gt;
&lt;br /&gt;
This analysis is predicated on the idea that there is a single multiplicative constant, the ratio of the (time-varying) R-numbers for B.1.617.2 and B.1.1.7, that is independent of suppression measures or immunity. This seems plausible as an approximation, though it is not biologically guaranteed.&lt;br /&gt;
&lt;br /&gt;
= Estimating transmission advantage using variant counts only =&lt;br /&gt;
&lt;br /&gt;
One method is to compare counts of B.1.617.2 with counts of B.1.1.7 (first found in Kent/UK, dominant in the UK from February to early May) on two or more occasions and take cross ratios. This method has the advantage that some of the uncertainties and variabilities will naturally cancel out. For example, if people change their work patterns to working from home then that will slow down the transmission of both variants, so the comparison between them will hopefully be relatively unaffected. However, there are still some residual sources of uncertainty, as discussed below.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say $$A$$ and $$B$$ cases of variants V1 and V2 respectively were detected during some (short) time period, and then 5 days later $$C$$ and $$D$$ cases of V1 and V2 were detected. We&#039;ll use the simplified assumptions that the growth rates of the two variants differ by a constant, that their generation times are the same, and that the generation times can be approximated by a constant, 5 days. In that case we&#039;d expect $$C=Q_0sA$$ and $$D=R_0sB$$, where $$Q_0$$ and $$R_0$$ are the basic reproduction numbers of variants V1 and V2, and $$s$$ represents overall susceptibility, which includes the proportion of the population that are still biologically susceptible to catching the virus together with any behavioural modifications that might alter the propensity for disease to spread. We see the cross ratio, $$AD/(BC)$$ is equal to $$R_0/Q_0$$, the extra transmissibility, while $$s$$ is cancelled out. Working out $$R_0$$ or $$Q_0$$ individually is not possible from these numbers, but this ratio comparison between them is relatively easy.&lt;br /&gt;
&lt;br /&gt;
Note that if there are two subpopulations with the same susceptibility, $$s$$, then you may as well lump them together as the cross ratio between $$A+A&#039;$$, $$B+B&#039;$$, $$Q_0sA+Q_0sA&#039;$$ and $$R_0sB+R_0sB&#039;$$ is still $$R_0/Q_0$$. We shall discuss the effect of aggregating subpopulations of different susceptibilities below, but first let&#039;s see what we get with counts aggregated to UK level.&lt;br /&gt;
&lt;br /&gt;
To do a calculation all we need is the pair of counts at two times. There are several possible data sources for the UK, including [https://covid19.sanger.ac.uk/downloads The Wellcome Sanger Institute], [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK] or [https://www.gov.uk/government/publications/covid-19-variants-genomically-confirmed-case-numbers/variants-distribution-of-cases-data weekly government updates]. This is from the UK-wide counts in COG-UK&#039;s metadata file and was generated with [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/crossratiogrowthmeasure.py this program]:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Week ending date || B.1.1.7 || B.1.617.2 || Est&#039;d transmission advantage from previous week&lt;br /&gt;
|-&lt;br /&gt;
|2021-04-17 || 7446 || 172&lt;br /&gt;
|-&lt;br /&gt;
|2021-04-24 || 7117 || 450 || 105% (81% - 133%)&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-01 ||  6134 ||   846  ||   75% (60% -     90%)&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-08 ||  4918 ||  1584  ||   83% (72% -     96%)&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-15 ||  3920 ||  2629  ||   69% (60% -     78%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Note that these transmissibility numbers are due to be refined below and shouldn&#039;t be taken as the best estimate.)&lt;br /&gt;
&lt;br /&gt;
Given four numbers $$A$$, $$B$$, $$C$$, $$D$$ arranged like this:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Week ending date || B.1.1.7 || B.1.617.2&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-08 || $$A$$ || $$B$$&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-15 || $$C$$ || $$D$$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
we get an estimate of the multiplicative growth advantage of B.1.617.2 over B.1.1.7 by taking the cross-ratio $$AD/(BC)$$. &lt;br /&gt;
In the last case in the first table that would be $$2.082$$, the estimated relative increase over a week. To roughly convert that into a multiplier for the more familiar reproduction number, we can raise this to the power of $$5/7$$, using the approximation that the generation time is a constant 5 days: $$2.082^{5/7}=1.688...$$, hence an estimated $$69\%$$ transmission advantage of the newer variant.&lt;br /&gt;
&lt;br /&gt;
To estimate the possible statistical error in this answer, $$AD/(BC)$$ can be treated as an odds ratio so you can use your favourite method for calculating a confidence interval for this. [https://en.wikipedia.org/wiki/Odds_ratio#Statistical_inference This is a popular method] which is valid as long as none of the four numbers are very small.&lt;br /&gt;
&lt;br /&gt;
It is worth emphasising that, as always, the confidence interval only covers you for statistical fluctuations. If any underlying assumption is wrong, then the true answer could be well outside this interval. In particular, we&#039;re assuming that each count arises as a representative, independent sample, and each infection leads independently to a random number of others. These assumptions could go wrong, for example&lt;br /&gt;
# if when one sample is sequenced, samples from contacts of the original case are more likely to be sampled than they would otherwise have been (leading to non-independence of samples), or&lt;br /&gt;
# if a significant proportion of infections come from abroad, rather than from community spread, or&lt;br /&gt;
# if viruses of one variant are more likely to be sequenced than those of the another, or&lt;br /&gt;
# if the amount of &amp;quot;suppression&amp;quot; (in the sense of the number $$s$$ above) is correlated with the proportion of one variant over the other.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[This section was mostly written earlier in May 2021 which explains why it is slightly defensive in nature arguing for a high growth/transmission advantage, since this was a point of contention with other scientists at the time downplaying the likelihood that B.1.617.2 was going to be a major problem.]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first of these objections isn&#039;t too hard to work around provided the bias is variant-independent. Non-independence of that type is akin to multiplying up each of $$A$$, $$B$$, $$C$$, $$D$$ by the same constant, and can be dealt with just by widening the confidence interval accordingly. Note also that there is a limit to how big such a multiplier could be because we are currently (date of writing: 27 May 2021) sequencing the majority of viable PCR-confirmed cases in the UK, and it is thought we are finding about 40% of all cases (we will return to this point).&lt;br /&gt;
&lt;br /&gt;
If there were a substantial number of imported cases then that could disturb the calculation, though it may not derail it completely since we would effectively be sampling the growth in B.1.617.2 in part of India in addition to the growth here in the UK. This is only a problem to the extent that the growth rates are different in each country. This question becomes mostly moot anyway if we restrict ourselves to cases since the end of April since India has been on the &amp;quot;red list&amp;quot; of countries since 23 April, requiring travellers to the UK to undergo strict supervised quarantine.&lt;br /&gt;
&lt;br /&gt;
The third objection could arise if we started off relatively uninterested in seeking out the variant of interest, but became progressively keener and better at it over time, for example targetting surveillance in areas known to have a high prevalence of the variant. This is possible, but it should be of limited overall effect. Such a distortion could lead to an overestimate of transmission (a higher cross ratio) in one pair of weeks, but should then lead to an underestimate of transmission in the following pair of weeks. The only way to get a sustained overestimation of transmission would be to have an ever-increasing degree of oversampling week-by-week. But that process has a strict limit because we already find around 40% of cases, and we sequence the majority of the viable ones, so we can&#039;t preferentially sample one variant by more than a factor of around 4 (and it would be hard to achieve that), and that is a one-off factor that can&#039;t keep being reapplied.&lt;br /&gt;
&lt;br /&gt;
We can apply the above counterargument to the first and last entries in the above table to try to get a plausible lower bound for the transmission advantage.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Week ending date || B.1.1.7 || B.1.617.2 || Estimated transmission advantage&lt;br /&gt;
|-&lt;br /&gt;
|2021-04-17 || 7446 || 172&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-15 ||  3920 ||  2629  ||   82% (78%-88%)&lt;br /&gt;
|}&lt;br /&gt;
Here the cross ratio is 29.0, corresponding to a transmission advantage of roughly $$29.0^{5/28}=1.82\times$$, but we can be cautious and reduce by a factor of 4 getting an advantage of $$(29.0/4)^{5/28}=1.42\times$$, i.e., arriving at a 42% advantage even if the final entry $$2629$$ is oversampled by a factor of 4, which seems generously high. Note that we&#039;re assuming the initial entry $$172$$ isn&#039;t undersampled, on the grounds that there would be have been no particular reason to avoid sampling variant cases (and if testing and genomic surveillance was roughly uniform over the country then it wouldn&#039;t happen by chance either).&lt;br /&gt;
&lt;br /&gt;
Moving on to the last objection, there is apparently a problem here that could render the aggregate estimate meaningless. For example, imagine that $$Q_0=1$$ and $$R_0=2$$ and there are two regions, one of which contains almost entirely V1 and has $$s=1$$, and the other has almost entirely V2 with $$s=5$$. The count matrices corresponding to a time interval of 5 days could be:&lt;br /&gt;
\[&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
100 &amp;amp; 1\\&lt;br /&gt;
100 &amp;amp; 2&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
+&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
1 &amp;amp; 100\\&lt;br /&gt;
5 &amp;amp; 1000&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
=&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
101 &amp;amp; 101\\&lt;br /&gt;
105 &amp;amp; 1002&lt;br /&gt;
\end{pmatrix},&lt;br /&gt;
\]&lt;br /&gt;
which is a cross ratio of $$2$$ for each of the summands, but a cross ratio of $$9.5$$ for the sum. This is akin to a Simpson&#039;s paradox and might appear to be a large flaw in the use of aggregate count matrices like this. However, the damage from this is likely limited, and we can to some extent work around what problem there is (see below). Usually there would be limited scope for variation in the intrinsic suppression, $$s$$. Since mid-January, cases have fallen all around the country with an average $$R=R_{B.1.1.7}$$ of around 0.8-0.9. If one city, for example, were extra &amp;quot;spready&amp;quot; (in the sense of $$s$$, which includes behaviour and immunity) by more than a little bit, then B.1.1.7 would still be rampant there. In symbols, combining separate regions of $$A_i$$, $$B_i$$ with suppression number $$s_i$$ would sandwich the aggregate cross ratio estimate like this:&lt;br /&gt;
\[&lt;br /&gt;
\frac{R_0}{Q_0}\frac{s_\text{min}}{s_\text{max}}\le \frac{\sum{A_i}\sum{R_0s_iB_i}}{\sum{B_i}\sum{Q_0s_iA_i}}\le\frac{R_0}{Q_0}\frac{s_\text{max}}{s_\text{min}}.&lt;br /&gt;
\]&lt;br /&gt;
That would mean that the lower bound of 42% from the previous estimate could possibly be an overestimate by a further 10-20% or so, assuming there are no disparities in $$s_i$$ of more than a factor of 1.2.&lt;br /&gt;
&lt;br /&gt;
However, it is possible to imagine one town or niche population behaving very differently which still might throw the estimate off, so we now look at correcting for the problem of different susceptibilities directly when data for the subgroups are separately available. One way is to work out the likelihood of the growth rate for each subgroup, then multiply these to form an overall likelihood which then gives a posterior distribution for the transmission advantage. This is doable relatively painlessly: for example using a Poisson assumption on $$A_i, B_i, C_i, D_i$$ would mean you end up multiplying two beta prime distributions to get the likelihoods which is a single integration (as carried out in [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/vocfit.py this program]).&lt;br /&gt;
&lt;br /&gt;
A simpler version of this is to combine the estimates weighted by their inverse variance, and this tends to give more-or-less similar answers to the above likelihood method (effectively it&#039;s a special case of the likelihood method where we&#039;ve replaced likelihoods by normal approximations). Under usual Poisson assumptions, the variance of $$\log(AD/(BC))$$ is approximately $$A^{-1}+B^{-1}+C^{-1}+D^{-1}$$, which leads to this estimate for the overall log cross ratio:&lt;br /&gt;
\[\frac{\sum(A_i^{-1}+B_i^{-1}+C_i^{-1}+D_i^{-1})^{-1}\log((A_iD_i)/(B_iC_i))}{\sum(A_i^{-1}+B_i^{-1}+C_i^{-1}+D_i^{-1})^{-1}},\]&lt;br /&gt;
where $$i$$ ranges over different subgroups (typically geographic). Note that such a decomposition would fix the problem with the example above: if $$(A_1,B_1,C_1,D_1)=(100,1,100,2)$$ and $$(A_2,B_2,C_2,D_2)=(1,100,5,1000)$$ then the overall estimate for the cross ratio will be exactly $$2$$ simply because each component is equal to $$2$$.&lt;br /&gt;
&lt;br /&gt;
This kind of method has the practical advantage that if one of the subgroups has crazy numbers for any reason, it probably won&#039;t have such an enormous weight in the overall calculation.&lt;br /&gt;
&lt;br /&gt;
A convenient size for the subgroups are Lower Tier Local Authorities — LTLAs — because they are small enough that you may expect relevant things to be similar within each LTLA, such as the presence of a particular variant or a policy of surge testing, but large enough that the large majority of transmissions from person to person are likely to be from within the LTLA rather than from outside. It also happens that the Sanger dataset provides variant counts at LTLA level, the only public dataset to provide such information at this granularity. This is a comparison of cross ratios aggregated to England, compared with those obtained by the above formula. (Here we&#039;re using &amp;quot;non-B.1.617.2&amp;quot; instead of &amp;quot;B.1.1.7&amp;quot; which will be convenient later and anyway will not make much difference.)&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Week ending date || non-B.1.617.2 || B.1.617.2 || Est&#039;d transmission advantage&amp;lt;br&amp;gt; using simple cross ratio || Est&#039;d transmission advantage&amp;lt;br&amp;gt; using LTLA subgroups&lt;br /&gt;
|-&lt;br /&gt;
|2021-04-10 ||  5716  ||   17 &lt;br /&gt;
|-&lt;br /&gt;
|2021-04-17 ||  4830  ||   55  ||  161% (     77% -    285% ) ||  36% ( -20% - 129% )&lt;br /&gt;
|-&lt;br /&gt;
|2021-04-24 ||  4763  ||  186  ||  141% (     94% -    200% ) ||  63% (  19% - 125% )&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-01 ||  3936  ||  502  ||  133% (    106% -    164% ) ||  81% (  51% - 118% )&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-08 ||  3254  || 1310  ||  119% (    110% -    146% ) ||  82% (  60% - 106% )&lt;br /&gt;
|-&lt;br /&gt;
|2021-05-15 ||  2247  || 1900  ||   70% (     59% -     81% ) ||  48% (  34% -  63% )&lt;br /&gt;
|-&lt;br /&gt;
!Overall    || || || || 62% ( 51% - 74% )&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(This was created using [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/vocfit.py this program].) The &amp;quot;Overall&amp;quot; number is obtained by including all weeks for all LTLAs as the subgroups.&lt;br /&gt;
&lt;br /&gt;
Note that the uncorrected transmission advantages, especially from earlier on, are considerably larger than those obtained using COG-UK data. This may possibly be because Sanger data excludes travel cases. To some extent this is desirable because they didn&#039;t arise from community transmission in the UK, so shouldn&#039;t be contributing to the numerator ($$D$$). However, they probably should be contributing, albeit to a lesser extent, to the denominator ($$B$$), because to some extent travel cases lead to onward transmission despite the quarantine rules. (After all, that is how the variant got started in this country.) In this way, the exclusion of all travel cases could lead to inflated transmission advantage figures, at least earlier on. Later on, there are far more community transmission cases compared to travel cases, and the quarantine rules became stricter (after 23 April), so we would expect later numbers to be more realistic.&lt;br /&gt;
&lt;br /&gt;
Conclusion: the 62% ( 51% - 74%) figure represents the best guess so far using the above methods, though it should be interpreted with caution. There are possible sources of error that go beyond the statistical uncertainty represented by the confidence interval. This is illustrated (or at least suggested) by the same analysis repeated on London alone which gives a transmission advantage of 33% (13% - 57%). This is apparently smaller (though the confidence intervals overlap slightly) which suggests that something more complicated than a simple growth model may be at play. Possibly it is an effect of special suppressive measures such as surge testing which are directed against variant B.1.617.2.&lt;br /&gt;
&lt;br /&gt;
As a point of comparison, the secondary attack rates of B.1.1.7 and B.1.617.2 are estimated by NHS Test and Trace and published in  [https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/990150/Variants_of_Concern_VOC_Technical_Briefing_13_England.pdf PHE&#039;s Technical Briefing 13]. We may use a relative risk confidence interval to obtain an extra transmissibility of B.1.617.2 of 66% (53% - 80%). This is a nice independent estimate not relying on population statistics, though there could be some arguments that it may be confounded, e.g., if people with B.1.617.2 live in denser housing, or if Test and Trace is keener to seek out contacts in areas with high B.1.617.2, or something, but taken at face value this estimate is compatible with our estimate above.&lt;br /&gt;
&lt;br /&gt;
= Combining variant counts with case counts =&lt;br /&gt;
&lt;br /&gt;
Using case count data alongside the variant counts will give extra power to the model in determining the transmission advantage and also allow it to predict the separate growth rates for each variant. Variant counts rely on sequencing which comes with a delay of up to two weeks, whereas the plain case count only has a 2-3 day latency. (There is another option to use SGTF / S gene positive counts, which don&#039;t involve a further delay beyond normal testing and is a very useful and timely indicator, but it is not perfect. The S gene information is only available from a subset of laboratories, and a non-trivial number of non-B.1.617.2 variants come up S gene positive which blurs the B.1.617.2 signal somewhat.)&lt;br /&gt;
&lt;br /&gt;
Adding in case count data prevents the model declaring things like &amp;quot;I predict that two weeks ago 90% of cases were the new variant, and this variant was doubling every week&amp;quot; if the number of cases now is similar to the number of cases two weeks ago. It should be forced to project forward its belief about the variants which would contradict the case counts, and so find it needs to modify its belief about the variant. In this way, there is a useful information flow from case counts now to variant proportions two weeks ago.&lt;br /&gt;
&lt;br /&gt;
Note that this joint fit is different from first logistically fitting the variant proportions and then projecting those on to the total case count: such a method could never be &amp;quot;surprised&amp;quot; by the case count. The method here fits the proportions and total cases simultaneously, so that the model is forced to make a trade-off between the happiness of the two different fits: logistic proportions and total case number. In this way, information about total case counts at one time can influence belief about proportions of variants at another.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/vocfit.py program used here] produces a log likelihood, $$L(A,h)$$ as a function of an area, $$A$$, of the UK and a growth rate advantage $$h$$. Calculating $$L(A,h)$$ involves maximising (or integrating) over all of the model parameters except $$h$$. In the simplest mode of operation, $$L(A,h)$$ can be optimised over $$h$$ to find the most likely growth rate advantage, $$h^*$$. Its uncertainty is given by the 95% confidence interval (or from another point of view, credible interval) from the observed Fisher information: $$[h^*-\Delta h,h^*+\Delta h]$$ with $$\Delta h=1.96(-L&#039;&#039;(A,h^*))^{-1/2}$$.&lt;br /&gt;
&lt;br /&gt;
In another mode of operation it works on two geographical levels whereby the area, $$A$$, is divided into sub-areas $$A_1,\ldots,A_n$$. There are then three steps, exploiting the independence of the model conditioned on $$h$$:&lt;br /&gt;
* The map $$h\mapsto L(A_r,h)$$ is calculated/cached for each $$r$$.&lt;br /&gt;
* The sum map $$h\mapsto L(h)=\sum_r L(A_r,h)$$ is formed and maximised over $$h$$, with maximum at $$h^*$$, say.&lt;br /&gt;
* For each $$r$$, the model parameters involved in calculating $$L(A_r,h^*)$$ then tell you the best guess for the variant counts in $$A_r$$, and these can be added up over $$r$$ to form an overall estimate for $$A$$.&lt;br /&gt;
&lt;br /&gt;
As discussed in the previous section, this second method of treating sub-areas separately guards against a Simpson&#039;s paradox situation where change in the global totals of variant counts are not indicative of the true transmission advantage because somehow there is a strong correlation between disease suppression/susceptibility and presence of the new variant.&lt;br /&gt;
&lt;br /&gt;
In the event, the properties of our data sources will dictate which method we may use. COG-UK data is only given to country granularity, so we can&#039;t use the subdivision method on it at a low level, though it is the biggest source of data and it has a useful time granularity of 1 day. The Wellcome Sanger data on the other hand is geographically granular down to each LTLA (approx population 200,000), but only gives totals over each week.&lt;br /&gt;
&lt;br /&gt;
The table below shows the output using [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/vocfit.py this program]. When using Sanger data, it was found the results were more consistent if data was only used from w/e 2021-05-01. This may be because travel cases are no longer confusing matters at that point, since India was placed on the &amp;quot;red list&amp;quot; on 23 April. In all of the following, case count data was obtained using the newCasesBySpecimenDate key on 2021-05-29 with the UK [https://coronavirus.data.gov.uk/details/download coronavirus api].&lt;br /&gt;
&lt;br /&gt;
The Sanger data is sparser than the COG-UK data, but it is more geographically granular. Playing to this advantage, it is probably better to use Sanger data in hierarchical mode with LTLAs at the bottom level: that corresponds to &amp;quot;LTLAs&amp;quot; in the &amp;quot;Using information from&amp;quot; entries in the following table. Similarly, COG-UK country data for Wales and Scotland are more sparse than for England, so it&#039;s probably more reliable to look at rows with &amp;quot;UK&amp;quot; in the &amp;quot;Using information from&amp;quot; column for these nations.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Location || Using information from || Data source (Sanger to w/e 2021-05-15) || Estimated transmission advantage || Estimated $$R_{B.1.1.7}$$ on 2021-05-27 || Estimated $$R_{B.1.617.2}$$ on 2021-05-27&lt;br /&gt;
|-&lt;br /&gt;
|UK       || Constituent nations || COG-UK   || 74% (70% - 79%) || 0.89 (0.81 - 0.98) || 1.54 (1.40 - 1.71)&lt;br /&gt;
|-&lt;br /&gt;
|England  || UK           || COG-UK   || 74% (70% - 79%) || 0.88 (0.78 - 0.98) || 1.53 (1.36 - 1.71)&lt;br /&gt;
|-&lt;br /&gt;
|England  || LTLAs        || Sanger   || 72% (62% - 83%) || 0.95 || 1.49 (1.27 - 1.73)&lt;br /&gt;
|-&lt;br /&gt;
|Scotland || UK           || COG-UK   || 74% (70% - 79%) || 0.96 (0.81 - 1.14) || 1.68 (1.39 - 1.99)&lt;br /&gt;
|-&lt;br /&gt;
|Wales    || UK           || COG-UK   || 74% (70% - 79%) || 0.81 (0.62 - 1.07) || 1.42 (1.08 - 1.87)&lt;br /&gt;
|-&lt;br /&gt;
|London   || London LTLAs || Sanger   || 44% (24% - 68%) || 0.92 || 1.29 (1.12 - 1.57)&lt;br /&gt;
|-&lt;br /&gt;
|London   || England      || Sanger   || 71% (64% - 78%) || 0.83 (0.69 - 1.00) || 1.41 (1.17 - 1.71)&lt;br /&gt;
|-&lt;br /&gt;
|Bolton   || England      || Sanger   || 72% (62% - 83%) || 0.59 (0.47 - 0.75) || 1.02 (0.81 - 1.30)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers are high overall, with an R number of around 1.5 for B.1.617.2 in most of the UK, though it is striking that Bolton seems to have controlled the outbreak.&lt;br /&gt;
&lt;br /&gt;
NB: the confidence intervals in the above table underestimate the uncertainty, because the model relies on assumptions which may not be completely correct.&lt;br /&gt;
&lt;br /&gt;
NB2: The above estimates are not independent of each other because, in this mode, the model is using information from around the country to inform the more local estimates. We can illustrate this by the following two different runs that estimate parameters for the regions of England.&lt;br /&gt;
&lt;br /&gt;
In the following table, the transmission advantages are conditioned to be equal for all regions. This is a good mode to use if you already believe that the transmission advantages are necessarily the same around the country, since it pools all the data and reduces statistical fluctuation.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Location || Using information from || Data source (Sanger to w/e 2021-05-15) || Estimated transmission advantage || Estimated $$R_{B.1.1.7}$$ on 2021-05-29 || Estimated $$R_{B.1.617.2}$$ on 2021-05-29&lt;br /&gt;
|-&lt;br /&gt;
|East Midlands  || England || Sanger || 74% (66% - 82%) || 0.74 (0.60 - 0.92) || 1.29 (1.04 - 1.62)&lt;br /&gt;
|-&lt;br /&gt;
|East of England  || England || Sanger || 74% (66% - 82%) || 0.71 (0.57 - 0.88) || 1.24 (0.98 - 1.54)&lt;br /&gt;
|-&lt;br /&gt;
|London  || England || Sanger || 74% (66% - 82%) || 0.80 (0.66 - 0.95) || 1.39 (1.15 - 1.68)&lt;br /&gt;
|-&lt;br /&gt;
|North East  || England || Sanger || 74% (66% - 82%) || 0.89 (0.68 - 1.17) || 1.54 (1.17 - 2.03)&lt;br /&gt;
|-&lt;br /&gt;
|North West  || England || Sanger || 74% (66% - 82%) || 0.82 (0.70 - 0.95) || 1.43 (1.22 - 1.67)&lt;br /&gt;
|-&lt;br /&gt;
|South East  || England || Sanger || 74% (66% - 82%) || 0.94 (0.76 - 1.15) || 1.63 (1.32 - 2.01)&lt;br /&gt;
|-&lt;br /&gt;
|South West  || England || Sanger || 74% (66% - 82%) || 0.74 (0.57 - 0.96) || 1.28 (0.99 - 1.68)&lt;br /&gt;
|-&lt;br /&gt;
|West Midlands  || England || Sanger || 74% (66% - 82%) || 0.92 (0.74 - 1.14) || 1.59 (1.28 - 2.01)&lt;br /&gt;
|-&lt;br /&gt;
|Yorkshire and The Humber  || England || Sanger || 74% (66% - 82%) || 0.93 (0.76 - 1.14) || 1.62 (1.32 - 1.99)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On the other hand, in the next table all regions are run separately. This is a good mode to use if you want to test the hypothesis that the transmission advantage is the same around the country. The confidence intervals are very wide in several regions because they haven&#039;t had many B.1.617.2 infections (as of early/mid May when the Sanger dataset was updated), but it is still notable that London seems to have lower transmission advantage than the average.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Location || Using information from || Data source (Sanger to w/e 2021-05-15) || Estimated transmission advantage || Estimated $$R_{B.1.1.7}$$ on 2021-05-29 || Estimated $$R_{B.1.617.2}$$ on 2021-05-29&lt;br /&gt;
|-&lt;br /&gt;
|East Midlands || - || Sanger || 67% (48% - 88%) || 0.77 (0.60 - 0.99) || 1.29 (1.03 - 1.61)&lt;br /&gt;
|-&lt;br /&gt;
|East of England || - || Sanger || 81% (60% - 104%) || 0.68 (0.53 - 0.88) || 1.24 (0.99 - 1.54)&lt;br /&gt;
|-&lt;br /&gt;
|London || - || Sanger || 40% (24% - 58%) || 1.00 (0.81 - 1.25) || 1.41 (1.17 - 1.69)&lt;br /&gt;
|-&lt;br /&gt;
|North East || - || Sanger || 51% (-2% - 133%) || 0.97 (0.68 - 1.37) || 1.47 (1.06 - 2.02)&lt;br /&gt;
|-&lt;br /&gt;
|North West || - || Sanger || 84% (71% - 97%) || 0.77 (0.65 - 0.91) || 1.41 (1.21 - 1.65)&lt;br /&gt;
|-&lt;br /&gt;
|South East || - || Sanger || 76% (49% - 108%) || 0.93 (0.71 - 1.21) || 1.63 (1.33 - 1.99)&lt;br /&gt;
|-&lt;br /&gt;
|South West || - || Sanger || 20% (-11% - 63%) || 0.93 (0.68 - 1.25) || 1.11 (0.83 - 1.49)&lt;br /&gt;
|-&lt;br /&gt;
|West Midlands || - || Sanger || 92% (64% - 124%) || 0.84 (0.65 - 1.08) || 1.62 (1.30 - 2.00)&lt;br /&gt;
|-&lt;br /&gt;
|Yorkshire and The Humber || - || Sanger || 99% (55% - 155%) || 0.86 (0.65 - 1.12) || 1.70 (1.37 - 2.12)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Model details =&lt;br /&gt;
&lt;br /&gt;
We treat the generation time for both variants as a constant (5 days). This implies that the ratio of R-numbers being a constant is the same as the difference in growth rates being a constant. In general these two conditions are slightly different things if the generation time is not constant, but it is likely to be a good approximation here. If the generation time were distributed as $$\Gamma(7.886, 1.633)$$ (shape, rate notation) as suggested by the meta-analysis of [https://www.medrxiv.org/content/10.1101/2020.11.17.20231548v2 Challen et al], then the growth rate and reproduction number would, using the [https://plus.maths.org/content/epidemic-growth-rate standard formula], be related by $$R=(1+g/1.633)^{7.886}$$, which means for two different variants, $$g&#039;-g=1.633(T^{0.127}-1)R^{0.127}$$ where $$T=R&#039;/R$$. For a given $$T$$, $$g&#039;-g$$ can only vary by a factor of $$R^{0.127}$$ and since we believe the reproduction number of B.1.1.7 is mostly stable at around $$0.7-1.0$$, the variation in $$R^{0.127}$$ is only about 4-5% which means for practical purposes we can probably take $$g&#039;-g$$ as fixed.&lt;br /&gt;
&lt;br /&gt;
The log likelihood, $$L(A,h)$$, for each area is given by this model:&lt;br /&gt;
&lt;br /&gt;
Constants and known variables (observed data):&lt;br /&gt;
\[&lt;br /&gt;
\begin{equation*}&lt;br /&gt;
\begin{split}&lt;br /&gt;
n_i &amp;amp;= \text{number of confirmed cases on day } i \text{ (counts are slightly adjusted to compensate for weekday effect)}\\&lt;br /&gt;
p &amp;amp;= \text{case ascertainment rate (proportion of cases that are discovered by PCR test)}\\&lt;br /&gt;
g_{-1}(\rho),v_{-1}(\rho)&amp;amp;=\text{empirical growth rate (and its variance) in the two weeks up to 2021-04-10 as a function of region, }\rho\\&lt;br /&gt;
r_j, s_j &amp;amp;= \text{Counts of non-B.1.617.2, B.1.617.2 respectively in the } j^{\text{th}} \text{ week}\\&lt;br /&gt;
I_j &amp;amp;= \text{set of days (a day for COG-UK; a week for Sanger) corresponding to the above VOC counts } r_j, s_j\\&lt;br /&gt;
f_1 &amp;amp;= \text{a constant used to allow for overdispersion of case counts}\\&lt;br /&gt;
f_2 &amp;amp;= \text{a constant used to allow for overdispersion of variant counts}\\&lt;br /&gt;
g_\text{lengthscale}&amp;amp;= \text{a constant which scales the growth parameters}\\&lt;br /&gt;
g_\text{timescale}&amp;amp;= \text{a constant setting the timescale over which the growth rate is allowed to vary}&lt;br /&gt;
\end{split}&lt;br /&gt;
\end{equation*}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Unknown/latent variables/parameters:&lt;br /&gt;
\[&lt;br /&gt;
\begin{equation*}&lt;br /&gt;
\begin{split}&lt;br /&gt;
h&amp;amp;=\text{daily growth advantage of B.1.617.2 over other variants}\\&lt;br /&gt;
X_n&amp;amp;=\text{Fourier coefficients controlling the growth of non-B.1.617.2}\\&lt;br /&gt;
A_0&amp;amp;=\text{initial count of non-B.1.617.2}\\&lt;br /&gt;
B_0&amp;amp;=\text{initial count of B.1.617.2}\\&lt;br /&gt;
\end{split}&lt;br /&gt;
\end{equation*}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Likelihood/distributions (and definitions of intermediate terms), where $$i=0,\ldots,D-1$$ or $$i=0,\ldots,D$$, and $$D=$$(number of days), $$N=D+2g_\text{timescale}$$:&lt;br /&gt;
\[&lt;br /&gt;
\begin{equation*}&lt;br /&gt;
\begin{split}&lt;br /&gt;
A_{i+1}&amp;amp;=e^{g_i}A_i\\&lt;br /&gt;
B_{i+1}&amp;amp;=e^{g_i+h}B_i\\&lt;br /&gt;
\widetilde{A_j}&amp;amp;=\sum_{i\in I_j}A_i\\&lt;br /&gt;
\widetilde{B_j}&amp;amp;=\sum_{i\in I_j}B_i\\&lt;br /&gt;
n_i &amp;amp;\sim \text{Negative Binomial}(\mu=p(A_i+B_i),\text{variance=}\mu(1+f_1^{-1}))\\&lt;br /&gt;
r_j,s_j &amp;amp;\sim \text{Beta Binomial}(r_j+s_j,f_2\widetilde{A_j},f_2\widetilde{B_j})\\&lt;br /&gt;
g_0&amp;amp;\sim N(g_{-1},v_{-1})\\&lt;br /&gt;
X_n&amp;amp;\sim N(0,1)\\&lt;br /&gt;
g_i&amp;amp;=g_0+g_\text{lengthscale}\sqrt{N}\left(\frac{i}{N}X_0+\frac{\sqrt2}{\pi}\sum_{n=1}^{[3N/g_\text{timescale}]}e^{-(ng_\text{timescale}/N)^2/2}\frac{\sin(n\pi i/N)}{n}X_n\right)\\&lt;br /&gt;
h&amp;amp;\sim N(0,\tau^2)\\&lt;br /&gt;
\end{split}&lt;br /&gt;
\end{equation*}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
A bit about the motivation for these choices: growth rates (or reproduction numbers) for each variant can change over time, so it is desirable to allow for some time-variation in these. Keeping the growth rate of the two variants separated by a universal constant ($$h$$) seems like a plausible assumption which allows us to make decent predictions. The formula for $$g_i$$ is a kind of low-pass filtered Brownian motion (the variance of the Fourier coefficients being in a certain proportion). This parametrizes a nice space of smooth functions that may possibly work better than, for example, splines because it is low dimensional and hopefully characterises the kind of &amp;quot;wiggles&amp;quot; that are likely to occur. The parameter space being of relatively low dimension makes it fast and robust to analyse. We choose $$N&amp;gt;D$$ to remove boundary/periodicity effects since the space of parametrized functions is periodic in $$N$$ plus a drift term. The beta-binomial is used as an &amp;quot;overdispersed&amp;quot; binomial distribution. We don&#039;t try to model $$r_j+s_j$$, only $$r_j, s_j$$ conditioned on $$r_j+s_j$$. The reason for this is that we don&#039;t want/need to get into predicting what proportion of cases are sequenced, because it&#039;s volatile and not relevant to inferring the true proportion of variants, assuming there is no bias relating overall number of variant counts to the proportion of the new variant. Doing it this way has the benefit that we can use recent, incomplete, variant counts alongside older, complete ones.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[In fact we use the negative binomial and beta-binomial for training, but variance-scaled-Poisson and variance-scaled-Binomial with corresponding parameters for runs. Writeup to be completed later.]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log likelihood, including the prior for the parameters (and omitting some constant terms) is then&lt;br /&gt;
\[&lt;br /&gt;
\sum_i \left(\log\left(\frac{\Gamma(n_i+f_1\mu_i)}{\Gamma(f_1\mu_i)\Gamma(n_i+1)}\right)+f_1\mu_i\log\left(\frac{f_1}{1+f_1}\right)+n_i\log\left(\frac{1}{1+f_1}\right)\right)\\&lt;br /&gt;
+\sum_j \log\left(\binom{r_j+s_j}{r_j}\frac{B(f_2\widetilde{A_j}+r_j,f_2\widetilde{B_j}+s_j)}{B(f_2\widetilde{A_j},f_2\widetilde{B_j})}\right)\\&lt;br /&gt;
-\frac{(g_0-g_{-1})^2}{2v_{-1}}-\frac12\sum_n X_n^2-\frac{h^2}{2\tau^2}, \text{ where}\\&lt;br /&gt;
\mu_i=p(A_i+B_i), A_r=A_0e^{\sum_{i&amp;lt;r}g_i}, B_r=B_0e^{rh+\sum_{i&amp;lt;r}g_i}, \text{ and}\\&lt;br /&gt;
g_i=g_0+g_\text{lengthscale}\sqrt{N}\left(\frac{i}{N}X_0+\frac{\sqrt2}{\pi}\sum_{n=1}^{[3N/g_\text{timescale}]}e^{-(ng_\text{timescale}/N)^2/2}\frac{\sin(n\pi i/N)}{n}X_n\right)&lt;br /&gt;
\]&lt;br /&gt;
and can be maximised over $$h$$, $$A_0$$, $$B_0$$, $$g_0$$ and $$X_n$$.&lt;br /&gt;
&lt;br /&gt;
After the MLE has been found, the log likelihood can be expanded about the maximum and the quadratic approximation yields a Gaussian which can be integrated (Laplace approximation), giving a good approximation of the integral of the likelihood over the parameter space of $$h$$, $$A_0$$, $$B_0$$, $$g_0$$ and $$X_n$$. This gives the proper normalisation which allows one to optimise over $$f_1$$, $$f_2$$, $$g_\text{timescale}$$, $$g_\text{lengthscale}$$. Trained on the UK with COG-UK data, we&#039;re currently using $$f_1=0.050$$, $$f_2=0.075$$, $$g_\text{timescale}=25$$, $$g_\text{lengthscale}=0.01$$. The other constants don&#039;t make much difference to the estimates or confidence intervals. With further work, the four constants could be incorporated as dynamic parameters which would allow for fluctuation in these &amp;quot;constants&amp;quot;, and also allow for different values of these in different regions.&lt;br /&gt;
&lt;br /&gt;
Confidence intervals for $$h$$, the growth rate difference between the two variants, are easy to obtain because $$h$$ is one of the parameters, so as mentioned previously it is just a matter of calculating $$(-L&#039;&#039;(A,h^*))^{-1/2}$$. To calculate confidence intervals for other features, such as $$R_{B.1.617.2}$$, the parameters are treated as normal distributions centred on the MLE, with covariance matrix given by the inverse Hessian of the log likelihood. This is an alternative to using something like Markov Chain Monte Carlo.&lt;br /&gt;
&lt;br /&gt;
= Graphical output =&lt;br /&gt;
&lt;br /&gt;
In each case there is a graph with a linear y-axis, followed by the same information plotted on a logarthmic scale.&lt;br /&gt;
&lt;br /&gt;
If it looks like the lines are not going through the data points in the best way, then that might be because they are constrained in ways that aren&#039;t completely obvious. The two assumptions of a constant factor in transmissibility between variants, and reproduction numbers being a simple exponential of the respective growth rates, mean that the slopes of the green and purple lines in the log charts should move in tandem, a fixed difference apart.&lt;br /&gt;
&lt;br /&gt;
== UK using COG-UK ==&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.uk/fit_UK_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_UK_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.uk/fit_UK_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_UK_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
== England ==&lt;br /&gt;
&lt;br /&gt;
England is treated separately here from Scotland, Wales and Northern Ireland, because there are more data sources for it, in particular the Sanger feed which enables us to compare different ways of estimating the parameters for England.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_England_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_England_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_England_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_England_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
== Scotland, Wales and Northern Ireland ==&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Scotland_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Scotland_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Scotland_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Scotland_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Wales_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Wales_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Wales_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Wales_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country.separate/fit_Northern_Ireland_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Northern_Ireland_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country.separate/fit_Northern_Ireland_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/cog.uk.country/fit_Northern_Ireland_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
== Bolton ==&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.bolton.ltla.minvoc2021-05-01/fit_Bolton_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.bolton.ltla.minvoc2021-05-01/fit_Bolton_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.bolton.ltla.minvoc2021-05-01/fit_Bolton_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.bolton.ltla.minvoc2021-05-01/fit_Bolton_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.ltla.minvoc2021-05-01/fit_Bolton_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.ltla.minvoc2021-05-01/fit_Bolton_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.ltla.minvoc2021-05-01/fit_Bolton_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.ltla.minvoc2021-05-01/fit_Bolton_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
== Regions of England ==&lt;br /&gt;
&lt;br /&gt;
=== East Midlands ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_Midlands_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_Midlands_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_Midlands_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_Midlands_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== East of England ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_of_England_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_of_England_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_of_England_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_East_of_England_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== London ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_London_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_London_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_London_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_London_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== North East ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_East_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_East_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_East_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_East_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== North West ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_West_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_West_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_West_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_North_West_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== South East ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_East_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_East_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_East_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_East_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== South West ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_West_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_West_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_West_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_South_West_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== West Midlands ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_West_Midlands_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_West_Midlands_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_West_Midlands_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_West_Midlands_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
=== Yorkshire and The Humber ===&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_Yorkshire_and_The_Humber_lin.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_Yorkshire_and_The_Humber_lin.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_Yorkshire_and_The_Humber_log.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/vocgrowth/sanger.england.region.minvoc2021-05-01/fit_Yorkshire_and_The_Humber_log.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Acknowledgements =&lt;br /&gt;
&lt;br /&gt;
I am grateful to Theo Sanderson and Tom Wenseleers for helpful conversations.&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=474</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=474"/>
		<updated>2023-12-20T21:17:31Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 7 December 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 September 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 December 2023] Temporary underclassification issue for JN.1. Please ignore December data for the time being.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 7 December 2023] JN.1 is now established as the most common single variant, though not yet more frequent than all other variants combined, and will contribute to an increase in infections over the winter. Its estimated growth advantage of 7.4% per day over the baseline variant is moderately high, though going by the crude &amp;quot;it&#039;s the square that matters&amp;quot; rule-of-thumb, it is only a quarter as bad as BA.5 which had a 14% or so daily growth advantage.&lt;br /&gt;
&lt;br /&gt;
A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topfewvariants.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topfewvariants.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=473</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=473"/>
		<updated>2023-12-07T10:18:19Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 7 December 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 September 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 7 December 2023] JN.1 is now established as the most common single variant, though not yet more frequent than all other variants combined, and will contribute to an increase in infections over the winter. Its estimated growth advantage of 7.4% per day over the baseline variant is moderately high, though going by the crude &amp;quot;it&#039;s the square that matters&amp;quot; rule-of-thumb, it is only a quarter as bad as BA.5 which had a 14% or so daily growth advantage.&lt;br /&gt;
&lt;br /&gt;
A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topfewvariants.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topfewvariants.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=472</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=472"/>
		<updated>2023-12-07T10:17:59Z</updated>

		<summary type="html">&lt;p&gt;Alex: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 7 December 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 July 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 7 December 2023] JN.1 is now established as the most common single variant, though not yet more frequent than all other variants combined, and will contribute to an increase in infections over the winter. Its estimated growth advantage of 7.4% per day over the baseline variant is moderately high, though going by the crude &amp;quot;it&#039;s the square that matters&amp;quot; rule-of-thumb, it is only a quarter as bad as BA.5 which had a 14% or so daily growth advantage.&lt;br /&gt;
&lt;br /&gt;
A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topfewvariants.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topfewvariants.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=471</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=471"/>
		<updated>2023-10-05T20:42:39Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 5 October 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 July 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 5 October 2023] HK.3, a so-called FLip variant, is the current frontrunner in terms of growth. The old-guard XBB lineages have upped their game in the form of XBB.1.16.11 and XBB.1.16.15. BA.2.86* (&amp;quot;Pirola&amp;quot;) is now one among several up-and-coming variants. It&#039;s the square of the relative growth rate that&#039;s important, which means the current growth estimate of HK.3 vs baseline of around 4.3% is not especially high for an emerging new variant. That kind of growth suggests a time-to-dominance (if nothing else were to change) of months, by which time some other significant variant will likely have arisen. In other words, it&#039;s more like variant soup at the moment than a single stand-out variant.&lt;br /&gt;
&lt;br /&gt;
A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topfewvariants.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topfewvariants.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=470</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=470"/>
		<updated>2023-09-20T18:50:27Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 July 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 September 2023] The following graph shows XBB.1.16* (outgoing), EG.5.1* (baseline) and BA.2.86* (&amp;quot;Pirola&amp;quot;, up and coming). It&#039;s the square of the relative growth rate that&#039;s important, and the current value of BA.2.86*/EG.5.1* of around 3.5% is not especially high for emerging new variants, though there is significant uncertainty in this estimate. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to EG.5.1*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topfewvariants.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topfewvariants.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=469</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=469"/>
		<updated>2023-09-20T18:29:09Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 July 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topmanyvariants.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023] The following graph shows XBB.1.16* (outgoing), EG.5.1* (baseline) and BA.2.86* (&amp;quot;Pirola&amp;quot;, up and coming). It&#039;s the square of the relative growth rate that&#039;s important, and the current value of BA.2.86*/EG.5.1* of around 7% is moderately high for emerging new variants, though there is significant uncertainty in this estimate. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to EG.5.1*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/topfewvariants.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/topfewvariants.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=468</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=468"/>
		<updated>2023-09-15T15:52:04Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 July 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023] The following graph shows XBB.1.16* (outgoing), EG.5.1* (baseline) and BA.2.86* (&amp;quot;Pirola&amp;quot;, up and coming). It&#039;s the square of the relative growth rate that&#039;s important, and the current value of BA.2.86*/EG.5.1* of around 7% is moderately high for emerging new variants, though there is significant uncertainty in this estimate. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to EG.5.1*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_EG.5.1*_XBB.1.16*_BA.2.86*.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_EG.5.1*_XBB.1.16*_BA.2.86*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=467</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=467"/>
		<updated>2023-09-14T00:43:11Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.climb.ac.uk/ CLIMB]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 July 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_EG.1_EG.5.1_EG.5.1.1_EG.5.1.3_EG.5.1.4_EG.5.1.6_GE.1_XBB.1.16_XBB.1.16.11_XBB.1.16.15_XBB.1.16.6_XBB.2.3_XBB.2.3.11_DV.7.1_FL.1.5.1_GK.2_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.*_XBB.1.16*_EG.*_FL.*_FY.*_BA.2.86*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 14 September 2023] The following graph shows XBB.1.16* (outgoing), EG.5.1* (baseline) and BA.2.86* (&amp;quot;Pirola&amp;quot;, up and coming). It&#039;s the square of the relative growth rate that&#039;s important, and the current value of BA.2.86*/EG.5.1* of around 8% is moderately high for emerging new variants, though there is significant uncertainty in this estimate. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to EG.5.1*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_EG.5.1*_XBB.1.16*_BA.2.86*.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_EG.5.1*_XBB.1.16*_BA.2.86*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=466</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=466"/>
		<updated>2023-07-22T18:26:53Z</updated>

		<summary type="html">&lt;p&gt;Alex: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Note that the number of sequenced samples has been low in recent months which means that the growth rate estimates presented here are uncertain.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 July 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 May 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 July 2023] The following graph shows some of the fastest-growing new variants in the UK compared with XBB.1.16, namely XBB.1.16.11 and EG.5.1*. It&#039;s the square of the relative growth rate that&#039;s important, and the current value of EG.5.1*/XBB.1.16 of around 6% is moderate for emerging new variants (2% would be negligible, 10% would be high), with possible effects on cases felt in a month or so. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to XBB.1.16, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.16_XBB.1.16.11_EG.5.1*.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.16_XBB.1.16.11_EG.5.1*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=465</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=465"/>
		<updated>2023-07-22T18:24:46Z</updated>

		<summary type="html">&lt;p&gt;Alex: Update to new set of variants and new date range&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 July 2023.] Note that the number of sequenced samples has been low in recent months which means that growth rate estimates are uncertain.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 July 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 May 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_CH.1.1.1_EG.1_EG.5.1_EG.5.1.1_FU.1_GE.1_XBB.1.16_XBB.1.16.11_XBB.2.3_XBB.2.3.2_XBB.2.3.3_*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BQ.1.1*_EG.*_FL.*_FE.*_FY.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 July 2023] The following graph shows some of the fastest-growing new variants in the UK compared with XBB.1.16, namely XBB.1.16.11 and EG.5.1*. It&#039;s the square of the relative growth rate that&#039;s important, and the current value of EG.5.1*/XBB.1.16 of around 6% is moderate for emerging new variants (2% would be negligible, 10% would be high), with possible effects on cases felt in a month or so. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to XBB.1.16, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.16_XBB.1.16.11_EG.5.1*.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.16_XBB.1.16.11_EG.5.1*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=464</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=464"/>
		<updated>2023-04-17T09:57:04Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 16 April 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 February 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 16 April 2023] The following graph shows the fastest-growing new variant in the UK compared with XBB.1.5*, namely XBB.1.16*. It&#039;s the square of the relative growth rate that&#039;s important, and the current value of XBB.1.16*/XBB.1.5* of around 6% is moderate for emerging new variants (2% would be negligible, 10% would be high), with possible effects on cases felt in a month or so. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to XBB.1.5*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5*_XBB.1.9*_XBB.1.16*.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5*_XBB.1.9*_XBB.1.16*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=463</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=463"/>
		<updated>2023-04-16T15:39:31Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 16 April 2023. Adjusted variant mixture.] This variant pressure graph shows history since 1 February 2023. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here. Summary status: virus is still adapting a little and working out ways around existing immunity, but no breakthrough variant in sight.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_EG.1_EM.1_DU.1_XBB.1_*_DV.1*_XBB.*_XBB.1.*_XBB.1.5*_XBB.1.9.1*_XBB.1.9.2*_XBB.1.16*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 16 April 2023] The following graph shows the fastest-growing new variant in the UK compared with XBB.1.5*, namely XBB.1.16*. It&#039;s the square of the relative growth rate that&#039;s important, and the current value of XBB.1.16*/XBB.1.5* of around 6% is moderate for emerging new variants (2% would be negligible, 10% would be high), with possible effects on cases felt in a month or so. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to XBB.1.5*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5*_XBB.1.9*_XBB.1.16*.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5*_XBB.1.9*_XBB.1.16*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=462</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=462"/>
		<updated>2023-02-22T15:49:54Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 Feb 2023. Adjusted variant mixture.] This variant pressure graph shows history since 16 December 2022. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here. Summary status: virus is still adapting a little and working out ways around existing immunity, but no breakthrough variant in sight.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 Feb 2023] The following graph shows the fastest-growing new variant in the UK compared with XBB.1.5, namely XBB.1.9.1. It&#039;s the square of the relative growth rate that&#039;s important, and the current value of XBB.1.9.1/XBB.1.5 of around 3-4% is quite small in the scheme of things. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to XBB.1.5, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5_XBB.1.9.1.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5_XBB.1.9.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=461</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=461"/>
		<updated>2023-02-22T15:48:56Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 Feb 2023] Adjust variant mixture. This variant pressure graph shows history since 16 December 2022. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here. Summary status: virus is still adapting a little and working out ways around existing immunity, but no breakthrough variant in sight.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_BA.5.2.6_BA.5.2.35_BF.7_BQ.1_BQ.1.8_BQ.1.1.2_BQ.1.1.8_CH.1.1_CH.1.1.1_XBF_DN.1.1_XBB_XBB.1.5_XBB.1.9.1_XBB.1_*_XBB.*_XBB.1.*_BA.4*_BA.5*_BA.5.2*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 Feb 2023] The following graph shows the fastest-growing new variant in the UK compared with XBB.1.5, namely XBB.1.9.1. It&#039;s the square of the relative growth rate that&#039;s important, and the current value of XBB.1.9.1/XBB.1.5 of around 3-4% is quite small in the scheme of things. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to XBB.1.5, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straightish lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5_XBB.1.9.1.png &amp;lt;img src=&amp;quot;https://sonorouschocolate.com/covid19/extdata/UK_XBB.1.5_XBB.1.9.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=460</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=460"/>
		<updated>2022-12-25T04:06:46Z</updated>

		<summary type="html">&lt;p&gt;Alex: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 24 Dec 2022] Added CH.1.1.1 and XBB.1.* (essentially XBB.1.5). This variant pressure graph shows history since November 2022. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2.75.2_BA.4.6_BA.5.2.6_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BQ.1.1.8_BE.1.1_CH.1.1_CH.1.1.1_XBB_XBB.1_*_XBB.*_XBB.1.*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2.75.2_BA.4.6_BA.5.2.6_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BQ.1.1.8_BE.1.1_CH.1.1_CH.1.1.1_XBB_XBB.1_*_XBB.*_XBB.1.*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2.75.2_BA.4.6_BA.5.2.6_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BQ.1.1.8_BE.1.1_CH.1.1_CH.1.1.1_XBB_XBB.1_*_XBB.*_XBB.1.*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2.75.2_BA.4.6_BA.5.2.6_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BQ.1.1.8_BE.1.1_CH.1.1_CH.1.1.1_XBB_XBB.1_*_XBB.*_XBB.1.*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 24 Dec 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BQ.1.1*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BQ.1.1*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BQ.1.1*_CH.1.1.1_XBB.1.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BQ.1.1*_CH.1.1.1_XBB.1.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=459</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=459"/>
		<updated>2022-12-02T10:36:31Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 2 Dec 2022] Added CH.1.1. This variant pressure graph shows history since October 2022. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BE.1.1_CH.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BE.1.1_CH.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BE.1.1_CH.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.8_BE.1.1_CH.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*_BQ.1.*_BQ.1.1*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 2 Dec 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BQ.1.1*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BQ.1.1*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BQ.1.1*_CH.1.1_XBB.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BQ.1.1*_CH.1.1_XBB.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=458</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=458"/>
		<updated>2022-11-11T10:45:22Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 11 Nov 2022] This variant pressure graph shows recent history (since mid September 2022). For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for showing a relatively short time interval (two months or so) is that the relative growth rates of new variants are changing, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants. And going too far forward would underestimate future variant pressure because new variants will emerge that are not accounted for here.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.8_BE.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.8_BE.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.8_BE.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BA.5.2.13_BA.5.2.35_BF.5_BF.7_BF.11_BQ.1_BQ.1.1_BQ.1.8_BQ.1.1.8_BE.1.1_XBB_XBB.1_*_BA.2.75.*_BA.4*_BA.5*_BF.*_BN.1.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 11 Nov 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BQ.1.1. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BQ.1.1, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation over a shortish time period (two months, say).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BQ.1.1_BQ.1.8_BQ.1.1.8_XBB.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BQ.1.1_BQ.1.8_BQ.1.1.8_XBB.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=457</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=457"/>
		<updated>2022-10-25T02:03:47Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] This variant pressure graph now shows only recent history (since September 2022), not the previous June/July BA.5 wave as it used to. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for this change is that the relative growth rates of new variants to BA.5.2 have fallen over the last two months, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_XBB_XBB.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_XBB_XBB.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_XBB_XBB.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_XBB_XBB.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. (The relative growth rate of BA.2.75.2 compared with BA.5.2 has fallen significantly over the last two months and it is now no longer a leading variant.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BQ.1_BQ.1.1_XBB.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BQ.1_BQ.1.1_XBB.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=456</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=456"/>
		<updated>2022-10-22T08:14:59Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] This variant pressure graph now shows only recent history (since September 2022), not the previous June/July BA.5 wave as it used to. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for this change is that the relative growth rates of new variants to BA.5.2 have fallen over the last two months, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[#Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. (The relative growth rate of BA.2.75.2 compared with BA.5.2 has fallen significantly over the last two months and it is now no longer a leading variant.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=455</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=455"/>
		<updated>2022-10-21T09:19:21Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] This variant pressure graph now shows only recent history (since September 2022), not the previous June/July BA.5 wave as it used to. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for this change is that the relative growth rates of new variants to BA.5.2 have fallen over the last two months, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential linear assumption as described in the [[Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. (The relative growth rate of BA.2.75.2 compared with BA.5.2 has fallen significantly over the last two months and it is now no longer a leading variant.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=454</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=454"/>
		<updated>2022-10-21T09:18:46Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] This variant pressure graph now shows only recent history (since September 2022), not the previous June/July BA.5 wave as it used to. For comparison with the present graph, the BA.5 wave reached a variant pressure of 0.29%. The reason for this change is that the relative growth rates of new variants to BA.5.2 have fallen over the last two months, presumably due to the background immunity pattern slowly becoming relatively less favourable to the new variants, so a simple straight-line growth estimate (meaning the exponential liner assumption as described in the [[Technical_details|technical details]] section) going back too far in time would overestimate the relative growth rates of the new crop of variants.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate, and also provides an estimate of how much it will increase the growth rate a short time into the future, always remembering that this variant effect on growth has to be added to the general growth (or decline) of all variants to get the overall growth rate of the virus.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BF.11_BM.1.1_BQ.1_BQ.1.1_BA.*_BA.2.75.*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. (The relative growth rate of BA.2.75.2 compared with BA.5.2 has fallen significantly over the last two months and it is now no longer a leading variant.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=453</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=453"/>
		<updated>2022-10-21T08:56:35Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] Expectation is for variants to drive a wave in October and November, or prolong the existing mostly-non-variant wave which began around around the start of September (presumably caused by some combination of immunity waning and changes in mixing patterns).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] The above two graphs obviously have large uncertainties, but even the bottom end of the estimate suggests a significant increase in daily growth to come (6% growth per day would be 11.5-day doubling).&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. The relative growth rate of BA.2.75.2 compared with BA.5.2 has fallen significantly over the last two months and it is now no longer a leading variant. The relative growth rate of other new variants (such as BQ.1.1) to BA.5.2 have also fallen to some extent. These changes are presumably caused by the background immunity slowly becoming relatively less favourable to the new variants.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BA.5.2.6_BF.7_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=452</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=452"/>
		<updated>2022-10-12T21:45:55Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Description of variant pressure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] Expectation is for variants to drive a wave in October and November, or prolong the existing mostly-non-variant wave which began around around the start of September (presumably caused by some combination of immunity waning and changes in mixing patterns).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] The above two graphs obviously have large uncertainties, but even the bottom end of the estimate suggests a significant increase in daily growth to come (6% growth per day would be 11.5-day doubling).&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. Worldwide estimate of BQ.1.1&#039;s growth advantage over BA.5.2* is broadly similar at around 14% (11% - 18%) per day.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
Edit to add: it turns out the decomposition presented here is an example of Fisher&#039;s fundamental theorem of natural selection, where the fitness function of a variant is the relative growth rate for that variant, plus a variant-independent, time-dependent, global term. Fisher&#039;s statement in 1930 was that &amp;quot;The rate of increase in fitness of any organism at any time is equal to its genetic variance in fitness at that time&amp;quot;, though this required interpretation as it wasn&#039;t a completely formal mathematical statement. See [https://arxiv.org/abs/2107.05610 John Baez&#039;s paper] for a mathematical exposition of the time-independent case.&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=451</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=451"/>
		<updated>2022-10-05T13:21:54Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */ Adjust variant blend&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] Expectation is for variants to drive a wave in October and November, or prolong the existing mostly-non-variant wave which began around around the start of September (presumably caused by some combination of immunity waning and changes in mixing patterns).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BM.1.1_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] The above two graphs obviously have large uncertainties, but even the bottom end of the estimate suggests a significant increase in daily growth to come (6% growth per day would be 11.5-day doubling).&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. Worldwide estimate of BQ.1.1&#039;s growth advantage over BA.5.2* is broadly similar at around 14% (11% - 18%) per day.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=450</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=450"/>
		<updated>2022-10-03T18:23:09Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] Expectation is for variants to drive a wave in October and November, or prolong the existing mostly-non-variant wave which began around around the start of September (presumably caused by some combination of immunity waning and changes in mixing patterns).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] The above two graphs obviously have large uncertainties, but even the bottom end of the estimate suggests a significant increase in daily growth to come (6% growth per day would be 11.5-day doubling).&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. Worldwide estimate of BQ.1.1&#039;s growth advantage over BA.5.2* is broadly similar at around 14% (11% - 18%) per day.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=449</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=449"/>
		<updated>2022-10-03T18:06:46Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 3 Oct 2022] Expectation is for variants to drive a wave in October and November, or prolong the existing mostly-non-variant wave which began around around the start of September (presumably caused by some combination of immunity waning and changes in mixing patterns).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] The above two graphs obviously have large uncertainties, but even the bottom end of the estimate suggests a significant increase in daily growth to come (6% growth per day would be 11.5-day doubling).&lt;br /&gt;
&lt;br /&gt;
The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. Worldwide estimate of BQ.1.1&#039;s growth advantage over BA.5.2* is broadly similar at around 17% (14% - 20%) per day.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=448</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=448"/>
		<updated>2022-09-29T01:01:23Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] Now including BQ.1 and BQ.1.1 by default, since their prediction ranges have settled down somewhat. Also adding in BN.1 (=BA.2.75.5.1). Expectation is still for variants to drive a wave in October, maybe extending to November. Reminder that this variant effect has to be added to any affect on case growth/shrinkage due to immunity waning, immunity gaining (due to infections and vaccinations) and changing mixing patterns, but at a guess, the variant effect will be enough to ensure case growth in October even if immunity has increased by then.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.2_BA.2.75.5_BN.1_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*_BA.2.75.*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 28 Sep 2022] The above two graphs obviously have large uncertainties, but even the bottom end of the estimate suggests a significant increase in daily growth to come (6% growth per day would be 11.5-day doubling).&lt;br /&gt;
&lt;br /&gt;
The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation. Worldwide estimate of BQ.1.1&#039;s growth advantage over BA.5.2* is broadly similar at around 17% (14% - 20%) per day.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BA.2.75.2_BN.1_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=447</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=447"/>
		<updated>2022-09-20T12:58:30Z</updated>

		<summary type="html">&lt;p&gt;Alex: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]. See [[#Description_of_variant_pressure |sections below]] for a description of variant pressure.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Sep 2022] Now including BQ.1 and BQ.1.1 (further below). These generate some wild ranges of possible outcomes because of the large uncertainty as to BQ.1.1&#039;s growth rate arising from low case counts (the lower sequencing surveillance is mainly due to reduced PCR testing as of late). The first two graphs below do not include BQ.1 and BQ.1.1; the following two graphs include them. It seems likely in any case that there will be some kind of variant-driven wave in October, with the exact timing determined by where the growth rates lie within the expected range, and a host of external factors like immunity waning and changing mixing patterns.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. For example, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Now the same two graphs including BQ.1 and BQ.1.1:&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.5_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.5_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.5_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BF.5_BF.7_BA.2.12.1_BQ.1_BQ.1.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 20 Sep 2022] The above two graphs obviously have very large uncertainties, but even the bottom end of the estimate corresponds to a notable growth change (7.5% growth would be 10-day doubling, which would lead in turn to a significant number of cases after a month or so). There isn&#039;t a huge amount more epidemiological information on BQ.1.1 worldwide as the UK has nearly 50% (30 out of 61) of the world&#039;s sequenced cases from GISAID+COG-UK, with the remaining 50% being geographically dispersed. The second largest concentration of cases of BQ.1.1 is in the USA which has 13 cases and an estimated daily growth rate relative to BA.5.2* of 18% (10% - 26%). This is consistent with the estimated range from UK data, though again with a very large range of uncertainty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following graph shows some of the fastest-growing new variants in the UK compared with BA.5.2*. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2*, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BF.7_BA.2.75.2_BQ.1_BQ.1.1.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2*_BF.7_BA.2.75.2_BQ.1_BQ.1.1.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Description of variant pressure =&lt;br /&gt;
&lt;br /&gt;
For a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen and immunity will have shifted.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is pretty big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (With apologies if this quantity already exists in the literature under a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to about two months ahead.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one. The variant pressure is only one component of changing immunity levels which are also reduced by immunity waning and increased by vaccination or infection.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
This graph was based on the collection of variants thought to be important for the period covered (February - August 2022). The area under the pink curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.28%*14=4%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection. (Note that the method of fitting and the presentation of the result as variant pressure are two separate things. I.e., there is no particular need to use the Dirichlet-Multinomial method in order to form a variant pressure graph.)&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous sections]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=446</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=446"/>
		<updated>2022-09-13T06:02:36Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 12 September 2022] The graph below shows the combined effect on the growth rate of all variants that are known or suspected to be relevant from May 2022 onwards, of which BA.2.75.1, BA.2.75.2 and BF.7 are probably the main ones to keep an eye on for September. The uncertainty in the projection is high because there are only a few hundred being sequenced each day now (partly because we are doing much less PCR testing than we used to, but also because there there aren&#039;t so many cases right now).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. Using the same example as above, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=445</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=445"/>
		<updated>2022-09-12T22:06:06Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 12 September 2022] The graph below shows the combined effect on the growth rate of all variants that are known or suspected to be relevant from May 2022 onwards, of which BA.2.75.1, BA.2.75.2 and BF.7 are probably the main ones to keep an eye on for September. The uncertainty in the projection is high because there are only a few hundred being sequenced each day now (for the good reason that there aren&#039;t so many cases right now).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. Using the same example as above, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=444</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=444"/>
		<updated>2022-09-12T22:05:05Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content, and comments that apply to a particular version of the dynamic content, with static explanations. (The &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.)&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 12 September 2022] (Graph below) Looking at the combined effect on the growth rate of all variants that are known or suspected to be relevant from May 2022 onwards, of which BA.2.75.1, BA.2.75.2 and BF.7 are probably the main ones to keep an eye on for September. The uncertainty in the projection is high because there are only a few hundred being sequenced each day now (for the good reason that there aren&#039;t so many cases right now).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
Another view of the same information is the integral of the above graph shown below (with an arbitrary vertical offset). This allows you to compare two days to see how much the changing variant mixture has increased the growth rate. Using the same example as above, the growth effect on 2022-05-30 was about -10%, and on 2022-06-13 about -6%, so the variant-caused increase in growth rate between these days was about 4%.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=443</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=443"/>
		<updated>2022-09-06T07:55:56Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Subsection: Dirichlet-Multinomial fit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content with static explanations and comments that apply to a particular version of the dynamic content, and the &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] Adding BA.2.75.5 (the graph immediately below) and (below that) BA.2.75.2 into the mix that determines variant pressure. These are likely to be fast-growing variants but there are very few samples of them to date (only 7 and 9 respectively), so there is a large uncertainty in their growth rate, which causes a large range of possible variant pressures in the coming month. It is arguable whether it is worth including variants with so few samples, but since we have other reasons to believe they may be significant, in particular the combination of the S:R346T mutation with BA.2.75 has been anticipated, it seems reasonable to keep an eye on them.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, then conditioning on their sum being $$n$$ gives a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=442</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=442"/>
		<updated>2022-09-06T07:50:36Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Technical details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content with static explanations and comments that apply to a particular version of the dynamic content, and the &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] Adding BA.2.75.5 (the graph immediately below) and (below that) BA.2.75.2 into the mix that determines variant pressure. These are likely to be fast-growing variants but there are very few samples of them to date (only 7 and 9 respectively), so there is a large uncertainty in their growth rate, which causes a large range of possible variant pressures in the coming month. It is arguable whether it is worth including variants with so few samples, but since we have other reasons to believe they may be significant, in particular the combination of the S:R346T mutation with BA.2.75 has been anticipated, it seems reasonable to keep an eye on them.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$ with the same $$a_i$$ and $$b_i$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, and condition on their sum being $$n$$, then you get a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=441</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=441"/>
		<updated>2022-09-03T08:33:50Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. This page is a bit of an experiment/work-in-progress in mixing self-updating content with static explanations and comments that apply to a particular version of the dynamic content, and the &amp;quot;Time of writing&amp;quot; tags are an attempt to clarify this.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] Adding BA.2.75.5 (the graph immediately below) and (below that) BA.2.75.2 into the mix that determines variant pressure. These are likely to be fast-growing variants but there are very few samples of them to date (only 7 and 9 respectively), so there is a large uncertainty in their growth rate, which causes a large range of possible variant pressures in the coming month. It is arguable whether it is worth including variants with so few samples, but since we have other reasons to believe they may be significant, in particular the combination of the S:R346T mutation with BA.2.75 has been anticipated, it seems reasonable to keep an eye on them.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to BA.5.2, the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, and condition on their sum being $$n$$, then you get a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=440</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=440"/>
		<updated>2022-09-01T21:02:43Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache.&lt;br /&gt;
&lt;br /&gt;
The straight-line graphs here compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] Adding BA.2.75.5 (the graph immediately below) and (below that) BA.2.75.2 into the mix that determines variant pressure. These are likely to be fast-growing variants but there are very few samples of them to date (only 7 and 9 respectively), so there is a large uncertainty in their growth rate, which causes a large range of possible variant pressures in the coming month. It is arguable whether it is worth including variants with so few samples, but since we have other reasons to believe they may be significant, in particular the combination of the S:R346T mutation with BA.2.75 has been anticipated, it seems reasonable to keep an eye on them.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.75.1_BA.2.75.2_BA.2.75.5_BA.4.6_BA.5.1.12_BA.5.1+S:R346T_BA.5.2_BA.5.2.1_BA.5.2.6_BA.5.2.7_BE.1_BE.1.1_BF.11_BF.3_BF.5_BF.7_BA.2.12.1_BA.1*_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 1 September 2022] In the graph below (self-updating) we see the (likely) fastest-growing new variants in the UK compared with BA.5.2. BF.7 and BA.2.75.1 have enough samples now to get some kind of handle on their growth advantages, while, as mentioned above, BA.2.75.2 and BA.2.75.5 are less pinned down at the moment.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.2_BF.7_BA.2.75.1_BA.2.75.2_BA.2.75.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, and condition on their sum being $$n$$, then you get a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=439</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=439"/>
		<updated>2022-08-23T20:45:57Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache.&lt;br /&gt;
&lt;br /&gt;
The straight-line graphs here compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 22 August 2022] August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2+S:R346T_BF.3_BF.5_BF.7_BF.11_BA.2.12.1_BA.2.75_BA.2.75.1_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;&lt;br /&gt;
http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2+S:R346T_BF.3_BF.5_BF.7_BF.11_BA.2.12.1_BA.2.75_BA.2.75.1_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the graph below (self-updating) we see a selection of some of the fastest-growing new variants in the UK matched up against BA.5* (the different BA.5*s being amalgamated to avoid too much clutter, even though they each have slightly different growth rates).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.5.2+S:R346T_BA.2.75.1_BF.7.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.5.2+S:R346T_BA.2.75.1_BF.7.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, and condition on their sum being $$n$$, then you get a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=438</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=438"/>
		<updated>2022-08-23T20:42:45Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Subsection: Dirichlet-Multinomial fit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache.&lt;br /&gt;
&lt;br /&gt;
The straight-line graphs here compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 2022-08-22]: August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2+S:R346T_BF.3_BF.5_BF.7_BF.11_BA.2.12.1_BA.2.75_BA.2.75.1_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;&lt;br /&gt;
http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2+S:R346T_BF.3_BF.5_BF.7_BF.11_BA.2.12.1_BA.2.75_BA.2.75.1_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the graph below (self-updating) we see a selection of some of the fastest-growing new variants in the UK matched up against BA.5* (the different BA.5*s being amalgamated to avoid too much clutter, even though they each have slightly different growth rates).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.5.2+S:R346T_BA.2.75.1_BF.7.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.5.2+S:R346T_BA.2.75.1_BF.7.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, and condition on their sum being $$n$$, then you get a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. The present model (used by [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py]) has a single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=437</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=437"/>
		<updated>2022-08-23T20:36:44Z</updated>

		<summary type="html">&lt;p&gt;Alex: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
Most of the graphs in this section should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache.&lt;br /&gt;
&lt;br /&gt;
The straight-line graphs here compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
[Time of writing: 2022-08-22]: August has been a quiet Covid month in the UK, with cases and hospitalisations dropping off nicely, as none of the new variants have had time to bed in and cause significant extra growth in cases. However, September is probably going to get more dramatic, with lots of new, fitter, variants vying for position. We saw that vanilla BA.2.75 (&amp;quot;Centaurus&amp;quot;) was a damp squib in the UK, but one of its successors, BA.2.75.1 (with the mutation S:D574V) is now growing rapidly here, as are some other variants with the S:R346T mutation such as BF.7. These and others may lead to a new wave of cases around late September or October, though there is considerable uncertainty in this at the moment.&lt;br /&gt;
&lt;br /&gt;
Regarding variants &amp;quot;bedding in&amp;quot;, as mentioned above, for a new variant to make itself felt in the growth of all new cases per day, it has to do two things: it has to grow faster than other variants, and it also has to grow enough in relative terms to reach a decent proportion of all variants. The fact that its growth advantage is mentioned twice here means that it&#039;s the &#039;&#039;square&#039;&#039; of its growth advantage that&#039;s the important quantity in determining whether it will be able to have a significant influence within a reasonable time frame, say three months. (The first power of the growth advantage would measure what influence it has in a hypothetical infinite time frame, but that is unrealistic because after a few months it&#039;s quite possible that other new variants will have arisen.) This means that there is a steep change in how much influence a variant has as a function of its growth advantage, because squaring a small quantity makes it really small. In practice this means that a growth advantage of 2-3% or so is small potatoes and isn&#039;t likely to cause a major change, whereas something like 10% (roughly the advantage the BA.5* family had over BA.2*) is really big and may well lead to a new wave of cases (though this depends on a number of other factors too).&lt;br /&gt;
&lt;br /&gt;
We can quantify this variant effect more systematically with something I&#039;m going to call variant pressure, for the sake of a name. (Apologies if this quantity already has a different name.) It measures the influence of variants on the change in growth rate of new cases, and its units are &amp;quot;per day per day&amp;quot; or &amp;quot;proportional change per day per day&amp;quot;. More details about this in the [[#Technical_details|technical section]] below, but just to mention, something slightly nice has happened here because we&#039;re able to cut the forecasting problem in two and isolate the piece due to variants - thus avoiding the difficult piece that depends on people&#039;s contact patterns, changing levels of population immunity, the weather, etc - and then predict that piece using only &#039;&#039;relative&#039;&#039; information about the numbers of each variant. That is, we don&#039;t need to know the overall number of infections, just the number of each variant that ended up being sequenced. That&#039;s nice because this relative information (like the number of new cases of variant A divided by the number of variant B) is much more stable and predictable than the absolute information (the number of actual infections of variant A).&lt;br /&gt;
&lt;br /&gt;
This relies on a number of assumptions, as detailed in the [[#Technical_details|technical section]] below, but the most important caveat is that the process relies on identifying all the relevant variants for the time period in question. If a fast-spreading variant is missing from the list then the projection will only be valid up to the point that that variant reaches a noticeable proportion of all variants. In normal times, this would usually allow decent variant predictions maybe two or so months ahead, but at the time of writing (22 August 2022), there are a number of new fast-spreading variants arriving on the scene, so it&#039;s probably best to limit the prediction horizon to one month only. This in turn may indicate something about the growth of new Covid cases up to two months ahead.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2+S:R346T_BF.3_BF.5_BF.7_BF.11_BA.2.12.1_BA.2.75_BA.2.75.1_BA.2*_BA.4*_BA.5*.variantpressure.png &amp;lt;img src=&amp;quot;&lt;br /&gt;
http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BA.5.2+S:R346T_BF.3_BF.5_BF.7_BF.11_BA.2.12.1_BA.2.75_BA.2.75.1_BA.2*_BA.4*_BA.5*.variantpressure.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the above (self-updating) graph, the area under the curve represents the change in proportional growth rate (of new cases per day). For example, the area from 2022-05-30 to 2022-06-13 is roughly 0.3%*14=4.2%, which means the proportional growth rate (of new cases per day) at 2022-06-13 is 4.2 percentage points per day higher than it would have been if the variant mixture hadn&#039;t changed between 2022-05-30 and 2022-06-13. It could be that the growth rate on 2022-06-13 was the same as on 2022-05-30, but if so, that would be because other effects, such as increased immunity in the population, have caused a reduction in the growth rate by 4.2 percentage points, thereby cancelling out the variant-caused growth rate increase.&lt;br /&gt;
&lt;br /&gt;
What we&#039;re seeing in the above graph is the variant pressure wave in May-June 2022 (mainly due to BA.4*, BA.5* taking over from BA.2*) that eventually lead to the summer wave of infections a month or so later in June-July 2022. We&#039;re also see a prediction to the right of the dashed line of another variant pressure wave in September 2022 as the new variants start to take over from the ordinary BA.5*, though there is currently (time of writing 22 August 2022) a large degree of uncertainty as to how big it will be (the shaded regions are a 95% confidence band at each time step). This uncertainty band should gradually narrow over the next week or two.&lt;br /&gt;
&lt;br /&gt;
The graph below (not self-updating) shows how waves of variant pressure have come ahead of waves of infections, in each case by about four weeks. (The Spring wave was largely BA.2* and the Summer wave BA.5*.) Of course this doesn&#039;t of itself establish a causal relationship, but it is at least consistent with one.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/varpressureinfectiongraph.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
In the graph below (self-updating) we see a selection of some of the fastest-growing new variants in the UK matched up against BA.5* (the different BA.5*s being amalgamated to avoid too much clutter, even though they each have slightly different growth rates).&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.5.2+S:R346T_BA.2.75.1_BF.7.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.5.2+S:R346T_BA.2.75.1_BF.7.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Technical details =&lt;br /&gt;
&lt;br /&gt;
The input information (directly observed) is $$n_i(t)$$ = the number of sequenced variant $$i$$ at time $$t$$ (in units of days). Let $$n(t)=\sum_i n_i(t)$$ = total number sampled on day t.&lt;br /&gt;
&lt;br /&gt;
As a matter of notation, let $$N_i(t)$$ = the number of infections of variant $$i$$ at time $$t$$, and $$N(t)=\sum_i N_i(t)$$, thought these are treated as unobserved.&lt;br /&gt;
&lt;br /&gt;
The basic assumption is that $$n_i(t)$$ and $$N_i(t)$$ are both of this form: $$n_i(t)=\exp(a_i+b_it)f(t)$$ and $$N_i(t)=\exp(a_i+b_it)F(t)$$, at least locally in $$t$$. (Or more precisely, sampled from a distribution with these means, but we&#039;re not going to maintain this distinction here.) See [[#Subsection:_discussion_about_basic_assumption|assumptions section]] below for why we might expect this to work. An alternative form of the assumption is $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))=0$$, and similarly for $$N_i(t)$$, and a more relaxed version would only require that $$\frac{d^2}{dt^2}\log(n_i(t)/n_j(t))$$ be &amp;quot;small&amp;quot;, which leads to more general kinds of fits, such as splines. In any case, the linear approximation, $$a_i+b_it$$ is often (though not always), a good approximation locally (e.g., for a period of a few months), assuming we&#039;ve accounted for all the relevant variants.&lt;br /&gt;
&lt;br /&gt;
Note that $$a_i$$ and $$b_i$$ are defined up to the addition of overall constants, $$a$$ and $$b$$, since we can absorb $$\exp(a+bt)$$ into $$f(t)$$.&lt;br /&gt;
&lt;br /&gt;
A key point is that $$a_i$$ and $$b_i$$, the relative growth and offset of each variant, can usually be accurately estimated, whereas $$f(t)$$ and $$F(t)$$ contain all the difficult stuff: they vary according to people&#039;s changing behaviour (contact rates, testing, isolating etc), immunity levels which can go up and down, propensity to test, sequencing capacity, day of the week, public holidays, the weather, and so on. That&#039;s why it&#039;s hard to predict the number of cases, but plotting $$\log(n_i(t)/n_j(t))$$ tends to give very nice straight lines (see e.g. [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated|historical graphs below]]). It&#039;s like a cheap blinded randomised control trial: the assumption is that everything is independent of what variant you are infected with, apart from the infectiousness of the variant.&lt;br /&gt;
&lt;br /&gt;
We can estimate $$a_i$$ and $$b_i$$ using a multinomial fit, where you condition on $$n(t)$$ and for each $$t$$ assume that $$n_i(t)$$ are distributed multinomially with probabilities $$p_i(t)$$ proportional to $$\exp(a_i+b_it)$$. Another way to think of this in terms of data compression is that someone tells you each $$n(t)$$, and you have to output $$n_i(t)$$ as compactly as possible. This makes use of the readily-available information and throws away the hard-to-use information, because, as discussed above, the total number of sequenced cases, $$n(t)$$, can vary unpredictably. &lt;br /&gt;
&lt;br /&gt;
The program used here, [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py], uses a Dirichlet-multinomial distribution, which is a slight generalisation of the multinomial distribution that can account for &amp;quot;overdispersion&amp;quot;. It&#039;s a bit like: it does a multinomial fit, then looks at how well the data actually fits according to that model, and if that isn&#039;t very well, it adjusts its vision to be more blurry. Details in [[#Subsection:_Dirichlet-Multinomial_fit|Dirichlet-Multinomial fit]] subsection.&lt;br /&gt;
&lt;br /&gt;
Let $$Z(t) = \sum_i \exp(a_i+b_it)$$.&lt;br /&gt;
From $$N(t)=Z(t)F(t)$$, we have \[\frac{d}{dt} \log(N(t)) = \frac{d}{dt} \log(Z(t)) + \frac{d}{dt} \log(F(t)).\]&lt;br /&gt;
This separation suggests an interpretation:&lt;br /&gt;
&lt;br /&gt;
\[\text{(proportional growth in infections) = (proportional growth in cases due to variants) + (proportional growth in cases due to everything else)}\]&lt;br /&gt;
&lt;br /&gt;
$$Z(t)$$ is defined up to multiplication by $$\exp(a+bt)$$, so $$\frac{d}{dt}\log(Z(t))$$ is defined up to addition of a constant, and&lt;br /&gt;
\[P(t)=\frac{d^2}{dt^2}\log(Z(t)),\]&lt;br /&gt;
the quantity that was called &amp;quot;variant pressure&amp;quot; in the [[#Self-updating_graphs_showing_current_situation| previous section]], is well-defined and has the interpretation as &amp;quot;change in proportional growth in cases due to variants&amp;quot;, by way of this equation:&lt;br /&gt;
\[\text{(change in proportional growth in infections) = (change in proportional growth in cases due to variants) + (change in proportional growth in cases due to everything else)}.\]&lt;br /&gt;
&lt;br /&gt;
Note that&lt;br /&gt;
\[\frac{d}{dt}\log(Z(t)) = \sum_i b_i\exp(a_i+b_it) / Z(t),\] which has the interpretation as the expected value of the growth, $$b_i$$, if you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
And \[\frac{d^2}{dt^2}\log(Z(t)) = Z(t)^{-1}\sum_i b_i^2\exp(a_i+b_it) - \left(Z(t)^{-1}\sum_i b_i\exp(a_i+b_it)\right)^2,\]&lt;br /&gt;
which has the interpretation as the variance of the growth, $$b_i$$, if again you choose a random variant at time $$t$$ with probability $$\exp(a_i+b_it)/Z(t)$$.&lt;br /&gt;
&lt;br /&gt;
One nice thing is that $$P(t)$$, which can be interpreted as change in growth rate due to variants, is a function of only the $$a_i$$ and $$b_i$$ (up to an overall constant each), for which estimation/prediction tends to be fairly accurate, and doesn&#039;t rely on estimating the $$f(t)$$ or $$F(t)$$ bit, which is difficult to do.&lt;br /&gt;
&lt;br /&gt;
Another nice thing is that $$P(t)$$ doesn&#039;t actually rely on the decomposition $$N_i(t)=\exp(a_i+b_it)F(t)$$ to &#039;&#039;define&#039;&#039; it, only to interpret it. That means that you can define $$P(t)$$ in a context where you don&#039;t assume that the variant-dependent bit has the form $$\exp(a_i+b_it)$$. In general, if $$p_i(t)$$ is any smooth fit of $$n_i(t)/n(t)$$, (generalising $$p_i(t)=\exp(a_i+b_it)/Z(t)$$, which we won&#039;t use) then we can define&lt;br /&gt;
&lt;br /&gt;
\[P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2.\]&lt;br /&gt;
&lt;br /&gt;
Why does that definition make sense? Because it is equal to&lt;br /&gt;
\[\sum_i p_i \left(\frac{d}{dt} \log(p_i(t))\right)^2 - \left(\sum_i p_i \frac{d}{dt}\log(p_i(t))\right)^2,\]&lt;br /&gt;
which is the variance of $$\frac{d}{dt} \log(p_i(t))$$ if you choose variant $$i$$ with probability $$p_i(t)$$. Since variance is unchanged by adding an overall constant, this expression is also the variance of $$\frac{d}{dt}\log(p_i(t)g(t))$$ for any function $$g(t)$$, which means for any $$t$$, if there is any decomposition (which you don&#039;t need to work out) that puts $$p_i(t)g(t)$$ locally in the (approximate) form $$\exp(a_i+b_it)$$ then $$P(t)$$ will be (approximately) equal to $$\sum_i p_i(t)b_i^2 - \left(\sum p_i(t)b_i\right)^2 = \frac{d^2}{dt^2}\log(\sum_i\exp(a_i+b_it))$$, as before.&lt;br /&gt;
&lt;br /&gt;
For example, if you are doing a spline fit instead of just $$\exp(a_i+b_it)$$, say $$n_i(t)=\exp(\sum_j b_{ij}s_j(t))f(t)$$, where $$s_j(t)$$ are spline basis functions ($$s_0(t)=1$$, $$s_1(t)=t$$ would recover the simple linear version), then you can define $$p_i(t)=\exp(\sum_j b_{ij}s_j(t))/\sum_i \exp(\sum_j b_{ij}s_j(t))$$, and $$P(t)=\sum_i p_i(t)^{-1}\left(\frac{dp_i(t)}{dt}\right)^2$$. &lt;br /&gt;
&lt;br /&gt;
== Subsection: discussion about basic assumption ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above, what usually makes $$n_i(t)=\exp(a_i+b_it)f(t)$$ a good approximation is that (when it works) it&#039;s a bit like a blinded randomised control trial, the idea being that everything is independent of what variant you are infected with, apart from the infectiousness of the variant. Recapping these assumptions plus some others: &lt;br /&gt;
&lt;br /&gt;
# People&#039;s behaviour (contacts, testing, isolating etc) is the same regardless of what variant they are infected with.&lt;br /&gt;
# Sequencing probability is independent of variant.&lt;br /&gt;
# There is no Simpson&#039;s paradox (subpopulation confounding: where one variant is concentrated in a region or age group or other subset of the population with a different overall growth rate).&lt;br /&gt;
# The variants have the same generation times (and more generally, variants&#039; infectivity as a function of time since infection is meant to differ only by an overall constant)&lt;br /&gt;
# The pool of susceptible people is the same for each variant, or at least there is no big differential (one variant compared to another) change in immunity over the time period which is being studied&lt;br /&gt;
&lt;br /&gt;
Broadly speaking we&#039;d like to say that, $$N_i(t)$$, the number of new infections of variant $$i$$ at time $$t$$ behaves something like&lt;br /&gt;
\[N_i(t)=R_i N_i(t-T)S(t),\]&lt;br /&gt;
where $$T$$ is an effective generation time and $$S(t)$$ is the (common) number of susceptibles at time $$t$$, multiplied by behavioural factors (contact rates etc) common to all variants. This ends up as roughly $$N_i(t)=R_i^{t/T}S(t)S(t-T)\ldots N_i(0)$$, i.e., $$N_i(t)=\exp(a_i+b_it)F(t)$$, which is the basic assumption. (The generation times don&#039;t necessarily have to be the same, but that is the easiest form to reason with.)&lt;br /&gt;
&lt;br /&gt;
These are a lot of assumptions, and we can&#039;t be sure they will hold, but you seem to get pretty good straight lines a lot of the time if you plot $$\log(n_i(t)/n_j(t))$$ (see e.g., [[#Graphs_below_featuring_disappearing_or_less_significant_lineages_are_no_longer_updated| historical fits]]), which is some evidence that the assumptions are reasonable.&lt;br /&gt;
&lt;br /&gt;
One occasion where this relationship appeared to go wrong was the Delta to Omicron transition in December 2021, as remarked on [[Estimating_Generation_Time_Of_Omicron|here]]. This may have been partly due to a different generation time of Omicron, in conjunction with people significantly cutting down on contacts. If so, then we probably won&#039;t see such this particular effect again, as people have not been changing their contact patterns en masse in response to Covid-19 since around Spring 2022. This more homogeneous behaviour may also reduce the effect of a Simpson&#039;s paradox effect.&lt;br /&gt;
&lt;br /&gt;
== Subsection: Dirichlet-Multinomial fit ==&lt;br /&gt;
&lt;br /&gt;
If $$p_i(t)$$ is the probability of variant $$i$$ at time $$t$$, as given by some fitting process, such as $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, then the multinomial probability of $$n_i(t)$$, conditioned on $$n(t)$$, is&lt;br /&gt;
&lt;br /&gt;
\[\prod_t\left\{\binom{n(t)}{n_1(t)\ldots n_k(t)}\prod_i p_i(t)^{n_i(t)}\right\}.\]&lt;br /&gt;
&lt;br /&gt;
The above multinomial distribution is (dropping the $$t$$ suffix for the moment) equivalent to each $$n_i$$ being an independent Poissons of rate $$\lambda p_i$$, conditioned on them all summing to $$n$$. The negative binomial distribution is a popular way to get a family of distributions that generalises the Poisson in such a way that gives a parameter that allows control over the variance divided by the mean. If $$n_i$$ are independent negative binomials, $$\text{NB}(\lambda p_i,p)$$, with a common $$p$$ (success probability) that won&#039;t matter and a parameter $$\lambda$$ to be decided on later, and condition on their sum being $$n$$, then you get a Dirichlet-Multinomial distribution with parameters $$n$$ and $$\lambda p_i$$.&lt;br /&gt;
&lt;br /&gt;
The variance of $$n_i$$ is then equal to $$n p_i(1-p_i)(n+\lambda)/(1+\lambda)$$, a factor of $$(n+\lambda)/(1+\lambda)$$ bigger than it would be under a multinomial distribution. This model has as single overdispersion multiplier, $$m$$, and $$\lambda$$ is chosen to set each factor of $$(n+\lambda)/(1+\lambda)$$ equal to $$m$$, i.e., $$\lambda=(n-m)/(m-1)$$. So in full, the model has parameters $$a_i$$, $$b_i$$ (defined up to overall additive constants) and $$m$$, and the likelihood is defined by $$p_i(t)=\exp(a_i+b_it)/\sum_j\exp(a_j+b_jt)$$, $$\lambda(t)=\max((n(t)-m)/(m-1),0.001)$$, and then for each $$t$$, $$n_i(t)$$ are distributed Dirichlet-Multinomial with parameters $$n(t)$$ and $$\lambda(t)p_i(t)$$.&lt;br /&gt;
&lt;br /&gt;
A justification for adjusting the extra parameter $$\lambda(t)$$ in such a way as to keep $$(n+\lambda(t))/(1+\lambda(t))$$ constant, is that a variance multiplier, $$m$$, is the effect you&#039;d expect from clustered observations: if observations tended to come in bunches of size $$m$$. In practice, though, the extra parameter $$m$$ &amp;quot;blurs&amp;quot; the distribution and gives the model a general way to cushion the impact of any aspect of it that is not quite right. It often seems to want to use values of $$m$$ between $$2$$ and $$4$$, which, roughly speaking, widens the credible intervals by a factor of between $$\sqrt{2}$$ and $$2$$. For what it&#039;s worth, and as far as I can judge by &amp;quot;feeling&amp;quot;, the credible intervals so obtained do generally look like plausible representations of the uncertainty that is present.&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring disappearing or less significant lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=436</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=436"/>
		<updated>2022-08-11T15:09:19Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 2,000 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slightly slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-11: This is an estimate of the effect of the changing mixture of variants on the overall growth rate of new cases per day, projected forward 50 days. It shows the average growth rate of a variant (in percentage increase per day), weighted by the proportional prevalence of that variant. Note that (at the time of writing) the large majority of the expected increase has already happened, mainly as a consequence of the BA.4/5* variants taking over from the BA.2* variants. The forthcoming growth increase is predicted to be a relatively modest 1% over the next 50 days, because it takes a long time for the stronger variants BA.5.2, BA.4.6, BF.5, to increase their share of the mix, and some of their effect is already priced in. Note also that this only predicts the change in overall growth rate due to the change in variant mixture, and other effects (such as waning immunity) could be larger, but are outside the scope of this variant analysis. This projection requires that all significant variants are incorporated in the mix, so is valid only as long as we believe that a brand new variant won&#039;t have become a significant proportion of the mix, which seems a reasonable bet for 50 days but obviously isn&#039;t guaranteed. It also requires the relative log linear growth approximation (the thing that makes all the variant vs variant lines on this page roughly straight) to hold for 50 days.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
(The reason the best fit line is below almost all of the purple dots is that there are many days with no occurrences of BA.2.75 that would be below the best fit line, but these can&#039;t be shown on the log chart.)&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=Estimating_Generation_Time_Of_Omicron&amp;diff=435</id>
		<title>Estimating Generation Time Of Omicron</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=Estimating_Generation_Time_Of_Omicron&amp;diff=435"/>
		<updated>2022-08-09T12:38:58Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Generation Time of the Omicron Variant based on case counts in England in 2021 =&lt;br /&gt;
&lt;br /&gt;
[[About_Me |Alex Selby]] / [https://twitter.com/alexselby1770 @alexselby1770]&lt;br /&gt;
&lt;br /&gt;
= Abstract =&lt;br /&gt;
&lt;br /&gt;
There has been speculation that part of the advantage the Omicron variant has over Delta is that it has a significantly shorter generation period. It is important to establish whether or not this is the case because models of the epidemic with this as a default assumption will make substantially different predictions from those without. This will have implications for policies, such as those aimed at combatting virus spread and allocating hospital resources. A shorter generation time would mean, for example, that Omicron&#039;s transmission advantage is lower than it otherwise would be which in turn would mean that restrictions (NPIs, reduction of contacts) ought to have a disproportionately successful effect on reducing spread. It would also suggest that a person&#039;s infectious period typically starts earlier and is shorter than otherwise expected, which would have implications for contact tracing and quarantine. Another consequence of a lower generation time is that we would expect the epidemic, if unmitigated by restrictions, to be over more quickly than it otherwise would be.&lt;br /&gt;
&lt;br /&gt;
In this article we consider the sequence of Delta and Omicron daily case counts and highlight a particular striking pattern of growth in new cases per day: the daily growth rates, $$g_\Delta(t)$$ and $$g_\O(t)$$ of Delta and Omicron respectively in England from 25 November - 24 December 2021 are related to a good approximation by $$g_\O(t)=0.483+3.391g_\Delta(t)$$ (95% CI for the gradient: 2.788 - 3.663). One possible explanation for the gradient of this line being so much larger than 1 (or, more precisely, $$1+0.483\theta_\Delta$$ - see below) is that the generation time of Omicron is much smaller than that of Delta.&lt;br /&gt;
&lt;br /&gt;
The above relationship between characteristics of Delta and of Omicron is inferred from variant case counts only. If we go further and make use of previous estimates of characteristics of Delta, then we can estimate those of Omicron. In this article we consider the generation time distribution of Delta from [https://www.medrxiv.org/content/10.1101/2021.10.21.21265216v1 Hart et al, Oct 2021]. Combined with the above linear relationship, these suggest that the generation time of Omicron is 46% (38% - 60%) that of Delta, or 2.12 (1.75 - 2.77) days, and that the relative transmissibility in England in December 2021, $$R_t(\O)/R_t(\Delta)$$, was 2.28 (2.03 - 2.68), lower than some early estimates that did not consider a different generation time.&lt;br /&gt;
&lt;br /&gt;
We then consider alternative possible explanations for the observed pattern of growth.&lt;br /&gt;
&lt;br /&gt;
Additional note (opinion): it is possible that a lower generation time for Omicron is part of the explanation for the observed relationship between $$g_\O(t)$$ and $$g_\Delta(t)$$, but it seems unlikely that the generation time of Omicron during this period was quite as low as 2.12 days, given what we know about the the viral load of Omicron as a function of time (e.g., [https://dash.harvard.edu/handle/1/37370587 Hay et al, Jan 2022] observe 4.52 days from first possible detection to peak viral concentration). Some possible reasons for this discrepancy are given in the limitations section below.&lt;br /&gt;
&lt;br /&gt;
Note that here and throughout, confidence intervals only show statistical variation within the given model. It is possible there are larger sources of error due to an incorrect modelling assumption, as discussed in limitations below.&lt;br /&gt;
&lt;br /&gt;
= Linkage of growth rates and generation times =&lt;br /&gt;
&lt;br /&gt;
If $$\Delta_0, \Delta_1, \Delta_2, \ldots$$ and $$\O_0, \O_1, \O_2, \ldots$$ are the respective daily time series of Delta and Omicron confirmed case counts - or otherwise estimated infection numbers - in some location, then a simple model of change that assumes the variants have the same generation time and other characteristics is that they grow at respective time-varying continuous rates $$g_\Delta(t)$$ and $$g_\O(t)$$ which differ by a constant, $$h$$, say. The growth rates&#039; time dependence is meant to account for changes in people&#039;s propensity to test, changes in case ascertainment rates (proportion of infections that are confirmed by a positive test) and changes in behaviour leading to increases or reductions in contacts, where in each case such changes are assumed to affect each variant equally. These assumptions lead to the identity $$\O_t/\Delta_t=Ce^{ht}$$ for some constant, $$C$$ and this approximation has proved successful in the past in determining the relative growth rate, $$h$$, between two variants, by simply plotting $$\log(\O_t/\Delta_t)$$ and finding the slope of (some version of) the best-fit line.&lt;br /&gt;
&lt;br /&gt;
However, in past variant transitions such as Alpha-Delta in May 2021, the straight line relationship has sometimes appeared to bend over slightly as time has gone on, or otherwise slightly deviated from a single straight line. In the present case of the Delta-Omicron transition, there is a quite marked bending, as illustrated in Fig. 1 which is constructed from the ratio of estimates of Omicron to Delta on each day, using the SGTF proxy (which is known to be highly accurate for Omicron in the UK, apart from a small background rate of SGTF that is noticeable early on in Omicron&#039;s appearance, and to some extent has been adjusted for here). Fig. 2 goes a bit further and makes use of case counts in addition to variant proportions to estimate the growth rates of Delta and Omicron separately. This also suggests that $$g_\O(t)-g_\Delta(t)$$ is positively correlated with $$g_\Delta(t)$$, though case counts during the last week of December should be interpreted with more caution owing to unusual testing patterns and possible limitations of testing capacity. (Note that the analysis in Fig. 2 is just for illustration/motivation here and is not relied upon in this article.)&lt;br /&gt;
[[File:Deltaomicron.png|500px|thumb|&#039;&#039;Fig. 1 (click to enlarge)&#039;&#039;]]&lt;br /&gt;
[[File:Fit_England_R.png|500px|thumb|&#039;&#039;Fig. 2 (click to enlarge)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
This effect, a positive correlation between $$g_\O(t)-g_\Delta(t)$$ and $$g_\Delta(t)$$, is what one would expect to see if Omicron&#039;s generation period were lower than Delta&#039;s. That is because instead of $$g_\O(t)-g_\Delta(t)$$ being constant, it is more natural to suppose that $$R_t(\O)/R_t(\Delta)$$ is constant: for example, if you halve the number of people you meet, then other things being equal, you are on average likely to halve the number of people you infect, which is to say, reduce $$R_t(\O)$$ or $$R_t(\Delta)$$ by the same factor. Similarly, other forms of &amp;quot;noise&amp;quot;, such as changes in propensity to test, would also be expected to have a proportional effect on the apparent values of $$R_t$$. In the simplest possible approximation that allows for different generation times, we&#039;d have $$R_t(\Delta)=e^{T_\Delta g_\Delta}$$ where $$T_\Delta$$ is the generation time of Delta, and a similar equation for Omicron, which implies $$T_\Delta g_\Delta-T_\O g_\O$$ is constant.&lt;br /&gt;
&lt;br /&gt;
A linear relationship between $$g_\Delta$$ and $$g_\O$$, though with different coefficients, would still be expected to hold under slightly more general conditions, and this is what we consider in this article. The standard relationship between $$R$$, $$g$$ and generation time distribution $$T$$ is $$R\mathbb E[e^{-gT}]=1$$, and a popular and convenient family of positive distributions with two free parameters to use for $$T$$ is the Gamma family. In shape-scale notation, if $$T\sim\Gamma(k,\theta)$$, then $$R=(1+g\theta)^k$$. If we suppose $$T_\Delta$$ and $$T_\O$$ have the same shape parameter, $$k$$, then $$R_t(\O)/R_t(\Delta)$$ being constant would still lead to a linear relationship between $$g_\Delta(t)$$ and $$g_\O(t)$$. Provided we have a decently varied supply of pairs $$(g_\Delta(t),g_\O(t))$$ of reasonable quality, we should be able to discover this linear relationship, and hence get a relationship between $$k$$, $$\theta_\O$$, $$\theta_\Delta$$ and $$R_t(\O)/R_t(\Delta)$$. If we are additionally willing to make use of previously estimated values of $$\theta_\Delta$$ and $$k_\Delta$$, then we can estimate $$\theta_\O$$ and $$R_t(\O)/R_t(\Delta)$$, hence arriving at an estimate for the generation time of Omicron and its current transmission advantage over Delta.&lt;br /&gt;
&lt;br /&gt;
There is no reason in principle why we can&#039;t estimate parameters in the wider situation of $$k_\O\neq k_\Delta$$, but there is a question of how much information the data is powered to yield, and trying for an extra parameter like this is probably pushing it. Furthermore, the relationship between $$g_\O$$ and $$g_\Delta$$ does look pretty linear (see Fig. 3 below), so there is probably not much advantage/justification in positing this particular extra parameter right now.&lt;br /&gt;
&lt;br /&gt;
= Making estimates of growth pairs =&lt;br /&gt;
&lt;br /&gt;
To estimate the generation time in the manner suggested above, we just collect enough examples of pairs $$(g_\Delta(t),g_\O(t))$$ and then apply some suitable inference to find the relationship, though this requires a little care as $$g_\Delta(t)$$ and $$g_\O(t)$$ are not directly measurable. In the end, the cleanest/most powerful method the author has found is to use instances of $$(\frac17\log(\Delta_{t+7}/\Delta_t), \frac17\log(\O_{t+7}/\O_t))$$, where these are taken separately over the nine regions of England, and $$t+7&amp;lt;\text{2021-12-25}$$. The reasons for these choices are:&lt;br /&gt;
* We get more statistical power, less autocorrelation, and a greater assurance that the eventual relationship is consistent, by subdividing the data over regions.&lt;br /&gt;
* Testing and reporting is significantly distorted from Christmas day, so it makes sense to censor at this point. We already have enough variation in $$g_\Delta$$ by then to make the inference (an inverse problem) well-posed.&lt;br /&gt;
* Taking a week long period reduces the danger that the errors in the estimates for each of $$g_\Delta(t)$$ and $$g_\O(t))$$ are correlated (likely positively) which would mess up the estimate. For example, using the estimates $$(\log(\Delta_{t+1}/\Delta_t), \log(\O_{t+1}/\O_t))$$ would introduce a distortion in each co-ordinate which would be strongly positively correlated with each other because testing has a dependency on the day of the week. This would tend to bias the coefficients of the inferred linear relationship between $$g_\Delta$$ and $$g_\O$$ to be more equal to each other than they should be.&lt;br /&gt;
* Aside from the day-of-week effect, taking the average over a longer period than 1 day reduces other systematic errors in the estimate of $$(g_\Delta(t),g_\O(t))$$, which might occur randomly, but nevertheless be correlated across variants. For example if people decide for whatever reason to do more testing on one day, then this is likely to increase both $$\Delta_t$$ and $$\O_t$$.&lt;br /&gt;
&lt;br /&gt;
Another way to do this might be to subdivide over age, rather than over region of England, but it turns out this doesn&#039;t work so well with the currently available public data. More on this in the &amp;quot;Alternative explanations&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
= Definition of $$\Delta_t$$ and $$\O_t$$ =&lt;br /&gt;
&lt;br /&gt;
Let $$S^\text{raw}_-(t)$$ and $$S_+(t)$$ be the respective S-gene negative and positive counts in a given region of England (all variables here depend on the region of England, but region labels suppressed), obtained from the [https://www.gov.uk/government/publications/covid-19-omicron-daily-overview 31 December 2021 Omicron daily overview].&lt;br /&gt;
&lt;br /&gt;
Let $$B_-$$ and $$B_+$$ be the average values of these over the period 2021-10-01 to 2021-11-09, taken to be comfortably before the onset of Omicron, but also recent enough to be representative of the current mix of variants and current testing conventions.&lt;br /&gt;
&lt;br /&gt;
Let $$S_-(t)=\max(S^\text{raw}_-(t)-(B_-/B_+)S_+(t),0)$$, attempting to adjust for the background level of SGTF. In practice this adjustment only makes a noticeable difference in the early stages of Omicron, the last week in November for most areas of the country, and shouldn&#039;t make a huge difference to the overall estimates since points with low counts of $$S_\pm(t)$$ are down-weighted in the regression (see below).&lt;br /&gt;
&lt;br /&gt;
Let $$C(t)$$ be the confirmed case count by specimen day $$t$$ in a particular region of the country.&lt;br /&gt;
&lt;br /&gt;
Let &lt;br /&gt;
&lt;br /&gt;
\[\Delta_t=C(t)\frac{S_+(t)}{S_+(t)+S_-(t)}\]&lt;br /&gt;
\[\O_t=C(t)\frac{S_-(t)}{S_+(t)+S_-(t)}\]&lt;br /&gt;
&lt;br /&gt;
Only days for which $$S_-(t)\ge5$$ and $$S_+(t)\ge5$$ are used here, to reduce the influence of travel cases and other early artefacts, and only days ($$t$$) before 2021-12-25 are used, to avoid the highly anomalous Christmas testing period.&lt;br /&gt;
&lt;br /&gt;
One could think of using $$S_{\pm}(t)$$ unadjusted, i.e., $$\Delta_t=S_+(t)$$, $$\O(t)=S_-(t)$$, but it appears that tests in a particular region at a particular time are sometimes prioritised for TaqPath labs (capable of detecting SGTF) and sometimes not, so using raw $$S_+(t)$$, $$S_-(t)$$ would create a significant distortion in growth rates as defined above. For example, in the West Midlands on the 4th and 11th December 2021 there were respectively 797 and 2404 cases that had reported SGTF/S-Gene values, compared to 3057 and 3247 confirmed cases overall. That means the proportion of confirmed cases that were sent to TaqPath labs and had viable SGTF/S-gene readings went from 26% to 74% from one week to the next, nearly a factor of 3. The week-on-week change is what is relevant to the above growth rate statistics, but to make it even clearer that this phenomenon is an artefact, the corresponding proportion on 3rd December was 56%, so it dropped by more than a factor of 2 in one day to the 4th December. Note that in all these changes, the number of confirmed cases was roughly stable at around 3000 but the total SGTF/S-Gene-measured cases changed wildly, so it seems highly likely that it&#039;s the latter that is anomalous rather than the former since it&#039;s not really possible for the true number of infections to drop by a factor of 2 in one day and then change back up again the next. Furthermore, using raw counts $$\Delta_t=S_+(t)$$, $$\O(t)=S_-(t)$$ produces much worse fits in the subsequent analysis (i.e., the analogue of Fig. 3 shows a much weaker correlation).&lt;br /&gt;
&lt;br /&gt;
= Regression method and estimates for the generation time of Omicron =&lt;br /&gt;
&lt;br /&gt;
We start by writing $$(x_i,y_i)$$ for all instances of $$(\frac17\log(\Delta_{t+7}/\Delta_t), \frac17\log(\O_{t+7}/\O_t))$$ as $$t$$ ranges over allowable dates (see above), and as the region (suppressed in this notation) ranges over the nine regions of England. There are 147 such pairs.&lt;br /&gt;
&lt;br /&gt;
We are in a situation where both $$x_i$$ and $$y_i$$ have statistical noise, so we have to do something beyond standard regression of $$y$$ on $$x$$ which assumes that $$x$$ is error-free. Another matter to take into account is so-called heteroscedasticity, i.e., that some values are going to be much more uncertain than others if they arise from low $$S_\pm(t)$$ counts.&lt;br /&gt;
&lt;br /&gt;
Here we use approximations to variances (representing the statistical uncertainty in count values):&lt;br /&gt;
\[\mathbb V[\log(\Delta_t)] \approx \frac{1}{C(t)}+\frac{S_-(t)}{S_+(t)(S_+(t)+S_-(t))}\]&lt;br /&gt;
\[\mathbb V[\log(\O_t)] \approx \frac{1}{C(t)}+\frac{S_+(t)}{S_-(t)(S_+(t)+S_-(t))}\]&lt;br /&gt;
which arise asymptotically in the Bayesian picture, if one thinks of $$C(t)$$, $$S_+(t)$$, $$S_-(t)$$ arising from independent Poissons with respective unknown parameters $$c$$, $$s_+$$ and $$s_-$$. Then, given uniform priors, the posteriors of $$c$$, $$s_+$$ and $$s_-$$ would be Gamma distributed: $$\Gamma(C(t)+1,1)$$, $$\Gamma(S_+(t)+1,1)$$, $$\Gamma(S_-(t)+1,1)$$ respectively, with $$\Gamma(k=\text{shape}, \theta=\text{scale})$$ notation, and then&lt;br /&gt;
\[\mathbb V\left[\log\left(\frac{cs_+}{s_++s_-}\right)\right]=\frac{1}{C(t)}+\frac{S_-(t)}{S_+(t)(S_+(t)+S_-(t))}+O(C(t)^{-2})+O(S_+(t)^{-2})+O(S_-(t)^{-2}).\]&lt;br /&gt;
&lt;br /&gt;
If we then assume independence in the measurement uncertainty of $$\log(\Delta_t)$$ and $$\log(\Delta_{t+7})$$, and similarly $$\log(\O_t)$$ and $$\log(\O_{t+7})$$, then we can use the above formulae to arrive at variance estimates $$(v_i,w_i)$$ for each $$(x_i,y_i)$$. The main effect of the variance term will be to downweight those early $$(x_i,y_i)$$ that arise from particularly low counts of $$S_-(t)$$.&lt;br /&gt;
&lt;br /&gt;
Given these variances, we define the best-fit line linking the $$x_i$$ and $$y_i$$ to be $$y=a+bx$$, where $$a$$ and $$b$$ minimise&lt;br /&gt;
\[E(a,b)=\frac12\sum_i\frac{(a+bx_i-y_i)^2}{w_i+b^2v_i}.\]&lt;br /&gt;
&lt;br /&gt;
In the above, $$E(a,b)$$ is the sum of the variance-weighted square distance of each $$(x_i,y_i)$$ to the line $$y=a+bx$$ (so-called &amp;quot;element-wise weighted total least squares&amp;quot;). To make a principled interpretation of this procedure, it arises as the maximum likelihood line if one thinks of generating each $$(x_i,y_i)$$ by first picking a point $$(x^*_i,y^*_i)$$ uniformly on the line then choosing $$(x_i,y_i)$$ to be from a 2d-normal distribution centred on $$(x^*_i,y^*_i)$$ with variances $$(v_i,w_i)$$.&lt;br /&gt;
&lt;br /&gt;
Confidence intervals are obtained using 100,000 samples from a moving-block bootstrap, where a block size, $$r$$, is fixed and sequences of $$(x_i,y_i)$$ corresponding to a particular region of the country and to consecutive days $$t, t+1, \ldots, t+r-1$$ are resampled together. Using a simple bootstrap here, where individual $$(x_i,y_i)$$ are independently resampled, would underestimate the uncertainty because the sequence $$(\frac17\log(\Delta_{t+7}/\Delta_t), \frac17\log(\O_{t+7}/\O_t))$$ has significant autocorrelation. The block length, $$r$$, was chosen conservatively to maximise the width of the confidence intervals, which turned out to be at $$r=7$$. The (adjusted) Durbin-Watson statistic on $$(\frac17\log(\Delta_{t+7}/\Delta_t), \frac17\log(\O_{t+7}/\O_t))$$, with a time difference of $$d$$ days, becomes approximately equal to 2, suggesting no autocorrelation, when $$d$$ is approximately 6, providing some degree of other assurance that a bootstrap with block size of 7 days may be adequate.&lt;br /&gt;
&lt;br /&gt;
At this point we have a supply of samples of $$(a,b)$$, each representing a linear relationship between $$g_\Delta$$ and $$g_\O$$. In the next section we will combine these with estimates of characteristics of Delta to estimate characteristics of Omicron.&lt;br /&gt;
&lt;br /&gt;
The paper [https://www.medrxiv.org/content/10.1101/2021.10.21.21265216v1 Hart et al, Oct 2021] gives estimates for characteristics of Delta and credible intervals for those estimates, namely that the intrinsic generation time of Delta has mean 4.6 (4.0 - 5.4) days and standard deviation 3.1 (3.0 - 3.7) days.&lt;br /&gt;
&lt;br /&gt;
If we assume generation times of Delta and Omicron are each Gamma distributed with a common shape parameter, then we can use the above estimate of the generation time distribution of Delta to arrive at an estimate for that of Omicron. The samples of $$(a,b)$$ representing lines $$g_\O=a+bg_\Delta$$ are matched up with the relationship $$(1+\theta_\O g_\O)^k=\rho(1+\theta_\Delta g_\Delta)^k$$, where $$\rho=R_t(\O)/R_t(\Delta)$$ is the effective transmission ratio. Values of $$a$$, $$b$$, $$\theta_\Delta$$ and $$k$$ give $$\rho=(1-a\theta_\Delta/b)^{-k}$$, $$\theta_\O=\theta_\Delta/(b-a\theta_\Delta)$$.&lt;br /&gt;
&lt;br /&gt;
Note that to make confidence intervals for $$\theta_\O$$ and $$k$$ (equivalently, the mean and standard deviation of the generation time of Omicron), we are combining uncertainty in $$a$$ and $$b$$ from our bootstrap samples, with uncertainty in $$\theta_\Delta$$ and $$k$$ obtained by sampling a representative distribution of the mean and standard deviation of the generation time of Delta implied by [https://www.medrxiv.org/content/10.1101/2021.10.21.21265216v1 Hart et al].&lt;br /&gt;
&lt;br /&gt;
= Results =&lt;br /&gt;
&lt;br /&gt;
Applying the above procedure leads to the estimate $$g_\O(t)=0.483+3.391g_\Delta(t)$$ (95% CI for the gradient: 2.788 - 3.663) for growth rates in England from 25 November - 24 December 2021. A scattergram of $$(x_i,y_i)$$ is shown in Fig. 3, in which the area of a green square is proportional to its inverse total variance over both co-ordinates (so the bigger squares are more important). It is visually clear that there is a good correlation here, though one has to be slightly careful because the autocorrelation in the data is effectively artificially multiplying the samples up by a factor of something like 4.&lt;br /&gt;
&lt;br /&gt;
[[File:Growthcomparison.png|500px|none|thumb|&#039;&#039;Fig. 3 (click to enlarge)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we further use [https://www.medrxiv.org/content/10.1101/2021.10.21.21265216v1 Hart et al] on the characteristics of Delta in the manner described above, we arrive at characteristics of Omicron as shown in this table.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Quantity!!Median (Low - High)&lt;br /&gt;
|-&lt;br /&gt;
|Mean generation time of Delta (from [https://www.medrxiv.org/content/10.1101/2021.10.21.21265216v1 Hart et al])|| 4.631 (3.966 - 5.362)&lt;br /&gt;
|-&lt;br /&gt;
|Standard deviation of gen time of Delta (from Hart et al) ||  3.101 (3.000 - 3.692)&lt;br /&gt;
|-&lt;br /&gt;
|Mean generation time of Omicron || 2.118 (1.745 - 2.771)&lt;br /&gt;
|-&lt;br /&gt;
|Standard deviation of gen time of Omicron ||  1.432 (1.174 - 2.154)&lt;br /&gt;
|-&lt;br /&gt;
|(Mean gen time Omicron)/(Mean gen time Delta)|| 0.456 (0.382 - 0.605)&lt;br /&gt;
|-&lt;br /&gt;
|$$R_t$$(Omicron)/$$R_t$$(Delta) ||  2.284 (2.026 - 2.676)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Limitations and discussion of alternative (i.e., unchanged generation time) explanations for the same observations =&lt;br /&gt;
&lt;br /&gt;
== Bootstrap confidence intervals ==&lt;br /&gt;
&lt;br /&gt;
Though seemingly reasonable, these are not perfectly rigorous in this situation and it is conceivable they are giving a false sense of confidence in the estimates. It may be better to replace this with a fully generative model which has a total likelihood for all observations.&lt;br /&gt;
&lt;br /&gt;
== Subpopulation dynamics/confounding ==&lt;br /&gt;
&lt;br /&gt;
The model described here assumes a single homogeneous population in each region. It is possible, on the other hand, with different growth rates in different subpopulations, to have an overall (totalled over the whole population) relative growth rate of one variant compared to another to vary in time and be different from the (constant) relative growth rate of the two variants in each subpopulation. (This is effectively a continuous Simpson&#039;s paradox.) &amp;quot;Subpopulation&amp;quot; could mean those living in a particular location, those in a particular age band, or it could mean a subdivision that we don&#039;t even know about.&lt;br /&gt;
&lt;br /&gt;
A toy example that assumes equal generation times for each variant, in effect assuming constant growth rate difference, shows what kind of effect is possible: letting $$n_{v,i}(t)$$ represent the number of new cases per day of variant $$v$$ (Delta or Omicron) in subpopulation $$i$$ on day $$t$$, we can assume that $$n_{v,i}(t)$$ decomposes as $$n_{v,i}(t)=n_{v,i}(0)e^{g_vt+h_i(t)}$$ where $$g_v$$ is the growth advantage of variant $$v$$, and $$h_i(t)$$ is the variant-independent growth rate in the subpopulation that represents how cautious about contacts (etc.) that subpopulation is. We have $$\frac{d}{dt}\log(n_{\O,i}(t)/n_{\Delta,i}(t))=g_\O-g_\Delta$$ for each subpopulation, but the relative growth rate of Omicron over Delta for the total over the whole population is&lt;br /&gt;
\[\frac{d}{dt}\log\left(\frac{\sum_i n_{\O,i}(t)}{\sum_i n_{\Delta,i}(t)}\right)=g_\O-g_\Delta+\frac{\sum_i n_{\O,i}(t)\dot{h}_i(t)}{\sum_i n_{\O,i}(t)}-\frac{\sum_i n_{\Delta,i}(t)\dot{h}_i(t)}{\sum_i n_{\Delta,i}(t)}.\]&lt;br /&gt;
In other words the &amp;quot;pure&amp;quot; relative growth rate between variants, $$g_\O-g_\Delta$$ is distorted by the difference of two convex combinations of subpopulation growth rates. The maximum distortion is the maximum difference in subpopulation growth rates, $$\max_i\dot{h}_i(t)-\min_i\dot{h}_i(t)$$. The distortion is positive if Omicron disease prevalence is better correlated with subpopulation growth rates than Delta disease prevalence is, and negative if it&#039;s the other way around.&lt;br /&gt;
&lt;br /&gt;
Could this mechanism explain what we are seeing here? In general it is difficult to know what is going on in all possible subpopulations, but there is some published data stratified by age and variant status, and age would be a good candidate for a relevant subpopulation division as Omicron initially had stronger growth in younger age groups, though this effect only lasted around a week (Fig. 4). A shift from &amp;quot;high-growth high prevalence in the young + low-growth low-prevalence in the old&amp;quot; to &amp;quot;low-growth high prevalence in the young + high-growth low-prevalence in the old&amp;quot; would explain the reduction in $$g_\O-g_\Delta$$, but this would require the old to become more carefree about mixing than the young, which is not impossible but not an obvious hypothesis. If stratifying by age groups deconfounded the relative growth rate in such a way as to allow for the &amp;quot;equal generation time&amp;quot; hypothesis, then we&#039;d expect to see the relative growth of Omicron compared with Delta in each age group to form a straight line on a log scale graph ($$\frac{d}{dt}\log(n_{\O,i}(t)/n_{\Delta,i}(t))=g_\O-g_\Delta$$ in the above notation). However, Fig. 5 arguably shows a levelling-off in several individual age groups from 14 December, which wouldn&#039;t be possible if stratifying by age were sufficient to deconfound the relative growth rate. This could be clarified further if more recent age-variant data were to be published (the most recent at the time of writing being up to 18 December 2021).&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Age-variant-Omicron.png|500px|none|thumb|&#039;&#039;Fig. 4 (click to enlarge)&#039;&#039;]] || [[File:Age-variant-Omicron_to_Delta.png|500px|none|thumb|&#039;&#039;Fig. 5 (click to enlarge)&#039;&#039;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Generation time itself is an approximation at many levels ==&lt;br /&gt;
&lt;br /&gt;
The concept of generation time is in part dependent on behavioural factors: for example, more testing with rapid tests could cause people to isolate earlier which could decrease the effective infectious period. It is possible that there are different subpopulations with different levels of enthusiasm for contact-tracing which would cause different generation times for different people, but these are all mixed together and approximated as a single distribution. We then further approximate this with a particular family of distributions (Gamma), then further approximate again by supposing the shape parameter doesn&#039;t change. (On the plus side, the relationship found in Fig. 3 seems quite strong and predictive, at least over the study period, which suggests all the approximations may not be that terrible. At any rate, it seems worthwhile to give your model this extra parameter to distinguish variants.)&lt;br /&gt;
&lt;br /&gt;
== Unchanging relative immunity to Delta and Omicron ==&lt;br /&gt;
The assumption that the ratio $$R_\O/R_\Delta$$ is constant relies on the population&#039;s relative immunity to Omicron and Delta remaining unchanged over the course of the observed period. How close is this to being true? A full analysis is complicated and relies on knowing details of antibody waning and vaccine efficacies against the two variants, so we only propose to discuss this in broad terms here. The observed period is 25 November - 24 December 2021 and immunity to infections during that period would be generated by vaccinations and infections occurring approximately 1 week earlier, which is to say 18 November - 17 December. During that period there were about 13.2m vaccinations (mostly boosters), about 2.7m Delta infections and 0.6m Omicron infections (assuming a case ascertainment rate of 40%, as suggested by the ONS infection survey during this period). Relative to the population these are about 24%, 5% and 1% respectively. Going in the other direction is antibody waning from past infections and vaccinations, but since the period in question featured an intense vaccination campaign, the loss in immunity over this (short) period will presumably be relatively small compared to the increase in immunity. Due to the immune escape of Omicron against vaccine-induced and Delta-induced antibodies, this extra immunity will be more potent against Delta than Omicron, so will tend to decrease $$R_\Delta(t)$$ more than $$R_\O(t)$$. (There is relatively little Omicron-infection immunity over this period, and in any case [https://pubmed.ncbi.nlm.nih.gov/34981076/ there is some evidence] that Omicron-induced immunity is protective against Delta.)&lt;br /&gt;
&lt;br /&gt;
Note that the direction of this increased immunity is likely to &#039;&#039;diminish&#039;&#039; the effect we are seeing, which involves $$g_\O(t)$$ falling faster than $$g_\Delta(t)$$. If this change in immunity were accounted for then $$g_\Delta(t)$$ and $$g_\O(t)$$ would be revised upwards, but $$g_\Delta(t)$$ more so. In other words, if anything this is an argument in favour of a bigger generation time difference.&lt;br /&gt;
&lt;br /&gt;
As for the size of the effect, 30% (24%+5%+1%) might sound like a lot, but that&#039;s the end-to-end effect. The error is more like 15% from the midpoint in the period, and it&#039;s not as much as that because a vaccination doesn&#039;t change someone from being totally susceptible to both variants to being totally susceptible to Omicron but impervious to Delta. Most vaccinations are of people who already have some degree of immunity (from infection or previous vaccination), and they are still partially effective against catching Omicron, and not totally effective against catching Delta. In summary, it seems likely that taking this effect into account would result in a small increase in the observed effect of the difference in generation times between variants.&lt;br /&gt;
&lt;br /&gt;
== Changes in Case Ascertainment Rate ==&lt;br /&gt;
&lt;br /&gt;
Since the above method relies on being able to measure growth in cases from one time to another (as opposed to the ratio of cases of one variant to another), it is reliant on the ratio of confirmed cases to infections (the ascertainment rate) being roughly constant over time. Some indication that this holds is provided by the recently-published [https://www.ons.gov.uk/peoplepopulationandcommunity/healthandsocialcare/conditionsanddiseases/datasets/coronaviruscovid19infectionsurveyheadlineresultsuk ONS infection survey prevalence estimates for London] from 20 November - 31 December 2021. Up to the end of our period of study, 24 December 2021, these very closely match (a constant multiple of) the sum of the 11 days of confirmed cases by specimen date leading up to the day in question, which suggests that the ascertainment rate did not drastically change over that period in London, on a timescale of a few days or more. (Prevalence, and 11-day averaging, are blurred versions of incidence, which means it&#039;s not easy to tell from this comparison if, for example, the ascertainment rate goes up on odd days and down on even days, but we can deduce that there is agreement on a timescale of a few days or more.) Further ONS prevalence publications can be used to check the corresponding fact for other regions of the country.&lt;br /&gt;
&lt;br /&gt;
== AY.4.2 ==&lt;br /&gt;
&lt;br /&gt;
Away from the Omicron show, AY.4.2, a more transmissible sublineage of Delta, is slowly but surely taking over from the rest of Delta. It is approximately 10% more transmissible, but over the period 18 November - 17 December 2021, it will have only increased in prevalence from about 17% to 24% of Delta, which will have increased the overall transmissibility of Delta by about 0.7%, which is to say not very much, though it does go in the direction of slightly exaggerating the effect we are seeing ($$g_\O(t)-g_\Delta(t)$$ decreasing in time).&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
We observe some unusual phenomena (Figs. 1-3). One explanation for these is that Omicron has a significantly shorter generation time than Delta. In the opinion of the author, a shorter generation time is likely to be at least part of the explanation. A particular policy implication of this is that interventions (reduction in mixing, contacts) are likely to be disproportionately effective against Omicron.&lt;br /&gt;
&lt;br /&gt;
Traditionally, generation times are hard to measure and require careful surveys of people&#039;s behaviour, but the above analysis suggests it might be possible to extract some information about comparative generation times between variants from simple case numbers under some circumstances, especially when it looks like the difference is large. It also helped in this case that there was a substantial change in people&#039;s behaviour in December 2021 that provided a variation in the growth parameters, which made the inverse problem of finding the relationship between growth parameters well-conditioned.&lt;br /&gt;
&lt;br /&gt;
To do this requires a somewhat careful treatment of case counts to remove any consistent anomalous features. This is unlike simple relative growth rates, which rely on $$\log(\O_t/\Delta_t)$$ in which anomalies in $$\O_t$$ and $$\Delta_t$$ tend to cancel out nicely.&lt;br /&gt;
&lt;br /&gt;
It is clear that $$g_\O(t)-g_\Delta(t)$$ being constant is not an adequate modelling assumption here as it leads to significantly wrong predictions, so &#039;&#039;something&#039;&#039; has to be added to any model that seeks to explain this Delta-Omicron transition period. And even as Delta recedes, this may still be a worthwhile exercise as the new modelling ingredient, be it a shorter generation time or something else, may survive into the Omicron era.&lt;br /&gt;
&lt;br /&gt;
= Program and source data =&lt;br /&gt;
&lt;br /&gt;
The program used is [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/gentime.Omicron.2021-12/sgtftogentime.py hosted on github]. The above analysis was performed using commit 0f3ebb58c8.&lt;br /&gt;
&lt;br /&gt;
The regional case counts were obtained from the UK government dashboard/api with [https://api.coronavirus.data.gov.uk/v2/data?areaType=region&amp;amp;metric=newCasesBySpecimenDate&amp;amp;format=csv this request] on 3 January.&lt;br /&gt;
&lt;br /&gt;
The SGTF counts were obtained from the 31 December 2021 [https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/1044501/sgtf_regionepicurve_2021-12-30.csv regional data], provided by the [https://www.gov.uk/government/publications/covid-19-omicron-daily-overview Omicron daily overview].&lt;br /&gt;
&lt;br /&gt;
Age-variant counts were obtained from the UKHSA [https://www.gov.uk/government/publications/investigation-of-sars-cov-2-variants-technical-briefings Technical Briefing 33] (underlying data).&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=434</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=434"/>
		<updated>2022-08-06T20:45:20Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Graphs below featuring extinct or disappearing lineages are no longer updated */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 2,000 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slightly slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-06: This is an estimate of the effect of the changing mixture of variants on the overall growth rate of new cases per day, projected forward 60 days. It shows the average growth rate of a variant (in percentage increase per day), weighted by the proportional prevalence of that variant. Note that (at the time of writing) the large majority of the expected increase has already happened, mainly as a consequence of the BA.4/5* variants taking over from the BA.2* variants. The forthcoming growth increase is predicted to be a relatively modest 1.2% over the next 60 days, because it takes a long time for the stronger variants BA.5.2, BA.4.6, BF.5, to increase their share of the mix, and some of their effect is already priced in. Note also that this only predicts the change in overall growth rate due to the change in variant mixture, and other effects (such as waning immunity) could be larger, but are outside the scope of this variant analysis. This projection requires that all significant variants are incorporated in the mix, so is valid only as long as we believe that a brand new variant won&#039;t have become a significant proportion of the mix, which seems a reasonable bet for 60 days but obviously isn&#039;t guaranteed. It also requires the relative log linear growth approximation (the thing that makes all the variant vs variant lines on this page roughly straight) to hold for 60 days.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
(The reason the best fit line is below almost all of the purple dots is that there are many days with no occurrences of BA.2.75 that would be below the best fit line, but these can&#039;t be shown on the log chart.)&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=433</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=433"/>
		<updated>2022-08-06T17:24:46Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 2,000 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slightly slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-06: This is an estimate of the effect of the changing mixture of variants on the overall growth rate of new cases per day, projected forward 60 days. It shows the average growth rate of a variant (in percentage increase per day), weighted by the proportional prevalence of that variant. Note that (at the time of writing) the large majority of the expected increase has already happened, mainly as a consequence of the BA.4/5* variants taking over from the BA.2* variants. The forthcoming growth increase is predicted to be a relatively modest 1.2% over the next 60 days, because it takes a long time for the stronger variants BA.5.2, BA.4.6, BF.5, to increase their share of the mix, and some of their effect is already priced in. Note also that this only predicts the change in overall growth rate due to the change in variant mixture, and other effects (such as waning immunity) could be larger, but are outside the scope of this variant analysis. This projection requires that all significant variants are incorporated in the mix, so is valid only as long as we believe that a brand new variant won&#039;t have become a significant proportion of the mix, which seems a reasonable bet for 60 days but obviously isn&#039;t guaranteed. It also requires the relative log linear growth approximation (the thing that makes all the variant vs variant lines on this page roughly straight) to hold for 60 days.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
(The reason the best fit line is below almost all of the purple dots is that there are many days with no occurrences of BA.2.75 that would be below the best fit line, but these can&#039;t be shown on the log chart.)&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=432</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=432"/>
		<updated>2022-08-06T17:23:20Z</updated>

		<summary type="html">&lt;p&gt;Alex: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 2,000 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slightly slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-06: This is an estimate of the effect of the changing mixture of variants on the overall growth rate of new cases per day, projected forward 60 days. It shows the average growth rate of a variant (in percentage increase per day), weighted by the proportional prevalence of that variant. Note that (at the time of writing) the large majority of the expected increase has already happened, mainly as a consequence of the BA.4/5* variants taking over from the BA.2* variants. The forthcoming growth increase is predicted to be a relatively modest 1.2% over the next 60 days, because it takes a long time for the stronger variants BA.5.2, BA.4.6, BF.5, to increase their share of the mix, and some of their effect is already priced in. Note also that this only predicts the change in overall growth rate due to the change in variant mixture, and other effects (such as waning immunity) could be larger, but are outside the scope of this variant analysis. This projection requires that all significant variants are incorporated in the mix, so is valid only as long as we believe that a brand new variant won&#039;t have become a significant proportion of the mix, which seems a reasonable bet for 60 days. It also requires the relative log linear growth approximation (the thing that makes all the variant vs variant lines on this page roughly straight) to hold for 60 days.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5_BA.2*_BA.4*_BA.5*.growthproj.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
(The reason the best fit line is below almost all of the purple dots is that there are many days with no occurrences of BA.2.75 that would be below the best fit line, but these can&#039;t be shown on the log chart.)&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=431</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=431"/>
		<updated>2022-08-06T11:26:02Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 1,500 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slightly slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
(The reason the best fit line is below almost all of the purple dots is that there are many days with no occurrences of BA.2.75 that would be below the best fit line, but these can&#039;t be shown on the log chart.)&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=430</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=430"/>
		<updated>2022-08-05T10:08:46Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 1,500 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slightly slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=429</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=429"/>
		<updated>2022-08-03T23:05:50Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 1,500 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slow down the decline in new cases per day and may eventually contribute (in a small way) to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=428</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=428"/>
		<updated>2022-08-03T17:02:30Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 1,500 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slow down the decline in new cases per day (possibly leading to a bottoming out of new cases per day in August) and may eventually contribute to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=427</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=427"/>
		<updated>2022-08-03T17:00:24Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 1,500 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slow down the decline in new cases per day (possibly leading to a bottoming out of new cases per day in August) and may eventually lead to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if these estimates turn out to be a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
	<entry>
		<id>http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=426</id>
		<title>UK variant comparison</title>
		<link rel="alternate" type="text/html" href="http://sonorouschocolate.com/covid19/index.php?title=UK_variant_comparison&amp;diff=426"/>
		<updated>2022-08-03T16:57:45Z</updated>

		<summary type="html">&lt;p&gt;Alex: /* Self-updating graphs showing current situation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-updating graphs showing current situation =&lt;br /&gt;
&lt;br /&gt;
These graphs should auto-update every day or two, according to when there is new sequence data from [https://www.cogconsortium.uk/tools-analysis/public-data-analysis-2/ COG-UK]. You may need to hit shift-reload or some such to defeat your browser&#039;s cache. More recent updates appear towards the top of this page.&lt;br /&gt;
&lt;br /&gt;
These graphs compare one or more variants with another &amp;quot;baseline&amp;quot; variant. A y-co-ordinate of 0 corresponds to equal number of new cases per day of a variant compared to the baseline variant. The purpose of presenting it this way, with a particular chosen baseline variant, as opposed to several variants on an equal footing, is that it means we expect to get straight lines to some reasonable approximation.&lt;br /&gt;
&lt;br /&gt;
Note that the growth estimates here rely on sequenced cases, of which there are currently about 1,500 per day, being representative of infections. This assumption may or may not hold, though it appears to work well in many cases. We often see a good linear fit over an extended period (say, several weeks) which arguably constitutes evidence in its favour, because many distortions you may think of, such as preferential sequencing of a particular variant for a limited time period, or different growth rates in different subpopulations, or different sets of susceptible populations, would often have the effect of knocking the relationship off being linear.&lt;br /&gt;
&lt;br /&gt;
Program used for analysis: [https://github.com/alex1770/Covid-19/blob/master/VOCgrowth/uk_var_comp.py uk_var_comp.py].&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: Adjusted the collection of main UK variants to keep an eye on to be BA.4.6, BA.5.2, BA.5.2.1, BF.5 (=BA.5.2.1.5). The strongest growing of these looks like BA.4.6 and BF.5, though BA.5.2 has enough of a head start that it will make an impact sooner. None of these look like causing a new wave in August as their growth advantage over the current dominant BA.5.1 is relatively modest, and we still have a background of falling cases. However, these variants will slow down the decline in new cases per day (possibly leading to a bottoming out of new cases per day in August) and may eventually lead to a resurgence later this autumn, depending on future imponderables such as the degree of waning immunity in the population, the existence/uptake of an autumn vaccine campaign and the other new variants that may appear.&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.4.6_BA.5.2_BA.5.2.1_BF.5.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Update 2022-08-02: adding a comparison of the BA.5* family with BA.2.75 (nicknamed &amp;quot;Centaurus&amp;quot;) and the related BA.2.76, because there has been some concern that BA.2.75 may be a threat in some places in the world. However, BA.2.75 is not making any serious impact on cases in the UK now, nor does it seem likely to do so in the foreseeable. The top of the confidence interval for growth gives it a 4.0%/day advantage over the current mixture of BA.5 variants, but even at this rate it would take 5 months (9 doublings at log(2)/.04 days per doubling) to reach parity with BA.5*. Bearing in mind also that that is only relative growth, and BA.5* is declining at the moment, it looks like there is some safety margin for not worrying about BA.2.75 in the UK, even if the estimates are a bit off.&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5*_BA.2.75_BA.2.76.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
= Graphs below featuring extinct or disappearing lineages are no longer updated =&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.5.1_BA.2.12.1_BA.4.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.2*_BA.2.12.1_BA.4*_BA.5*.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Note the y-scales below use natural logs.)&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1+_BA.1.1+.small.png&amp;quot;&amp;gt;] [http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.png &amp;lt;img src=&amp;quot;http://sonorouschocolate.com/covid19/extdata/UK_BA.1.1+_BA.2+.small.png&amp;quot;&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>