# Guiding GANs: How to control non-conditional pre-trained GANs for
conditional image generation

Manel Mateos, Alejandro González111Corresponding author:
<EMAIL_ADDRESS>Xavier Sevillano  GTM - Grup de Recerca en
Tecnologies Mèdia. La Salle - Universitat Ramon Llull

###### Abstract

Generative Adversarial Networks (GANs) are an arrange of two neural networks
–the generator and the discriminator– that are jointly trained to generate
artificial data, such as images, from random inputs. The quality of these
generated images has recently reached such levels that can often lead both
machines and humans into mistaking fake for real examples. However, the
process performed by the generator of the GAN has some limitations when we
want to condition the network to generate images from subcategories of a
specific class. Some recent approaches tackle this conditional generation by
introducing extra information prior to the training process, such as image
semantic segmentation or textual descriptions. While successful, these
techniques still require defining beforehand the desired subcategories and
collecting large labeled image datasets representing them to train the GAN
from scratch. In this paper we present a novel and alternative method for
guiding generic non-conditional GANs to behave as conditional GANs. Instead of
re-training the GAN, our approach adds into the mix an encoder network to
generate the high-dimensional random input vectors that are fed to the
generator network of a non-conditional GAN to make it generate images from a
specific subcategory. In our experiments, when compared to training a
conditional GAN from scratch, our guided GAN is able to generate artificial
images of perceived quality comparable to that of non-conditional GANs after
training the encoder on just a few hundreds of images, which substantially
accelerates the process and enables adding new subcategories seamlessly.

###### keywords:

Neural Network , Generative Adversarial Networks , Conditional image
generation , Guiding process , Encoder Networks

††journal: Neural Networks

##  1 Introduction

The generation of artificial data that follows real distributions has
encouraged the computer science community to develop generative algorithms
that aim to create data as indistinguishable as possible from real data.
Applications range from the generation of missing data for incomplete datasets
[1] to coherent text generation [2], among many others.

Recently, the computer vision community has focused on the generation of real-
looking artificial images, and a specific type of neural networks called
generative adversarial networks (GANs) have attained remarkable performance in
this area [3]. In GANs, models are built with two neural networks: the
generator, which is a convolutional neural network (CNN) trained to generate
images that mimic the distribution of the training dataset, and the
discriminator, which tries to distinguish between real images and fake images
generated by the generator. The process of the generator trying to fool the
discriminator leads to a joint learning process that allows to effectively
generate fake real-looking images similar to those in the training set.

Despite their success, giving users total control on the characteristics of
the images generated by a GAN is still an issue to be solved. Traditionally,
researchers have used additional information as inputs in the generator
network training to condition the generation process [4]. This gives rise to
conditional GANs, which are able to generate artificial images with certain
specific, desired characteristics. Many authors in recent years have explored
different ways of including this conditional information, be it through image
textual descriptions [5], semantic segmentations [6] or image category
definition [7], among others. However, all these approaches set the number and
definition of characteristics before the GAN training process and cannot be
changed later. Thus, for any addition or variation, a new labeled dataset must
be collected, and the GAN must be re-trained, making the whole process complex
and time-consuming.

In the face of these limitations of current conditional GANs, in this paper we
present a novel and efficient way of guiding pre-trained non-conditional GANs
for generating images belonging to specific subcategories avoiding burdensome
re-training processes. In Figure 1, the general scheme of the proposed method
is depicted.

Figure 1: Guiding GANs process: the user collects a small sample of images
corresponding to the specific subcategory. Based on this sample, the encoder
network generates the subcategory prototype vector that represents the
distribution of the sample. This vector is then randomly sampled to create
random vectors that are fed to the pre-trained non-conditional GAN to generate
images of the desired subcategory.

The key element of our proposal is an encoder network, which is first trained
to learn the opposite transformation of the pre-trained non-conditional GAN.
To do so, pairs of random vectors and the corresponding images generated by
the GAN are employed.

Then, the guiding process starts with the user collecting a small sample of
non-annotated real images as examples of the specific image subcategory he/she
wants the pre-trained non-conditional GAN to generate. These images are fed to
the encoder network, which estimates the distribution of the selected
subcategory, and embeds it in the so-called subcategory prototype vector. By
randomly sampling the prototype vector, we create multiple random vectors
which are fed to the pre-trained generator network of the GAN to produce
artificial images similar to the previously selected ones. By proceeding this
way, we enable users to obtain real-looking artificial images at a reduced
computational cost.

This paper is organized as follows: in Section 2 the theoretical background of
our proposal, as well as relevant previous work is reviewed. Then, Section 3
describes the proposed method. Next, in Section 4, our proposal is evaluated
in a series of experiments. Finally, Section 5 discusses the obtained results,
highlights the advantages of our method and outlines future research lines.

##  2 State of the art

The image generation problem has pushed researchers to find the most optimal
frameworks and models to produce real-looking artificial images.

In addition to GANs [8], other relevant approaches include adversarial auto-
encoders (AAEs) [9], variational auto-encoders (VAEs) [10] and auto-regression
models (ARMs) (e.g. PixelRNN [11]).

As GANs are probably the most widely employed technique for the conditional
generation of high resolution artificial images, this section is focused on
reviewing the basic concepts of GANs (Section 2.1), as well as common
approaches to GAN-based increased resolution image generation (Section 2.2)
and proposals on conditional generation image generation via GANs (Section
2.3).

###  2.1 Artificial image generation via GANs

GANs are a subset of implicit density generative models that focus on
transforming a random input into an image which aims to be part of the true
distribution of the training data set [8]. As mentioned earlier, the GAN
models are built through the interaction of two neural networks, the generator
and the discriminator, that together learn how to generate new real-looking
images effectively by trying to confuse one another. On the one hand, the
generator network (G) is a CNN that takes a random vector from a distribution
and maps it through the model to an output with the desired sample size. Its
objective is to produce images that look as similar as possible to the
training examples. On the other hand, the discriminator (D) is a binary
classification CNN that predicts if a given image is a real one (i.e. a
training sample) or a fake one (generated by G). In this sense, the GAN
training process can be understood as a two-player game where G tries to fool
D by generating real-looking images and D tries to distinguish between real
and fake images, as shown in Figure 2.

Figure 2: Generic GAN architecture. Generator, discriminator and their
connections.

These two models are trained jointly minimizing the possible loss for a worst-
case scenario by using as the objective function:
$\min\limits_{G}\max\limits_{D}V(D,G)=E_{x\sim p_{data}(x)}[logD(x)]+E_{z\sim
p_{z}(z)}[log(1-D(G(z)))]$, where $D(x)$ is the discriminator output for the
real data sample $x$, and $D(G(z))$ is the discriminator output for the
artificial data generated by the generator with $z$ as the random input
vector.

During the training process, the discriminator tries to maximize the objective
function by making $D(x)$ close to 1 and $D(G(z))$ close to 0, while the
generator focuses on minimizing it such that $D(G(z))$ is close to 1, fooling
the discriminator.

###  2.2 Increasing artificial image resolution via progressive growing GANs

The generation of high resolution and complex images via GANs requires up-
scaling their architecture. In this sense, higher resolutions imply some
additional challenges, such as i) gradients during training become useless,
generating poor images easily identifiable as fake, and therefore making the
training process fail, ii) memory constraints increase, forcing researchers to
reduce batch sizes, which compromises the stability of the training process,
and iii) better hardware acceleration is needed to train these bigger models
and handle them efficiently.

Figure 3: Progressive GANs training process. The training process for G and D
starts at a low-resolution ($4\times 4$ pixels) and is gradually adapted to
higher resolutions by adding layers to G and D. At each training step all
existing layers remain trainable. Added layers are convolutional layers
operating on $N\times N$ spatial resolution.

These problems forced the research community to formulate new approaches to
scale up the resolution of the generated images successfully. Some authors
like Salimans et al. [12] and Gulrajani et al. [13] presented improvements on
the GAN training process, and others like Berthelot et al. [14] and Kodali et
al. [15] proposed new GAN architectures.

An alternative and interesting approach are Progressive Growing GANs (PG-GANs)
[16], which consist in gradually training GANs and iteratively adapting them
to higher resolution images on each step of the training. The authors propose
starting the training process on low-resolution images and then gradually
increasing the resolution by adding layers to both G and D (see Figure 3).
This procedure implies that G and D must be symmetrical and grow
synchronously. The method is based on the premise that CNNs are capable of
first learning large general features, generalizing the training images, and
the addition of more layers allows to move into the finer details. According
to Karras et al., the use of this progressive growing approach i) reduces GANs
training time, ii) improves convergence, as low-resolution neural networks are
stable and the progressive increase of image resolution allows starting the
higher resolution training process with a stable pre-trained network, and iii)
introduces an adaptation degree in terms of resolution, allowing the control
of the training process for obtaining artificial images of a given desired
resolution. Due to this flexibility and reduced training time, we adopt PG-
GANs in our work to generate artificial images.

###  2.3 Conditional image generation with GANs

Another issue worth considering is how to control the generation process
beyond the training dataset, a process that goes by the name of conditional
generation.

In this context, authors have developed different approaches based on training
the GANs not only with uncategorized images but also introducing categorical
information of the images included in the training dataset. For instance,
works like [5] used the categories of the training images as extra features in
the generation and discrimination processes.

Other authors addressed the problem by using both categorical information of
the training images and also their semantic segmentation, as in [6, 7, 17,
18]. In those works, the authors train the discriminator to distinguish real
and fake images and at the same time, to match the objective pixel wise
semantic information given.

An example of a use case for conditional GANs consists on generating human
body images simulating specific body poses. In this context, some authors
proposed new architectures for the training of GANs, which receive the body
poses of the training images as an extra feature. [19, 20, 21], once the GAN
is trained users may generate images where the pose is freely chosen.

The following section describes our proposal, which guides non-conditional PG-
GANs for generating images of a specific subcategory within the training set,
at will and without the need of retraining the GAN models.

##  3 Guiding non-conditional pre-trained GANs

Our proposal is based on considering the $d$-dimensional input space of random
vectors that feed the generator network G of a non-conditional GAN once it is
trained to generate images of a specific category $C$, which we refer to as
$\mathrm{G}_{C}$. Without loss of generality, any category $C$ is
intrinsically composed of multiple (say $m$) subcategories $SC_{i}$, that is
$C=\displaystyle\bigcup_{i=1}^{m}{SC_{i}}$.

In response to these random input vectors, $\mathrm{G}_{C}$ generates images
corresponding to the category represented in the training set, but no control
mechanism is available to “tell” $\mathrm{G}_{C}$ to generate images of a
specific subcategory $SC_{k}$. In our method, we propose hand-picking the
random vector input to $\mathrm{G}_{C}$ to produce images belonging to the
desired subcategory, thus giving the user total control over the artificial
image generation process.

Our method is described step by step in the following paragraphs. Please refer
to Figure 1 for a graphical reference.

Figure 4: Encoder training.

Step 1) Encoder training: an encoder network is trained to learn the opposite
transformation from the one carried out by the trained generator
$\mathrm{G}_{C}$. To that end, the encoder is trained using pairs of
$d$-dimensional random input vectors and their correspondent generated images
directly extracted from the non-conditional generator network
$\mathrm{G}_{C}$, therefore making the training data supply virtually endless
(see Figure 4). As a result, we obtain an encoder model that given an image
generated by $\mathrm{G}_{C}$ returns the $d$-dimensional input vector which
would have created that image. After finishing the training process, the
encoder is capable of successfully returning input vectors from random images
not produced by the generator.

Step 2) Subcategory random vectors generation: The user collects real images
of the desired subcategory $SC_{k}$ and feeds the trained encoder with them.
This image collection process can be fully automated, as described in Section
4. In response, the encoder returns a $d$-dimensional random vector
$\vec{x}_{i}^{SC_{k}}$ corresponding to each input image. Notice that the
larger the number of collected images (referred to as $N$), the more accurate
the estimation of the distribution of the desired subcategory. Moreover, it is
also to note that the user can decide to add a new subcategory, and the
obtainment of the corresponding vectors through the encoder can be started at
any point.

Step 3) Subcategory prototype vector creation and sampling: the mean value and
standard deviation of each of the $d$ components of the vectors
$\vec{x}_{i}^{SC_{k}}$ ($\forall i=1...N$) output by the encoder in response
to the images of the desired subcategory $SC_{k}$ are computed and embedded in
the subcategory prototype vector $\vec{p}^{SC_{k}}$. Next, this prototype
vector is used to generate as many random vectors as desired by sampling $d$
normal random variables $X_{j}\sim
N\left(\mu_{j},\alpha\cdot\sigma_{j}\right)$ (with $\forall j=1..d$), where
$\mu_{j}$ and $\sigma_{j}$ are the mean value and the standard deviation of
the $j$th component of the vectors $\vec{x}_{i}^{SC_{k}}$ ($\forall i=1...N$),
and $\alpha$ is a scalar parameter. In our experiments, we heuristically tuned
the value of this parameter to 2.5. These random vectors follow the
distribution of the desired subcategory $SC_{k}$, so they will make the pre-
trained generator network $\mathrm{G}_{C}$ generate images belonging to the
specific subcategory of choice.

Figure 5: Training real examples of the “mountains” category used to train the
non-conditional progressive growing GAN

##  4 Experiments and results

The experiments described in this section aim to evaluate our method to guide
a non-conditional progressive growing GAN.

We start by describing the data employed in our experiments. Subsequently, we
present the architecture of the PG-GAN, and an experiment involving a
subjective quality evaluation test to assess the quality of the images it
generates.

In the final experiment, we guide the non-conditional PG-GAN to generate
images from specific subcategories of choice. We describe the architecture of
the encoder network employed in the experiments, and then evaluate i) the
ability of the non-conditional network to effectively generate images that
correspond to the chosen subcategories, and ii) the perceived quality of the
generated images.

###  4.1 Dataset

The non-conditional PG-GAN was trained to generate images of the category $C=$
“mountains”. To that end, a total of 19.765 images of mountains were
downloaded from the Flickr image hosting service and used to train the GAN.
Some example images from the training dataset are presented in Figure 5.

On the other hand, to train the encoder network, we created 500.000 random
vectors, fed them to the pre-trained non-generic PG-GAN, and collected the
corresponding images.

The images used for guiding the non-conditional GAN to generate images from a
specific subcategory were obtained using the Flickr API, downloading $N$
images that were tagged as one of the following selected subcategories
$SC_{k}=\\{$“mountains + snow”, “mountains + sunset”, “mountains + trees”,
“mountains + night” and “mountains + rocks”$\\}$.

###  4.2 Non-conditional progressive growing GAN

####  4.2.1 Architecture

The PG-GAN used in these experiments follows the architecture presented by
Karras et al. in [16] and shown in Figure 3.

In a nutshell, the model starts training at a resolution of 4x4 and progresses
until reaching a final resolution of 128x128.

The architecture of both the generator and the discriminator are based on
strided convolutions with leakyReLU activations and constrain the signal
magnitude and competition during training through pixel wise feature
normalization and equalizing the learning. The whole model has over 45 million
parameters and was trained on Google Colab for 200 epochs.

Figure 6 shows several examples of the artificial images of the mountain
category generated by the GAN. All examples portray high fidelity and
variance, successfully capturing the true distribution of the images provided
during the training of the model.

Figure 6: Examples of the “mountain” category artificial images generated by
the non-conditional progressive GAN Figure 7: Normalized histogram of the
scores given by the participants in the subjective quality evaluation test of
the non-conditional progressive GAN

####  4.2.2 Artificial image quality evaluation

To evaluate the quality of the images generated by the non-conditional PG-GAN,
we carried out a subjective quality evaluation test, in which 50 participants
were asked to evaluate the degree of realism of 20 artificial images using a
rating scale from 0 to 10 (the greater the score, the greater the realism).
The normalized histogram of the obtained ratings is depicted in Figure 7. The
left skewed distribution of scores reveals that the participants judged most
of the images as quite realistic, obtaining an mean opinion score of 6.3.

###  4.3 Guiding the non-conditional GAN

The architecture of the encoder network used to guide the non-conditional GAN
is presented in Figure 8.

Figure 8: Architecture of the encoder network

As mentioned earlier, the encoder was trained on 500.000 pairs of random
vectors and the corresponding artificial images generated by the non-
conditional PG-GAN. The training took 4 epochs to converge.

The computation of the subcategory prototype vector was made after
programmatically downloading a variable number $N$ of images from Flickr
corresponding to the desired subcategories that were described in section 4.1.

The experiments to evaluate the quality of the images generated by the guided
non-conditional PG-GAN are presented next.

####  4.3.1 Effect of $N$ on the perceived quality of the images

First, we evaluated how the number of images fed to the encoder to create the
subcategory prototype vector affects the quality of the images that are
subsequently generated by the guided non-conditional PG-GAN.

To that end, we presented 50 participants with images generated when the
subcategory prototype vector was computed after feeding the encoder network
with $N=\\{64,128\,\mathrm{and}\,256\\}$ images.

Figure 9: Examples of images of the “mountains+snow”, “mountains+sunset”,
“mountains+trees”, “mountains+night” and “mountains+rocks” subcategories
generated by the guided non-conditional “mountain” GAN

The mean opinion score for these configurations was 5.9, 6.2 and 6.4,
respectively. Taking into account that the subjective quality evaluation of
the images created by the non-conditional progressive growing GAN yielded a
mean opinion score of 6.3, these results prove that using a few hundreds of
images corresponding to the desired subcategory suffices to generate images of
that subcategory with an equivalent level of perceived quality.

To illustrate this fact, Figure 9 presents images generated by the guided GAN
when asked to create images of the subcategories mentioned earlier with
$N=256$. It can be observed that the network succeeds in generating images of
the specific subcategory.

####  4.3.2 Subcategory identification

In this experiment, we evaluate whether the participants in the subjective
evaluation test were able to correctly identify the subcategory of the images
generated by the guided GAN.

The experiment consisted of presenting the participants with 20 images that
had to be classified in the (“mountains+”) “snow”, “sunset”, “trees”, “night”
or “rocks” subcategories.

In average, the participants successfully chose the correct subcategory with a
85.2% accuracy. The confusion matrix corresponding to this experiment is
presented in Table 1. Notice that the “snow” and “sunset” subcategories are
identified close to perfection, while the “tree” subcategory is identified
with a 56.6% accuracy.

|  | Predicted class
---|---|---
|  | Snow | Sunset | Trees | Rocks | Night
Actual class | Snow | 99.5 | 0 | 0 | 0 | 0.5
Sunset | 0 | 99.5 | 0.5 | 0 | 0
Trees | 1 | 0.5 | 56.5 | 42 | 0
Rocks | 2 | 0.5 | 7 | 91 | 0
Night | 1 | 8 | 9 | 2.5 | 79.5
Table 1: Confusion matrix of the subcategory identification experiment (values
in %).

##  5 Conclusions

This work has introduced a novel method that gives users control over the
specific type of images generated by GANs. Our proposal enables the generation
of artificial images from a user-defined subcategory, guiding a non-
conditional GAN thanks to a new architecture that includes an encoder network
to feed the GAN.

This novel process transforms the conditional image generation problem into a
simpler task for general users, reaching a flexibility level that cannot be
reached by a non-conditional GAN.

Our proposal allows to considerably reduce the time needed to perform
conditional image generation, while maintaining similar results in terms of
artificial image quality. Additionally, since only a small set of images of
the desired subcategory is needed to guide the GAN, the process can be fully
automated. Moreover, the proposed method enables the user to select the
desired image subcategory on the go, which allows new ideas to be tested in
minutes, much faster than the time that would be required to train a new
regular, non-generic GAN from scratch.

Moving forward, we believe the subcategory prototype vector creation process
described in Section 3 could be further improved to better represent the
subcategory’s distribution, which would help the generator network yield more
variance between the images belonging to a single subcategory. Additionally,
studying how input vectors are transformed throughout the generator process,
and specifically trying to understand how dependent the perceived subcategory
is to each step of the network, could help better guide the model by not only
feeding it the right vector, but also further ”steering” the generation
process into the desired direction.

## References

  * Hartley [1958] H. O. Hartley,  Maximum likelihood estimation from incomplete data,  Biometrics 14 (1958) 174–194.
  * Roh and Lee [2003] J. Roh, J.-H. Lee,  Coherent text generation using entity-based coherence measures,  in: Advances in Computation of Oriental Languages–Proceedings of the 20th International Conference on Computer Processing of Oriental Languages, 2003.
  * Alqahtani et al. [2019] H. Alqahtani, M. Kavakli-Thorne, G. Kumar,  Applications of generative adversarial networks (gans): An updated review,  Archives of Computational Methods in Engineering (2019) 1–28.
  * Dai et al. [2017] B. Dai, S. Fidler, R. Urtasun, D. Lin,  Towards diverse and natural image descriptions via a conditional gan,  in: Proceedings of the IEEE International Conference on Computer Vision, 2017, pp. 2970–2979.
  * Chang et al. [2019] C.-H. Chang, C.-H. Yu, S.-Y. Chen, E. Y. Chang,  Kg-gan: Knowledge-guided generative adversarial networks,  arXiv preprint arXiv:1905.12261 (2019).
  * Tang et al. [2020] H. Tang, X. Qi, D. Xu, P. H. Torr, N. Sebe,  Edge guided gans with semantic preserving for semantic image synthesis,  arXiv preprint arXiv:2003.13898 (2020).
  * Qi et al. [2018] X. Qi, Q. Chen, J. Jia, V. Koltun,  Semi-parametric image synthesis,  in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018, pp. 8808–8816.
  * Goodfellow et al. [2014] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, Y. Bengio,  Generative adversarial nets (2014) 2672–2680.
  * Makhzani et al. [2015] A. Makhzani, J. Shlens, N. Jaitly, I. Goodfellow, B. Frey,  Adversarial autoencoders,  arXiv preprint arXiv:1511.05644 (2015).
  * Kingma and Welling [2013] D. P. Kingma, M. Welling,  Auto-encoding variational bayes,  arXiv preprint arXiv:1312.6114 (2013).
  * Oord et al. [2016] A. v. d. Oord, N. Kalchbrenner, K. Kavukcuoglu,  Pixel recurrent neural networks,  arXiv preprint arXiv:1601.06759 (2016).
  * Salimans et al. [2016] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, X. Chen,  Improved techniques for training gans,  in: Advances in neural information processing systems, 2016, pp. 2234–2242.
  * Gulrajani et al. [2017] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, A. C. Courville,  Improved training of wasserstein gans,  in: Advances in neural information processing systems, 2017, pp. 5767–5777.
  * Berthelot et al. [2017] D. Berthelot, T. Schumm, L. Metz,  Began: Boundary equilibrium generative adversarial networks,  arXiv preprint arXiv:1703.10717 (2017).
  * Kodali et al. [2017] N. Kodali, J. Abernethy, J. Hays, Z. Kira,  How to train your dragan,  arXiv preprint arXiv:1705.07215 2 (2017).
  * Karras et al. [2017] T. Karras, T. Aila, S. Laine, J. Lehtinen,  Progressive growing of gans for improved quality, stability, and variation,  arXiv preprint arXiv:1710.10196 (2017).
  * Bau et al. [2019] D. Bau, J.-Y. Zhu, J. Wulff, W. Peebles, H. Strobelt, B. Zhou, A. Torralba,  Seeing what a gan cannot generate,  in: Proceedings of the IEEE International Conference on Computer Vision, 2019, pp. 4502–4511.
  * Park et al. [2019] T. Park, M.-Y. Liu, T.-C. Wang, J.-Y. Zhu,  Semantic image synthesis with spatially-adaptive normalization,  in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019, pp. 2337–2346.
  * Tang et al. [2019] H. Tang, D. Xu, G. Liu, W. Wang, N. Sebe, Y. Yan,  Cycle in cycle generative adversarial networks for keypoint-guided image generation,  in: Proceedings of the 27th ACM International Conference on Multimedia, 2019, pp. 2052–2060.
  * Dong et al. [2018] H. Dong, X. Liang, K. Gong, H. Lai, J. Zhu, J. Yin,  Soft-gated warping-gan for pose-guided person image synthesis,  in: Advances in neural information processing systems, 2018, pp. 474–484.
  * Ma et al. [2018] L. Ma, Q. Sun, S. Georgoulis, L. Van Gool, B. Schiele, M. Fritz,  Disentangled person image generation,  in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018, pp. 99–108.


# The Role of SARS-CoV-2 Testing on Hospitalizations in California

J. Cricelio Montesinos-López  Maria L. Daza–Torres  Yury E. García  Luis A.
Barboza  Fabio Sanchez  Alec J. Schmidt  Brad H. Pollock  Miriam Nuño

###### Abstract

The rapid spread of the new SARS-CoV-2 virus triggered a global health crisis
disproportionately impacting people with pre-existing health conditions and
particular demographic and socioeconomic characteristics. One of the main
concerns of governments has been to avoid the overwhelm of health systems. For
this reason, they have implemented a series of non-pharmaceutical measures to
control the spread of the virus, with mass tests being one of the most
effective control. To date, public health officials continue to promote some
of these measures, mainly due to delays in mass vaccination and the emergence
of new virus strains. In this study, we studied the association between
COVID-19 positivity rate and hospitalization rates at the county level in
California using a mixed linear model. The analysis was performed in the three
waves of confirmed COVID-19 cases registered in the state to September 2021.
Our findings suggests that test positivity rate is consistently associated
with hospitalization rates at the county level for all waves of study.
Demographic factors that seem to be related with higher hospitalization rates
changed over time, as the profile of the pandemic impacted different fractions
of the population in counties across California.

##  1 Introduction

The SARS-CoV-2 virus, responsible for the novel coronavirus disease
(COVID-19), was identified in late December 2019 in Wuhan, China [1], and
spread rapidly, causing a global health crisis. As of October 5, 2021, more
than 235 million cases and 4,812,221 deaths have been confirmed worldwide [2].
As the pandemic spread across the globe, governments started to enforce public
policies to suppress SARS-CoV-2 transmission, including social distancing,
contact tracing, stay-at-home orders, school closings, limits public space
utilization, and border closures [3, 4]. To date, public health officials
continue to promote some of these non-pharmaceutical measures, mainly due to
delays in mass vaccination and the growing number of new COVID-19 variants
[5]. Mass surveillance testing, efforts of isolation, quarantine, and contact
tracing became essential control measures for curtailing the burden of the
COVID-19 pandemic [6]. The successful epidemic control measures taken by
countries such as Korea, Taiwan, Japan, China, New Zealand, and the Czech
Republic, which emphasized high testing rates during the initial stages of the
pandemic, supported the proposal that mass surveillance testing could help
limit viral transmission when properly leveraged [7, 8, 9, 10, 11]. However,
it remains unknown which testing strategies are the best and whether different
approaches show significant and measurable effects on viral spread in general
and the rates of severe or deadly cases in particular [12]. Although
population-scale testing is proven to reduce SARS-CoV-2 [13], it appears to
become less effective as viral prevalence decreases and is insufficient to
eliminate viral transmission on its own [14, 15].

Public health officials commonly use the test positivity rate to infer the
adequacy of population-level testing and the rate of COVID-19 transmission in
a population [16]. A low test positivity rate indicates low viral prevalence
and a testing program with sufficient surveillance capacity. In contrast, a
high test positivity rate suggests that the amount of testing is insufficient
and that many infected people go unnoticed, especially when test positivity
rates are higher than the expected prevalence [17]. Implementing mass testing
may also lead to fewer hospitalizations by reducing new infections by offering
interventions for symptomatic and asymptomatic cases discovered early [18, 19,
6]. Hospitalization is also influenced by the demographic structure of the
population and health care system factors. In theory, a public health system
that is better prepared to identify and support the isolation of cases
discovered by surveillance testing and treat those who require medical care
should result in lower hospitalizations rates.

On January 26, 2020, the first documented case of COVID-19 in California
occurred in Orange County [20]. Since then, the state government has
implemented a variety of strategies to contain the spread of the virus [21].
On March 4, 2020, California declared a state of emergency, followed by a
mandatory statewide stay-at-home order on March 19, 2020. On June 18, 2021, a
statewide mask mandate was ordered due to the rising number of cases and
deaths. These mandates were in force until June 15, 2021, when California
started reopening the economy [22], with $70\%$ of eligible with at least one
dose of the COVID-19 vaccine and more than $40\%$ of the population fully
vaccinated [23]. As of September 22, 2021, California has had three COVID-19
case waves. The first peak occurred in mid-July 2020, reaching an average of
10,000 new cases per day (first wave, May-Sep 2020) [24]. During this first
wave, most infections were geographically concentrated in the Central Valley,
primarily dominated by agriculture, manufacturing services, and retail,
meaning few residents could make the transition to working from home [25]. In
Autumn 2020, COVID-19 cases spiked again, to a peak of 40,000 new cases per
day at the end of December (second wave Nov-Jan 2021). During this wave, Los
Angeles was one of the main epicenters of the pandemic [26, 27]. The third
wave associated with the SARS-CoV-2 delta variant started in mid-June 2021
after the lifting of the statewide stay-at-home order. By mid-September, the
number of reported daily COVID-19 infections were decreasing, and as of
September 20, 2021, California reported the lowest coronavirus state
incidences case rate in the U.S. [28, 29]

In this paper, we aim to provide an exploratory data analysis to verify how
demographics and positivity rate correlate with COVID-19 hospital admission in
California. The analysis was performed in each of the three waves, using a
mixed linear model and data related to hospitalizations for COVID-19, age,
race, ethnicity, poverty, and mobility. The paper is organized as follows:
Section 2 describes the data and the methods implemented for the analysis,
section 3 describes the results, and section 4 highlights the main results and
conclusions.

##  2 Materials and Methods

The main goal of this analysis is to describe the effect of surveillance
testing on hospitalizations for COVID-19. We performed a comparative analysis
using a mixed linear model to study the relationship between hospitalization
rates for COVID-19 and positive cases, diagnostic tests, mobility, age, race
and ethnic group, poverty, and education across the counties of California.
Sixteen of the fifty-eight counties were excluded from this analysis:
Calaveras, Colusa, Del Norte, Glenn, Inyo, Lassen, Mariposa, Modoc, Mono,
Plumas, San Benito, and Siskiyou, due to low quality of hospital and mobility
data; and rural counties like Alpine, Sierra, Sutter, and Trinity because they
do not have hospital wards, so patients from those counties would go to
neighboring counties for COVID-19 medical care.

We analyzed three waves according to the three primary outbreaks reported in
California [30]. We defined the first wave period from April 21, 2020, to
September 30, 2020; the second wave starts on October 1 and ends on February
28, 2021, and the third starts on March 1 and ends on September five, 2021
(Figure 1). We implemented a change-point analysis to select the different
waves intervals.

Figure 1: Confirmed cases (7-day moving average) and the number of patients
hospitalized in an inpatient bed who have laboratory-confirmed COVID-19 in
California.

###  2.1 Data Sources

Several data sources were used for this study. We used publicly available
epidemiological data for COVID-19 daily reported cases and hospitalization
admissions at the county level from the official website of the California
Department of Public Health (CDPH) [31]. Data from the American Community
Survey (ACS) [32] estimates characteristics at the county level for age and
race or ethnic group. We used the Healthy Places Index (HPI) to account for
community-level factors contributing to social vulnerability. The HPI is
produced by the Public Health Alliance of Southern California, which combines
twenty-five community characteristics (e.g., the number of people living below
the poverty line, the number of people with lower levels of education, areas
with more renters and fewer homeowners, among others) into a single index
value to account for the level of poverty, education, and life expectancy in a
particular community [33]. The degree of intra-community mobility was produced
from Google’s Community Mobility Reports [34]. Six Google-specific data
streams (grocery and pharmacy, parks, residential, retail and recreation,
transit stations, and workplaces) were combined to obtain a single mobility
measure for the county using principal component analysis (PCA) (see
Supplementary Material for details). All data that changed over time were
analyzed weekly to minimize fluctuations observed at the daily level. We
considered 7-day averages for daily test positivity rate, intra-community
mobility, and hospitalization rate (Figure: S2-S5), given that this is likely
to be less volatile.

###  2.2 Exposure and Outcome

The number of tests done and the number of positive cases discovered is not
meaningful without extra information. The number of confirmed cases on a given
day is related to the actual prevalence, the average duration of disease, and
the gross number of tests performed, such that an increase in the number of
tests can reveal more existing infections and a change in estimates of the
prevalence. Test positivity rate incorporates both the number of tests done
and the number of positive cases discovered, frequently used for monitoring
the progression of the COVID-19 pandemic [35, 36], and its correlation with
hospitalization rates has been shown in previous studies [37, 38] consistent
with our use here. We calculated the average positivity rate at the county
level by dividing the 7-day average of daily confirmed cases by the 7-day
average of daily tests. The hospitalization rate was conceptualized as the
average weekly hospital admission rate for laboratory-confirmed COVID-19 per
10,000 county residents. The weekly average positivity and hospitalization
rates were log-transformed to capture the effect of detected infections and
testing on COVID-19 hospitalizations.

###  2.3 Model

Hospitalization data are made up of repeated measurements. The first, second,
and third waves represent 24, 22, and 27 measurements of hospitalization rate,
respectively, corresponding to the number of weeks in each wave. The
traditional linear regression model is not appropriate for studying data with
multiple repeated measures [39]. Therefore, we employed a linear mixed-effects
model that incorporates repeated observations at the county level.

Let $\textbf{Y}_{j}$ be the $I\times 1$ dependent variable corresponding to
the log of the rate of hospital admissions for COVID-19 per 10,000 inhabitants
at the county $j$. The subscripts $j=1,2,...,J$ and $i=1,2,...,I$ represent
the 42 counties in California and the number of weeks in the wave data
collected, respectively. $\textbf{X}_{j}$ is the $I\times p$ fixed-effects
design matrix; $\boldsymbol{\beta}$ is the $p\times 1$ fixed-effects vector;
$\textbf{Z}_{j}$ correspond to $I\times q$ matrix of random-effects design
matrix; $\textbf{u}_{j}$ represents the $q\times 1$ vector of random effects
and $\boldsymbol{\varepsilon_{j}}$ is the $I\times 1$ vector of residuals.
$\textbf{u}_{j}$ is independent of $\boldsymbol{\varepsilon_{j}}$. G is the
$q\times q$ covariance matrix for the random effects, and $\textbf{R}_{j}$ is
the $I\times I$ covariance matrix for the residuals. The model we considered
includes a random intercept and a random slope concerning the positivity rate
($q=2)$ since we hypothesize that each county has a different baseline
positivity rate and that the effect of the positivity rate on hospitalization
differs between counties.

We define the general form of the mixed linear regression model as follows:

$\begin{split}\textbf{Y}_{j}&=\textbf{X}_{j}\boldsymbol{\beta}+\textbf{Z}_{j}\textbf{u}_{j}+\boldsymbol{\varepsilon_{j}}\\\
\textbf{u}_{j}&\sim N\left(0,\textbf{G}\right)\\\
\boldsymbol{\boldsymbol{\varepsilon}_{j}}&\sim
N\left(0,\textbf{R}_{j}\right).\end{split}$ (1)

The term $\textbf{X}_{j}\boldsymbol{\beta}$ corresponds to the fixed effect(s)
component (a standard general linear model) and $\textbf{Z}_{j}\textbf{u}_{j}$
to the random effects. The model was fitted using the lmer function in the
lme4 package for R [40].

Since only the hospitalization rate and the positivity rate were log-
transformed, we interpret the coefficient ($\beta_{r}$) for the log positivity
rate as the percent increase in the hospitalization rate for every $1\%$
increase in the positivity rate. The estimation for all other coefficients
($\beta_{p}$’s) requires transformation via $100\times(\exp(\beta_{p})-1)$,
which gives the percent increase (or decrease) in the hospitalizations rate
for every one-unit increase in the independent variable.

##  3 Results

The coefficient estimates and the $95\%$ confidence intervals (CI) for the
linear mixed model are presented in Table 1. The $\beta$ value represents the
effect that each variable has on the hospitalizations rate. Variables with a
p-value $<0.05$ were considered statistically significant. Results show that
significant variables changed over time, but the positivity rate consistently
remained significant across all three waves with a coefficient $\beta_{r}$
close to one. Regarding hospitalization rates for different racial and ethnic
groups, counties with a higher population percentage of non-White race or
ethnic groups had higher hospitalization rates in the first and second waves
1. In the first wave of infections, counties saw an average $7.4\%$ increase
in hospitalization rate for every $1\%$ of the population identified as
Hispanic or Latino, and a $16.6\%$ increase in hospitalization rate for every
$1\%$ of the population that identifies as African American. In the second
wave, counties with high proportions of Hispanic or Latino and African
American populations were not significantly different, but a $3.4\%$ increase
in hospitalization rates was associated with every $1\%$ of the population
that identifies as Asian.

HPI was significant and positive in the first wave, meaning that counties with
more significant economic, social, and healthcare resources reported increased
hospitalization rates compared to counties with fewer resources. Higher intra-
community mobility was associated with higher hospitalization rates; however,
in the second wave, we found that higher mobility was negatively associated
with hospitalization rates.

Table 1: Association between hospitalization rates and independent variables
at the county level.

| 1st wave | 2nd wave | 3rd wave
---|---|---|---
Variable | Estimate* (95% CI) | p-value | Estimate* (95% CI) | p-value | Estimate* (95% CI) | p-value
Positivity rate | 0.9 (0.6, 1.4) |  $<$0.001 | 0.9 (0.8, 0.9) |  $<$0.001 | 1.1 (0.9, 1.2) |  $<$0.001
Pop over 65 | -13.2 (-30.6, 8.5) | 0.246 | 3.1 (-3.8, 10.6) | 0.416 | -7.7 (-15.1, -0.1) | 0.060
Asian | 0.8 (-7.2, 9.4) | 0.861 | 3.4 (0.7, 6.1) | 0.020 | -0.5 (-3.9, 2.9) | 0.763
Hispanic/Latino | 7.4 (2.1, 12.9) | 0.010 | 0.9 (-0.6, 2.5) | 0.259 | -0.6 (-2.3, 1.3) | 0.535
African American | 16.6 (0.1, 35.9) | 0.070 | 0.1 (-4.7, 5.1) | 0.982 | 1.8 (-4.3, 8.2) | 0.582
HPI | 4.9 (2.4, 7.4) |  $<$0.001 | -0.4 (-1.2, 0.3) | 0.266 | 0.2 (-0.7, 1.2) | 0.686
Mobility | 4.9 (1.9, 7.9) |  $<$0.001 | -2.8 (-3.4, -2.1) |  $<$0.001 | 0.1 (-1.7, 1.8) | 0.950

*A $1\%$ increase in the positivity rate coefficient consistently corresponds to around a $1\%$ percent increase in the hospitalization rate. Interpretation for the other independent variables is a one-unit increment corresponding to a percent change, namely positive or negative, depending on the coefficient sign.

Table 2 displays the coefficient value related to the log positivity rate for
each county in the three waves. These values are equal to
($\beta_{r}+u_{r_{j}}$), where $\beta_{r}$ correspond to the general
coefficient for the log positivity rate (Table 1) and $u_{r_{j}}$ is the
random coefficient for the j-th county, $j=1,2,...,J$. Counties with higher
coefficient values had stronger associations between test positivity rate and
hospitalization rate.

Table 2: Estimates of the association between test positivity rate and
hospitalization rate for each wave of study.

County | Wave 1 | Wave 2 | Wave 3 | County | Wave 1 | Wave 2 | Wave 3
---|---|---|---|---|---|---|---
Yolo | 2.99 | 0.70 | 1.10 | Santa Clara | 0.95 | 1.08 | 0.82
Madera | 1.64 | 0.77 | 1.05 | Stanislaus | 0.92 | 0.80 | 0.78
El Dorado | 1.52 | 1.34 | 1.53 | Nevada | 0.92 | 0.64 | 0.94
Imperial | 1.34 | 1.02 | 0.92 | Tuolumne | 0.91 | 0.55 | 0.80
Los Angeles | 1.23 | 0.95 | 0.78 | Butte | 0.90 | 0.82 | 1.10
Orange | 1.22 | 1.02 | 0.94 | Merced | 0.90 | 0.86 | 1.30
Alameda | 1.18 | 0.82 | 0.98 | San Francisco | 0.82 | 1.06 | 0.87
Tulare | 1.15 | 0.86 | 1.00 | Marin | 0.79 | 0.79 | 0.98
Fresno | 1.14 | 0.88 | 0.87 | Sacramento | 0.75 | 0.85 | 1.16
Contra Costa | 1.09 | 0.99 | 1.21 | Napa | 0.73 | 0.95 | 1.04
San Bernardino | 1.06 | 1.01 | 1.02 | Lake | 0.71 | 1.06 | 2.62
Kern | 1.06 | 0.84 | 1.05 | Amador | 0.71 | 0.90 | 1.01
San Mateo | 1.04 | 1.03 | 0.91 | Shasta | 0.70 | 1.02 | 0.91
Ventura | 1.04 | 1.05 | 0.91 | Tehama | 0.69 | 0.76 | 1.70
Santa Barbara | 1.04 | 0.93 | 0.97 | Sonoma | 0.67 | 0.97 | 1.03
San Joaquin | 1.01 | 1.01 | 1.06 | Santa Cruz | 0.66 | 0.79 | 1.12
Kings | 1.00 | 0.77 | 0.89 | San Luis Obispo | 0.55 | 0.95 | 1.15
San Diego | 0.99 | 0.92 | 0.97 | Yuba | 0.52 | 0.95 | 1.02
Solano | 0.99 | 0.90 | 1.06 | Placer | 0.29 | 0.89 | 0.77
Riverside | 0.97 | 1.02 | 1.09 | Mendocino | 0.18 | 1.10 | 1.17
Monterey | 0.95 | 0.81 | 1.05 | Humboldt | 0.12 | 0.38 | 1.14

##  4 Discussion

A mixed linear model was used between the COVID-19 hospitalization rate and
factors such as age, ethnicity, race, poverty index, and intra-community
mobility. Our primary interest was studying the impact of testing rates on
county-level hospitalization rates, as county health departments were usually
responsible for public testing administration. We found that the test
positivity rate was consistently significant and positively associated with
the hospitalization rate during all three waves of COVID-19. Hospitalization
rate increased at an almost 1:1 basis with a positivity rate. While other
possible predictors of hospitalization rate, including the density of
different race or ethnic groups, social vulnerability, and intra-community
mobility, had pronounced effects at differing times during the pandemic, none
were consistent predictors of hospitalization rate for all three waves of
infection.

The actual local prevalence and the number of tests administered both affect
the positivity rate value. Generally, the higher the true prevalence, the
higher the positivity rate will be; as more tests are deployed, the positivity
rate will converge with the true prevalence. The nature of diagnostic testing
on a first-come-first-serve basis frequently leads to positivity rates more
than the actual prevalence if testing rates are insufficient to sample the
mild or asymptomatic cases. In other words, if the number of tests is a
limiting factor, and they are used primarily to confirm likely cases more
frequently than a random surveillance sampling of the population, positivity
rates will be biased upwards compared to the actual prevalence. This assumes
that those who suspect they have the disease or suspect exposure are more
likely to seek a test than those who have no such suspicion. Thus, high test
positivity rates are likely a mix of biased sampling and high prevalence, but
clarifying which is dominant during a specific time frame requires high-
quality auxiliary data that may not exist. Our results suggest that actions
that reduce the test positivity rate are likely to reduce the hospitalization
rate by a similar magnitude. Simply increasing the number of tests will only
significantly reduce the positivity rate if sampling bias is the dominant
reason for a high positivity rate. Determining the effect on hospitalization
rate of reducing test positivity rate in bias-dominant versus prevalence-
dominant systems is beyond the scope of this paper, but remains an important
question.

The response following detection is essential. Theoretically, early detection
of a new case, symptomatic or asymptomatic, and rapid isolation will prevent
further potential hospitalizations. Extrapolating from our results, we expect
that the counties that more regularly tested a more significant proportion of
their population- from asymptomatic surveillance or robust testing
requirements for essential workers- experienced lower hospitalization rates
than the counterfactual scenario. However, care must be taken extending this
reasoning too far: large-scale population testing can theoretically lead to
reduced hospitalizations, but the effect will always be indirect. The
resources and infrastructure must support proper mass testing and preparation
to respond to the information garnered from the testing program, which no two
counties will have done identically, hence why each county reported here
maintained intercepts that varied from each other over time.

A low positivity rate due to a high amount of testing does not always imply
adequate pandemic control. Not only does the gap between testing rates among
suspected cases, known exposures, and the unexposed or asymptomatic matter,
but testing rates among different demographic groups demonstrably effect the
value of testing data. Suppose the mass testing systemically excludes people
with a high-risk profile (as could quickly occur where healthcare
accessibility is low). In that case, many infections could remain undiscovered
for long periods, leading to a growth in the hospitalization rate despite low
positivity rates. The pandemic has not affected everyone equally. Disparities
in coronavirus disease outcomes by racial and ethnicity as well as
socioeconomic status have been reported since the beginning of the pandemic
[41]. Our findings highlight that areas with larger relative populations of
Hispanic or Latinos and African Americans were significantly correlated with
higher hospitalization rates in the first wave and with Asians in the second
wave, consistent with previous studies [42, 43, 44]. The underlying causes of
health disparities in Latinos, African Americans, and poor communities are
related to social and structural determinants of health [45]. Implementing
social distancing, especially at the beginning of the pandemic, may have been
challenging because these communities, on average, live in more crowded
conditions and work more frequently in essential public-facing occupations. In
addition, their access to health services is systemically limited, so that
populations have a disproportionate burden of underlying comorbidities and
lack the possibility of accessing adequate and timely treatment when affected
by the SARS-CoV-2 virus [46], and possibly confounding the relationship
between test positivity rates and hospitalization rates, as discussed above.

The Healthy Places Index is correlated positively with the hospitalization
rate in the first wave, which implies that counties with higher socioeconomic
status had a higher probability of reporting hospitalizations. One of the
reasons may be the capacity and better availability of hospital facilities
attributed to economic resources. Mobility was another significant variable
that positively and negatively correlated with the hospitalization rate in the
first and second waves. A similar result was reported in [47] for COVID-19
transmission and mortality rates. Early in the pandemic, mobility patterns
were drastically affected by containment measures implemented to slow the
spread of the disease. Our results show a linear correlation between mobility
and the rate of hospitalization in the first wave, in agreement with previous
reports [48], which implies that an increase in the circulation of people
could cause an increase in infections and, consequently, in hospitalizations.
However, it is not clear how mobility affected the growth rates of the
COVID-19 infection once the lockdowns were lifted because other interventions
became more widely available and easier to adhere to, such as wearing face
masks and social distancing, patterns of both mobility and growth of
infections became non-linear [48]. One interpretation could be that areas with
lower infection rates allowed for greater freedom in summer activities,
negatively correlating positivity and hospitalization rates. Care must be
taken in attributing causation to relationships between these covariates and
hospitalization rates without further study.

This study has some limitations that are important to consider. First, it is
focused on county-level analysis and is intended to investigate population-
level risk; conclusions at the individual level are not appropriate and should
not be applied. Second, as discussed earlier, we did not attempt to address
whether a given data point on test positivity was produced during a bias-
dominant or prevalence-dominant period. Thus an unknown proportion of the
relationship between positivity rate and hospitalization rate is likely due to
natural increases in the prevalence. Third, the hospitalization rate is also
dependent on available hospital beds, which we did not consider as a factor
given the limited availability and reliability of such data at the county
level. Thus, some instances where hospitalization would have been an outcome
for a patient except for bed availability were not accounted for, which could
have led to point underestimates of our primary outcome measurements.

Knowing the factors that affect the spread of the virus and hospitalizations
allows local decision-makers to help identify areas at higher risk for severe
COVID-19 and guide resource allocation and implementation of prevention and
mitigation strategies. These findings highlight how the most significant
factors impacting hospitalizations have changed with the pandemic’s evolution.
The positivity rate is the only factor to prevail over time as a significant
and directly correlated with hospitalization rate.

## References

  * [1] Zunyou Wu and Jennifer M McGoogan.  Characteristics of and important lessons from the coronavirus disease 2019 (covid-19) outbreak in china: summary of a report of 72 314 cases from the chinese center for disease control and prevention.  JAMA, 323(13):1239–1242, 2020.
  * [2] Johns hopkins coronavirus resource center. covid-19 map.  Available online: https://coronavirus.jhu.edu/map.html.  (Accessed on 10/05/2021).
  * [3] Maria Nicola, Catrin Sohrabi, Ginimol Mathew, Ahmed Kerwan, Ahmed Al-Jabir, Michelle Griffin, Maliha Agha, and Riaz Agha.  Health policy and leadership models during the covid-19 pandemic-review article.  Int. J. Surg., 81:122–129, 2020.
  * [4] Shahul H Ebrahim, Qanta A Ahmed, Ernesto Gozzer, Patricia Schlagenhauf, and Ziad A Memish.  Covid-19 and community mitigation strategies in a pandemic.  BMJ, 368, 2020.
  * [5] James Hadfield, Colin Megill, Sidney M Bell, John Huddleston, Barney Potter, Charlton Callender, Pavel Sagulenko, Trevor Bedford, and Richard A Neher.  Nextstrain: real-time tracking of pathogen evolution.  Bioinformatics, 34(23):4121–4123, 2018.
  * [6] Maria Bonet, I Blanco, Argimon Pallàs JM, B Clotet, J Ara Del Rey, and et al.  A cost-benefit analysis of the covid-19 asymptomatic mass testing strategy in the north metropolitan area of barcelona.  Int. J. Environ, 18(13), 2021.
  * [7] C Jason Wang, Chun Y Ng, and Robert H Brook.  Response to covid-19 in taiwan: big data analytics, new technology, and proactive testing.  JAMA, 323(14):1341–1342, 2020.
  * [8] Shiyi Cao, Yong Gan, Chao Wang, Max Bachmann, Shanbo Wei, Jie Gong, Yuchai Huang, Tiantian Wang, Liqing Li, Kai Lu, and et al.  Post-lockdown sars-cov-2 nucleic acid screening in nearly ten million residents of wuhan, china.  Nat. Commun, 11(1):1–7, 2020.
  * [9] Yaqing Fang.  Large-scale national screening for covid-19 in china.  J. Med. Virol., 92(11):2266–2268, 2020.
  * [10] Talha Burki.  Mass testing for covid-19.  The Lancet. Microbe., 1(8):e317, 2020.
  * [11] Janice K Louie, Hyman M Scott, Amie DuBois, Natalya Sturtz, Wendy Lu, Juliet Stoltey, Godfred Masinde, Stephanie Cohen, Darpun Sachdev, Susan Philip, and et al.  Lessons from mass-testing for coronavirus disease 2019 in long-term care facilities for the elderly in san francisco.  Clin. Infect. Dis, 72(11):2018–2020, 2021.
  * [12] Flávia Bulegon Pilecco, Carolina Gomes Coelho, Qeren Hapuk Rodrigues Ferreira Fernandes, Ismael Henrique Silveira, Júlia Moreira Pescarini, Naiá Ortelan, Ligia Gabrielli, Estela ML Aquino, and Maurício Lima Barreto.  The effect of laboratory testing on covid-19 monitoring indicators: an analysis of the 50 countries with the highest number of cases.  Epidemiol Serv Saude, 30, 2021.
  * [13] Solomon Hsiang, Daniel Allen, Sébastien Annan-Phan, Kendon Bell, Ian Bolliger, Trinetta Chong, Hannah Druckenmiller, Luna Yue Huang, Andrew Hultgren, Krasovich E, and et al.  The effect of large-scale anti-contagion policies on the covid-19 pandemic.  Nature, 584(7820):262–267, 2020.
  * [14] Daniel B Larremore, Bryan Wilder, Evan Lester, Soraya Shehata, James M Burke, James A Hay, Tambe Milind, Michael J Mina, and Roy Parker.  Test sensitivity is secondary to frequency and turnaround time for covid-19 surveillance.  MedRxiv, 2020.
  * [15] Martin Pavelka, Kevin Van-Zandvoort, Sam Abbott, Katharine Sherratt, Marek Majdan, CMMID COVID, Inštitút Zdravotnỳch Analỳz, Pavol Jarčuška, Marek Krajčí, Stefan Flasche, and et al.  The impact of population-wide rapid antigen testing on sars-cov-2 prevalence in slovakia.  Science, 372(6542):635–641, 2021.
  * [16] Alexis C. Madrigal Robinson Meyer.  How bad is the coronavirus outbreak? here’s a key number. the atlantic, 2020.  Available online: https://www.theatlantic.com/technology/archive/2020/04/us-coronavirus-outbreak-out-control-test-positivity-rate/610132/.  (Accessed on 10/05/2021).
  * [17] Tim R Mercer and Marc Salit.  Testing at scale during the covid-19 pandemic.  Nat. Rev. Genet., 22(7):415–426, 2021.
  * [18] Anne M Neilan, Elena Losina, Audrey C Bangs, Clare Flanagan, Christopher Panella, G Eskibozkurt, Amir Mohareb, Emily P Hyle, Justine A Scott, Milton C Weinstein, and et al.  Clinical impact, costs, and cost-effectiveness of expanded severe acute respiratory syndrome coronavirus 2 testing in massachusetts.  Clin. Infect. Dis., 2020.
  * [19] C Wei, CC Lee, TC Hsu, WT Hsu, CC Chan, SC Chen, and CJ Chen.  Correlation of population mortality of covid-19 and testing coverage: A comparison among 36 oecd countries.  Epidemiol. Infect., 149:e1, 2021.
  * [20] Wikipedia. covid-19 pandemic in california. available online:.  https://en.wikipedia.org/wiki/COVID-19_pandemic_in_California.  (Accessed on 10/05/2021).
  * [21] State of california. california takes action to combat covid-19 — california governor. available online:.  https://www.gov.ca.gov/california-takes-action-to-combat-covid-19/.  (Accessed on 10/05/2021).
  * [22] Office of governor gavin newsom. as california fully reopens, governor newsom announces plans to lift pandemic executive orders. june 11, 2021.  Available online: https://www.gov.ca.gov/2021/06/11/as-california-fully-reopens-governor-newsom-announces-plans-to-lift-pandemic-executive-orders/.  (Accessed on 09/22/2021).
  * [23] Cheri Mossburg.  Here’s what you need to know about california’s reopening. cnn.  Available online: https://edition.cnn.com/us/live-news/coronavirus-pandemic-vaccine-updates-06-15-21/index.html.  (Accessed on 10/05/2021).
  * [24] USAFacts.  California coronavirus cases and deaths.  Available online: https://usafacts.org/visualizations/coronavirus-covid-19-spread-map/state/california.  (Accessed on 10/05/2021).
  * [25] Dustin Manduffie.  Covid ravaging the central valley, california’s new virus epicenter. august 4, 2020.  Available online: https://www.courthousenews.com/covid-ravaging-the-central-valley-californias-new-virus-epicenter/.  (Accessed 10/05/2021).
  * [26] Mary Stringini and KJ Hiramoto.  Is los angeles county the new “epicenter” of the covid-19 pandemic?. december 21, 2020.  Available online: https://www.foxla.com/news/is-los-angeles-county-the-new-epicenter-of-the-covid-19-pandemic.  (Accessed 10/05/2021).
  * [27] Susannah Cullinane Paul Vercammen, Melissa Alonso.  La county records more than 1 million coronavirus cases. january 17, 2021\.  Available online: https://edition.cnn.com/2021/01/16/health/los-angeles-county-million-coronavirus/index.html.  (Accessed 10/05/2021).
  * [28] abc-7news. california has lowest covid-19 case rate in us.  Available online: https://abc7news.com/california-covid-ca-coronavirus-rate-pandemic/11033019/.  (Accessed on 10/05/2021).
  * [29] Cbs news. california reports lowest covid-19 case rate in the country.  Available online: https://www.cbsnews.com/news/california-covid-lowest-positivity-rate/.  (Accessed on 10/05/2021).
  * [30] California goverment. tracking covid-19 in california - coronavirus covid-19 response.  Available online: https://covid19.ca.gov/state-dashboard/.  (Accessed on 09/16/2021).
  * [31] Californial department of public health. covid-19 time-series metrics by county and state - datasets - california health and human services open data portal.  Available online: https://data.chhs.ca.gov/dataset/covid-19-time-series-metrics-by-county-and-state.  (Accessed on 09/16/2021).
  * [32] Us census bureau. 2019 data profiles — american community survey.  Available online: https://www.census.gov/acs/www/data/data-tables-and-tools/data-profiles/.  (Accessed on 09/16/2021).
  * [33] The california healthy places index (hpi). data & reports – california healthy places index.  Available online: https://healthyplacesindex.org/data-reports/.  (Accessed on 09/16/2021).
  * [34] Covid-19 community mobility reports. google (2020).  Available online: https://www.google.com/covid19/mobility/. (Accessed on 11/09/2021).
  * [35] Yuki Furuse, Yura K Ko, Kota Ninomiya, Motoi Suzuki, and Hitoshi Oshitani.  Relationship of test positivity rates with covid-19 epidemic dynamics.  Int. J. Environ, 18(9):4655, 2021.
  * [36] Livio Fenga and Mauro Gaspari.  Predictive capacity of covid-19 test positivity rate.  Sensors, 21(7):2435, 2021.
  * [37] Ram C Kafle, Doo Young Kim, Martin E Malandro, and Melinda Miller Holt.  Modeling covid-19 positivity rates and hospitalizations in texas.  Model Assist. Stat. Appl., 16(1):53–58, 2021.
  * [38] Ahmed Al Dallal, Usama AlDallal, and Jehad Al Dallal.  Positivity rate: an indicator for the spread of covid-19.  Curr. Med. Res., 0(0):1–10, 2021.
  * [39] Nan M. Laird and James H. Ware.  Random-effects models for longitudinal data.  Biometrics, 38(4):963–974, 1982.
  * [40] Douglas Bates, Martin Mächler, Ben Bolker, and Steve Walker.  Fitting linear mixed-effects models using lme4.  J. Stat. Softw., 67(1):1–48, 2015.
  * [41] Merlin Chowkwanyun and Adolph L Reed Jr.  Racial health disparities and covid-19—caution and context.  N. Engl. J. Med., 383(3):201–203, 2020.
  * [42] Gabriel J Escobar, Alyce S Adams, Vincent X Liu, Lauren Soltesz, Yi-Fen Irene Chen, Stephen M Parodi, G Thomas Ray, Laura C Myers, Charulata M Ramaprasad, Richard Dlott, and et al.  Racial disparities in covid-19 testing and outcomes: retrospective cohort study in an integrated health system.  Ann. Intern. Med., 174(6):786–793, 2021.
  * [43] Gbenga Ogedegbe, Joseph Ravenell, Samrachana Adhikari, Mark Butler, Tiffany Cook, Fritz Francois, Eduardo Iturrate, Girardin Jean-Louis, Simon A Jones, and et al Onakomaiya, Deborah.  Assessment of racial/ethnic disparities in hospitalization and mortality in patients with covid-19 in new york city.  JAMA Netw. Open, 3(12):e2026881–e2026881, 2020.
  * [44] Laura Jean Podewils, Tori L Burket, Christie Mettenbrink, Abigail Steiner, Allison Seidel, Kenneth Scott, Lilia Cervantes, and Romana Hasnain-Wynia.  Disproportionate incidence of covid-19 infection, hospitalizations, and deaths among persons identifying as hispanic or latino—denver, colorado march–october 2020.  MMWR, 69(48):1812–1816, 2020.
  * [45] Monica Webb Hooper, Anna María Nápoles, and Eliseo J Pérez-Stable.  Covid-19 and racial/ethnic disparities.  JAMA, 323(24):2466–2467, 2020.
  * [46] This time must be different: disparities during the covid-19 pandemic, 2020.
  * [47] Tanmoy Bhowmik, Sudipta Dey Tirtha, Naveen Chandra Iraganaboina, and Naveen Eluru.  A comprehensive analysis of covid-19 transmission and mortality rates at the county level in the united states considering socio-demographics, health indicators, mobility trends and health care infrastructure attributes.  Plos one, 16(4):e0249133, 2021.
  * [48] Raju Gottumukkala, Satya Katragadda, Ravi Teja Bhupatiraju, Md Kamal, Vijay Raghavan, Henry Chu, Ramesh Kolluru, and Ziad. Ashkar.  Exploring the relationship between mobility and covid- 19 infection rates for the second peak in the united states using phase-wise association.  BMC Public Health, 21(1):1–14, 2021.
  * [49] California health and human services open data portal. covid-19 hospital data.  Available online: https://data.chhs.ca.gov/dataset/covid-19-hospital-data.  (Accessed on 06/09/2021).
  * [50] Pierre Nouvellet, Sangeeta Bhatia, Anne Cori, Kylie EC Ainslie, Marc Baguelin, Samir Bhatt, Adhiratha Boonyasiri, Nicholas F Brazeau, Lorenzo Cattarino, Laura V Cooper, and et al.  Reduction in mobility and COVID-19 transmission.  Nat. Commun, 12(1):1–9, 2021.
  * [51] Hamada S Badr, Hongru Du, Maximilian Marshall, Ensheng Dong, Marietta M Squire, and Lauren M Gardner.  Association between mobility patterns and COVID-19 transmission in the USA: a mathematical modelling study.  Lancet Infect Dis, 20(11):1247–1254, 2020.
  * [52] Nittai K Bergman and Ram Fishman.  Mobility levels and covid-19 transmission rates.  medRxiv, 2020.
  * [53] Oliver Gatalo, Katie Tseng, Alisa Hamilton, Gary Lin, and Eili Klein.  Associations between phone mobility data and covid-19 cases.  Lancet Infect Dis, 21(5):e111, 2021.
  * [54] Apple. covid-19 mobility trends reports.  Available online: https://covid19.apple.com/mobility.
  * [55] Social distancing metrics.  Safegraph (2020).  Available online: https://docs.safegraph.com/docs/social-distancing-metrics.

## Supplementary material

### Maps

This maps displays the coefficient value related to the log positivity rate
for each county in the three waves.

Figure S1. Values in the county-level maps represent the effect of the
positivity rate on hospitalizations at each county for each wave. Top Left:
Wave 1. Top Right: Wave 2. Bottom: Wave 3.

### Hospitalizations, testings, and positivity rate.

Figure S2. This figure displays the number of patients hospitalized in an
inpatient bed who have laboratory-confirmed COVID of the California counties
[49] considered in the study and testing per 10K population from January 5,
2020, to September 6, 2021.  Figure S3. Number of patients hospitalized in an
inpatient bed who have laboratory-confirmed COVID (red line) and positivity
rate (7-day moving average, green line) from March 28, 2020 to September 6,
2021.

### Variable description

We describe the co-variable used in the analysis, mobility, age, race,
ethnicity, poverty, and education in the California counties.

#### Demographic variables

Demographic characteristics such as age, ethnicity, and race by county was
obtained from the United State Census Bureau [32].

Table S1. Demographic variables considered in the mixed linear model.

Variable | Description
---|---
Over 65 | Percentage of population ages 65 and above
Black or African | Percentage of Black or African American population
American Indian /and Alaska Native | Percentage of American Indian Alaska Native population
Asian | Percentage of Asian population
Hispanic or Latino | Percentage of Hispanic or Latino population
HPI | Healthy place index

Figure S4. Demographic variables to county level are taken from the United
States Census Bureau [32]. All the values are in percentage on the population
except the HPI [33], which is a number between 0 to 100.

#### Correlation and multicollinearity

To choose the variables used in the model, we checked for the
multicollinearity issue across the independent variables as some county-level
features may be highly correlated. We plot a correlation matrix to highlight
the Pearson correlation coefficient between each independent variable in the
dataset. Figure S5 highlights the weaker correlation across most demographics
variables while finding high correlations of the comorbidities between them
and most of the demographic variables.

Figure S5. Correlation matrix of the demographics variables and comorbidities.

To measures the severity of multicollinearity in our regression analysis, we
estimate the variance inflation factor (VIF) for the previous variables. VIF
indicates the increase in the variance of a regression coefficient for each
variable as a result of correlated predictors. A VIF value of 1 for a variable
implies this variable is not correlated to the remaining ones. When VIF is
higher than 10 there is significant multicollinearity that needs to be
corrected. In Tab. S2, we observe very large values of the VIF. When removing
variable by variable we are left with only the demographic variables given in
the Tab. S1. Therefore we can safely conclude that our analysis was unaffected
by the multicollinearity issue. For this reason, disease prevalence variables
were not included in the analysis.

Table S2. Variance inflation factor. Variable | Variance inflation factor
---|---
Heart disease | 3846.96
Obesity | 235.79
COPD | 1648.60
diabetes | 1430.87
CKD | 3342.10
65+ | 299.79
HPI | 11.71
Black or African American | 6.50
Asian | 11.19
Hispanic or Latino | 73.89

#### Mobility trends

The existence of social contacts could be proxied by mobility data [50, 51,
52, 53], with frameworks such as Google’s Community Mobility Report (CMR)
[34], COVID‑19 - Mobility Trends Reports - Apple [54] and Safegraph [55] being
able to measure mobility, as it measures citizens’ mobility according to
different types.

Our analysis is based on 40 counties of California for which both
hospitalization and Google mobility data were available. Google mobility data
included six data-streams: “grocery and pharmacy,” “parks,” “residential,”
“retail and recreation,” “transit stations,” and “workplaces.” We combined all
Google-specific data streams to obtain a google county mobility measure. We
used an unsupervised machine learning method known as principal component
analysis (PCA) to construct the google mobility index using the six mobility
metrics.The first principal component explained more than 50% of the
variability in the data by each county, indicating a good dimension reduction
(Table S3).

A regression analysis was used to estimate the lag length. The results show
that mobility is correlated with COVID-19 hospitalizations in most counties
with lags of 3-4 weeks.

Table S3. The variance explained by the first principal component for the
Google’s Community Mobility Report (CMR).

County |  Explained variance |  County |  Explained variance |  County |  Explained variance
---|---|---|---|---|---
Alameda |  0.62 |  Mendocino |  0.60 |  San Mateo |  0.65
Amador |  0.43 |  Merced |  0.68 |  Santa Barbara |  0.67
Butte |  0.56 |  Monterey |  0.66 |  Santa Clara |  0.60
Contra Costa |  0.63 |  Napa |  0.56 |  Santa Cruz |  0.60
El Dorado |  0.50 |  Nevada |  0.58 |  Shasta |  0.51
Fresno |  0.67 |  Orange |  0.68 |  Solano |  0.60
Humboldt |  0.60 |  Placer |  0.50 |  Sonoma |  0.66
Imperial |  0.67 |  Riverside |  0.65 |  Stanislaus |  0.62
Kern |  0.60 |  Sacramento |  0.66 |  Tehama |  0.4
Kings |  0.61 |  San Bernardino |  0.62 |  Tulare |  0.57
Lake |  0.65 |  San Diego |  0.71 |  Tuolumne |  0.47
Los Angeles |  0.73 |  San Francisco |  0.73 |  Ventura |  0.56
Madera |  0.51 |  San Joaquin |  0.68 |  Yolo |  0.66
Marin |  0.62 |  San Luis Obispo |  0.65 |  Yuba |  0.54


60.00009pt-\mathbb{E}_{\mu}\left[f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}\right]\bigg{|},$ $\displaystyle T_{2}$
$\displaystyle=\bigg{|}\mathbb{E}_{\mu}\left[f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}\right]-\mathbb{E}_{\mu}\left[f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\right]\bigg{|},$ $\displaystyle T_{3}$
$\displaystyle=\bigg{|}\mathbb{E}_{\widehat{\mu}}\left[f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\right]-\mathbb{E}_{\mu}\left[f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\right]\bigg{|}.$

By (F.18), we can conclude that $T_{1}\xrightarrow{a.s}0$ and by (F.19), we
can conclude that $T_{3}\xrightarrow{a.s}0$. Next, by the properties of
multivariate Gaussian distributions and arguments similar to those leading to
(F.18), we can also show that, as $N\rightarrow\infty$,

$\displaystyle\bigg{|}f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}-f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\mu)\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}\bigg{|}\xrightarrow{a.s}0,$
$\displaystyle\hskip
60.00009pt\bigg{|}f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}-f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\mu)\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\bigg{|}\xrightarrow{a.s}0.$

Finally, as $\|E^{\mathrm{Q}}\|\xrightarrow{a.s}0$, by the Dominated
Convergence theorem and Lemma 4.1, we conclude that

$\bigg{|}f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\mu)\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}-f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\mu)\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\bigg{|}\xrightarrow{a.s}0.$

Therefore,

$\bigg{|}f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}-f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\bigg{|}\xrightarrow{a.s}0.$

Furthermore, since the functions in the above equation are uniformly dominated
by $1$, by the Dominated Convergence Theorem, we have

$\displaystyle\hskip-25.00003pt\bigg{|}\mathbb{E}_{\mu}\left[f((Y^{\mathrm{Q}}+E^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M,\,\|E^{\mathrm{Q}}\|\leq\widebar{M}]}\right]-\mathbb{E}_{\mu}\left[f((Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}}),\mathcal{C}_{\alpha},\widehat{\mu})\mathbbm{1}_{[(Y^{\mathrm{Q}},\widetilde{Y}^{\mathrm{Q}})\in
M]}\right]\bigg{|}\rightarrow 0,$ (F.21)

almost surely, given
$\\{\bar{\bm{V}}_{T,1},\ldots,\bar{\bm{V}}_{T,m},\widehat{\bm{D}}_{1},\ldots,\widehat{\bm{D}}_{m},\bm{V}_{1},\ldots,\bm{V}_{m}\\}$.
In other words, $T_{2}\stackrel{{\scriptstyle a.s.}}{{\to}}0$ conditionally.
Since, $\varepsilon$ chosen in (F.14) is arbitrary, by (F.20), we can get
(F.15) conditioning on

$\\{\bar{\bm{V}}_{T,1},\ldots,\bar{\bm{V}}_{T,m},\widehat{\bm{D}}_{1},\ldots,\widehat{\bm{D}}_{m},\bm{V}_{1},\ldots,\bm{V}_{m}\\}.$

As the conclusion holds regardless of the conditioning event, (F.15) holds
marginally. Now, as $\mathcal{C}_{\alpha}\in\mathscr{C}_{r+\widetilde{r}}$,
Lemma 4.4 implies,

$\displaystyle|\mu(\mathcal{C}_{\alpha})-\widehat{\mu}(\mathcal{C}_{\alpha})|\xrightarrow{a.s}0,\quad\mbox{as
$N\rightarrow\infty$,}$ (F.22)

conditioned on
$\\{\bar{\bm{V}}_{T,1},\ldots,\bar{\bm{V}}_{T,m},\widehat{\bm{D}}_{1},\ldots,\widehat{\bm{D}}_{m},\bm{V}_{1},\ldots,\bm{V}_{m}\\}$.
Since the right-hand side of (F.22) is non-random, (F.22) also holds
unconditionally. Hence, we almost surely have

$\displaystyle\lim_{N\rightarrow\infty}\mathbb{P}_{\mu}\left[(U^{\mathrm{Q}}_{1},\ldots,U^{\mathrm{Q}}_{m},\widetilde{U}^{\mathrm{Q}}_{1},\ldots,\widetilde{U}^{\mathrm{Q}}_{\widetilde{m}})\in\mathcal{C}_{\alpha}\right]$
$\displaystyle=\lim_{N\rightarrow\infty}\mu(\mathcal{C}_{\alpha})\geq\lim_{N\rightarrow\infty}\widehat{\mu}(\mathcal{C}_{\alpha})+\lim_{N\rightarrow\infty}{\color[rgb]{0,0,0}|}\widehat{\mu}(\mathcal{C}_{\alpha})-\mu(\mathcal{C}_{\alpha}){\color[rgb]{0,0,0}|}\geq
1-\alpha.$

Again as,
$\mathbb{P}_{\mu}\left[(U^{\mathrm{Q}}_{1},\ldots,U^{\mathrm{Q}}_{m},\widetilde{U}^{\mathrm{Q}}_{1},\ldots,\widetilde{U}^{\mathrm{Q}}_{\widetilde{m}})\in\mathcal{C}_{\alpha}\right]$
is a non-random quantity, our result follows.

##  Appendix G Choices of Classes of Priors

In this section, we provide examples of two classes of distributions that can
be chosen as $\mathcal{P}$ and $\mathcal{P}_{\nu_{h}}$.

###  G.1 Gaussian Mixture Models

We can choose $\mathcal{P}$ in (2.14) and each $\mathcal{P}_{\nu_{h}}$ in
(2.16) to be the set of distributions on $\mathbb{R}^{r+\widetilde{r}}$ and
$\mathbb{R}^{r_{h}}$ respectively, which are absolutely continuous with
respect to the Lebesgue measure and have bounded density. From [17, Chapter
3], we know that the class of Gaussian mixture distributions with large number
of components can approximate any distribution up to negligible error.
Inspired by this fact, for implementation purposes, we can approximate
$\mathcal{P}$ and all of the $\mathcal{P}_{\nu_{h}}$’s using Gaussian mixture
distributions with a large number of components. The number of components can
be chosen according to the size of the data and its complexity. In other
words, our approximating class of priors can be

$\widehat{\mathcal{P}}=\left\\{\sum_{k=1}^{K}\pi_{k}\,N_{r+\widetilde{r}}(m_{k},\bm{\Sigma}_{k}):m_{k}\in\mathbb{R}^{r+\widetilde{r}},\,\bm{\Sigma}_{k}\in\mathbb{S}^{r+\widetilde{r}}_{+},\,\pi_{k}\in[0,1]\;\mbox{for
$k\in[K]$}\right\\}.$ (G.1)

Similarly, for each $h\in[m]$, we can approximate $\mathcal{P}_{\nu_{h}}$ by

$\widehat{\mathcal{P}}_{\nu_{h}}=\left\\{\sum_{k=1}^{K_{h}}\pi_{k,h}\,N_{r_{h}}(m_{k,h},\bm{\Sigma}_{k,h}):m_{k,h}\in\mathbb{R}^{r_{h}},\,\bm{\Sigma}_{k,h}\in\mathbb{S}^{r_{h}}_{+},\,\pi_{k,h}\in[0,1]\;\mbox{for
$k_{h}\in[K_{h}]$}\right\\}.$ (G.2)

By working with these prior classes $\widehat{\mathcal{P}}$ and
$\widehat{\mathcal{P}}_{\nu_{h}}$ for $h\in[m]$, estimating $\mu$ and each
$\nu_{h}$ reduces to estimating the mixing proportions and the component means
and variances in a Gaussian mixture.

If $r_{h}$ for most $h\in[m]$ are very large, we can model $\bm{\Sigma}_{k}$
and $\bm{\Sigma}_{k,h}$ by diagonal matrices. In such situations, it might be
essential to have more components in the Gaussian mixture to account for the
simplification in the covariance structure, but overall we may need to
estimate fewer parameters, and consequently, we may have greater estimation
accuracy.

###  G.2 Non Parametric Maximum Likelihood Estimators

An alternative approach for estimating the priors $\mu$ and $\nu_{h}$ is to
consider their nonparametric maximum likelihood estimators. This approach is
advocated in [46]. It is important to observe that, this estimator can suffer
from the “curse of dimensionality” if $r+\widetilde{r}$ or any of the $r_{h}$
are large. However, if the signal strengths $(\bm{D}_{h})_{ii}$ for
$i\in[r_{h}]$ and $h\in[m]$ are extremely high, then such “curse of
dimensionality can be avoided. For constructing the NPMLE, we can approximate
$\mathcal{P}$ and all of the $\mathcal{P}_{\nu_{h}}$’s using discrete
distributions with an appropriately chosen support. In particular, we can set
the support of $\mu$, denoted by
$\mathcal{S}_{\mu}\subseteq\mathbb{R}^{r+\widetilde{r}}$, as

$\mathcal{S}_{\mu}:=\left\\{((\widehat{\bm{S}}^{L,\mathrm{pc}}_{0,1})^{-1}({\bm{U}}^{\mathrm{pc}}_{0,1})_{i*},\ldots,(\widehat{\bm{S}}^{L,\mathrm{pc}}_{0,m})^{-1}({\bm{U}}^{\mathrm{pc}}_{0,m})_{i*},\widehat{\bm{L}}^{-1}_{1}(\widetilde{\bm{X}}_{1})_{i*},\ldots,\widehat{\bm{L}}^{-1}_{\widetilde{m}}(\widetilde{\bm{X}}_{\widetilde{m}})_{i*}):i\in[N]\right\\}.$

In other words, each point in the support of $\mu$ can be chosen to be one row
in the column concatenated matrix

$\begin{bmatrix}(\widehat{\bm{S}}^{L,\mathrm{pc}}_{0,1})^{-1}{\bm{U}}^{\mathrm{pc}}_{0,1}&\ldots&(\widehat{\bm{S}}^{L,\mathrm{pc}}_{0,m})^{-1}{\bm{U}}^{\mathrm{pc}}_{0,m}&\widehat{\bm{L}}^{-1}_{1}\widetilde{\bm{X}}_{1}&\ldots&\widehat{\bm{L}}^{-1}_{\widetilde{m}}\widetilde{\bm{X}}_{\widetilde{m}}\end{bmatrix}\in\mathbb{R}^{n\times(r+\widetilde{r})}.$

Then, our approximating class of priors will be

$\widehat{\mathcal{P}}=\\{\mbox{all prior $\mu$ supported on
$\mathcal{S}_{\mu}$}\\}.$ (G.3)

Similarly, for each $h\in[m]$, the support of $\nu_{h}$, denoted by
$\mathcal{S}_{\nu_{h}}\subset\mathbb{R}^{r_{h}}$, can be set at

$\mathcal{S}_{\nu_{h}}:=\left\\{(\widehat{\bm{S}}^{R,\mathrm{pc}}_{0,h})^{-1}({\bm{V}}^{\mathrm{pc}}_{0,h})_{i*}:i\in[p_{h}]\right\\}.$

Thus, each point in the support of $\nu_{h}$ is a row in
$(\widehat{\bm{S}}^{R}_{0,h})^{-1}{\bm{V}}_{0,h}$, and we can approximate
$\mathcal{P}_{\nu_{h}}$ by

$\widehat{\mathcal{P}}_{\nu_{h}}=\\{\mbox{all prior $\nu_{h}$ supported on
$\mathcal{S}_{\nu_{h}}$}\\}.$ (G.4)

By working with these discrete priors with a fixed support, estimating $\mu$
and each $\nu_{h}$ reduces to estimating the mixing proportions in a mixture
of degenerate Gaussians where the number of components equals the number of
support points.