---
abstract: 'Automatic machine learning-based detectors of various psychological and social phenomena (e.g., emotion, stress, engagement) have great potential to advance basic science. However, when a detector $d$ is trained to approximate an existing measurement tool (e.g., a questionnaire, observation protocol), then care must be taken when interpreting measurements collected using $d$ since they are one step further removed from the underlying construct. We examine how the accuracy of $d$, as quantified by the correlation $q$ of $d$'s outputs with the ground-truth construct $U$, impacts the estimated correlation between $U$ (e.g., stress) and some other phenomenon $V$ (e.g., academic performance). In particular: (1) We show that if the true correlation between $U$ and $V$ is $r$, then the expected sample correlation, over all vectors $\mathcal{T}^n$ whose correlation with $U$ is $q$, is $qr$. (2) We derive a formula for the probability that the sample correlation (over $n$ subjects) using $d$ is positive given that the true correlation is negative (and vice-versa); this probability can be substantial (around $20-30\%$) for values of $n$ and $q$ that have been used in recent affective computing studies. (3) With the goal to reduce the variance of correlations estimated by an automatic detector, we show that training multiple neural networks $d^{(1)},\ldots,d^{(m)}$ using different training architectures and hyperparameters for the same detection task provides only limited "coverage" of $\mathcal{T}^n$.'
bibliography:
- 'paper.bib'
---

\[

0.3in \]

Introduction
============

Automatic classifiers have the potential to advance basic research in psychology, education, medicine, and many other fields by serving as *scientific instruments* that can measure behavioral, medical, social, and other phenomena with higher temporal resolution, lower cost, and greater consistency than is possible with traditional methods such as human-coded questionnaires or observation protocols. The affective computing @picard2010affective community is starting to see some first fruits of this potential: Perugia, et al. @perugia2017electrodermal used the Empatica E4 wristband sensor to explore the relationship between participants' ($n=14$) electrodermal activity (EDA) and their emotional states when playing cognitive games. Parra, et al. @parra2017multimodal used the Emotient facial expression recognition software to identify a positive correlation ($r=0.32$, $n=59$ participants) between emotions and adult attachment @collins1990adult. Chen, et al. @chen2014initial used Emotient in a study of how facial emotion is associated with job interview performance among $n=4$ participants. In most empirical studies designed to measure the relationship between two phenomena $U$ and $V$ (e.g., engagement @monkaresi2017automated, grit @duckworth2007grit, stress, attachment @collins1990adult, academic performance, etc.), the investigator chooses a validated instrument for each phenomenon and records measurements of each variable for $n$ participants. She/he then computes a statistic, such as the Pearson product-moment coefficient, that captures the magnitude and sign (as well as statistical significance) of the relationship between the two variables. Machine learning offers the potential to create a new array of scientific instruments with important advantages compared to standard measurement tools. However, they also bring a potential pitfall that – while not fundamentally new, i.e., there is always a separation between a construct and its measurement – is exacerbated compared to using standard measurements: If one creates a new scientific instrument by training an automatic detector $d$ to mimic a standard instrument as closely as possible, then $d$ is *one degree of separation further removed from the underlying phenomenon $U$* – i.e., it is an estimator of another estimator.

<span>**Motivating example**</span>: Suppose a behavioral scientist wishes to examine the relationship between stress (construct $U$) and academic performance (construct $V$). Using a traditional approach, she/he could conduct an experiment in which each participant completes some cognitively demanding task and then takes a test. To measure stress, the scientist could also ask each participant to complete an established survey, e.g., the Dundee State Stress Questionnaire @matthews1999validation. The relationship between $U$ and $V$ could then be estimated as the correlation $r=\rho({\mathbf{u}},{\mathbf{v}})$ between the vector of test scores ${\mathbf{v}}$ and the corresponding vector of stress measurements ${\mathbf{u}}$ over all $n$ participants.

However, suppose that the researcher also has access to an *automatic stress detector* $d$ that uses the participant's face pixels to measure his/her stress level. Suppose that the accuracy of $d$ was previously validated w.r.t. a standard stress questionnaire (like @matthews1999validation), and the validation showed that the outputs of $d$, which we denote with ${\widehat{\bf u}}$, have an expected correlation of $q$ with the standard questionnaire. What could go wrong, in terms of spurious deductions, when the correlation between $U$ and $V$ is estimated as $\rho({\widehat{\bf u}},{\mathbf{v}})$ instead of $\rho({\mathbf{u}},{\mathbf{v}})$?

Figure \[fig:example\] shows one hypothetical example of what can go wrong: vectors ${\mathbf{u}},{\mathbf{v}}\in\mathbb{R}^n$ contain measurements from $n$ participants of constructs $U$ and $V$, respectively, where ${\mathbf{u}}$ is obtained through a standard instrument. The Pearson product-moment correlation between two vectors can be written: $$\rho({\mathbf{u}},{\mathbf{v}}) = \frac{\left({\mathbf{u}}- \mu_{{\mathbf{u}}} \right)^\top \left({\mathbf{v}}- \mu_{{\mathbf{v}}}\right)}{\|{\mathbf{u}}- \mu_{{\mathbf{u}}}\|_2 \|{\mathbf{v}}- \mu_{{\mathbf{v}}}\|_2}$$ where $\mu_{{\mathbf{u}}}$ (or $\mu_{{\mathbf{v}}}$) is a vector whose elements equal the mean value of ${\mathbf{u}}$ (or ${\mathbf{v}}$). Defined in this way, the value of $\rho$ is random if either of its two arguments is random. If ${\mathbf{u}}$ and ${\mathbf{v}}$ are both normalized to have 0-mean and unit-length, then their correlation depends only on the *angle* between them: $$\rho({\mathbf{u}},{\mathbf{v}}) = {\mathbf{u}}^\top {\mathbf{v}}= \cos \angle({\mathbf{u}},{\mathbf{v}})$$ In the figure, this correlation is $\cos(105^\circ) \approx -.259$, i.e., the data suggest that $U$ is *negatively* correlated with $V$. Suppose instead that the researcher had used an automatic detector $d$ to obtain ${\widehat{\bf u}}$, where prior analysis had established that the expected correlation of $d$'s outputs and the standard instrument was $q= \cos(30^\circ)\approx 0.866$. If the researcher uses the correlation $\rho({\widehat{\bf u}},{\mathbf{v}})$ to estimate the relationship between $U$ and $V$, then she/he would obtain $\cos(135^\circ) = -0.707$ – a much larger magnitude, but at least the same sign as, the $-0.259$ correlation obtained using a standard instrument for $U$. But the bigger problem is the following: ${\widehat{\bf u}}$ is not the only vector whose correlation with the "ground-truth" measurements ${\mathbf{u}}$ is $q$. Vector ${\widehat{\bf u}}'$ also has the same correlation. If the researcher obtained measurements ${\widehat{\bf u}}'$, then she/he would deduce a *positive* correlation of $\rho({\widehat{\bf u}}',{\mathbf{v}})=\cos(75^\circ) \approx 0.259$ – this is opposite to the correlation obtained with a standard instrument.

In this paper we explore how the accuracy $q$ of a scientific instrument $d$, as measured by the Pearson correlation with the ground-truth construct $U$, impacts the estimated correlation between constructs $U$ and $V$. Although there are various ways of quantifying the relationship between two vectors of measurements (e.g., RMSE, MAE), the Pearson correlation is one of the most commonly used metrics. <span>**Contributions**</span>: (1) We prove that $\textrm{E}[\rho({\widehat{\bf \mathsf u}}, {\mathbf{v}})]=qr$, where $r$ is the true correlation between $U$ and $V$ and random vector ${\widehat{\bf \mathsf u}}$ is sampled uniformly over the $(n-3)$-sphere $\mathcal{T}^n$ of $0$-mean unit-vectors whose correlation with ${\mathbf{u}}$ is $q$. Next, as one of the most fundamental aspects of the relationship between two variables is whether they are positively or negatively correlated, (2) we derive a function $h$ to compute the probability that the sample correlation (over $n$ subjects) using $d$ is positive, given that the true correlation between $U$ and $V$ is negative (and vice-versa). We also prove that $h$ is monotonically decreasing in $n$ and in $q$, i.e., the danger of a false correlation is mitigated by training a more accurate detector or collecting data from more participants. Finally, (4) we explore to what extent the sphere $\mathcal{T}^n$ can be "covered" by measurement vectors ${\widehat{\bf \mathsf u}}^{(1)},\ldots,{\widehat{\bf \mathsf u}}^{(m)}$ obtained by training $m$ different neural networks on the same dataset for the same detection task but using different configurations (e.g., architectures, hyperparameters, etc.). We also devise a novel technique to visualize this coverage of $\mathcal{T}^n$.

Related Work
============

The issue of how product-moment (Pearson) correlations among a subset of variables constrain the possible correlations among the remaining variables has interested statisticians since the 1960s. While there has been significant prior work on the trivariate case in particular, we are not aware of any work that proves exactly the same results as what we present here. @priest1968range showed a lower bound on the mean intercorrelation between variables. @glass1970geometric, and also @leung1975note, proved that, in trivariate distributions, there are range restrictions on the possible correlations between $U$ and $V$ when the correlations between $V$ and $W$ and between $U$ and $W$ are already known. @olkin1981range extended this result to multivariate distributions beyond 3 variables.

More recent, and most similar to our work, is a study by @carlson2012understanding from the operations research community in 2012. They examined the methodological risk of using proxy measures to estimate the correlations between different constructs. Using analytical results by @leung1975note, they show how the observed correlations between ${\mathbf{u}}$ and ${\widehat{\bf u}}$ can vary substantially as a function of the reliability of a proxy measure $\widehat{{\mathbf{u}}}$ of ${\mathbf{u}}$. In contrast to our work, theirs is based on simulations and contains no formal proofs.

Finally, which vector of measurements ${\widehat{\bf \mathsf u}}\in \mathcal{T}^n$ is obtained could potentially be related to subgroup membership – e.g., gender, ethnicity, age. From the perspective of *fairness* in machine learning @barocas2017fairness [@kearns2018empirical], it could therefore be important to understand how much variation there is among different subgroup populations over the different ${\widehat{\bf \mathsf u}}$ that are obtained from the scientific instrument.

Modelling assumptions
=====================

<span>**Notation**</span>: We typeset random variables in font; all other variables are fixed (non-random). $\mathbf{u}$ and $\mathbf{v}$ are fixed $n$-vectors of ground-truth measurements of two phenomena $U$ and $V$, respectively. $\hat{\mathsf u}$ is a random $n$-vector (sampled from $\mathcal{T}^n$), obtained from scientific instrument $d$, containing noisy measurements of $\mathbf{u}$.

For our theoretical results (Propositions \[prop:qr\] through \[prop:monotone2\]), we assume the correlation between $\hat{\mathsf u}$ and $\mathbf{u}$ is exactly $q$; then, $\hat{\mathsf u}$ is sampled uniformly from the sphere $\mathcal{T}^n$ of all such vectors. However, for our empirical results regarding the probability of a "false correlation" (see Section \[sec:false\_corr\]), we relax this assumption: It is unlikely that instrument $d$ (that we assume was previously estimated to have correlation $q$ w.r.t. ground-truth) always produces a vector $\hat{\mathsf u}$ whose correlation with $\mathbf{u}$ is *exactly* $q$. Instead, the actual correlation $\hat{\mathsf q}$ of $\hat{\mathsf u}$ and $\mathbf{u}$ comes from a sampling distribution of Pearson correlations (with "true" correlation $q$ and the number of subjects $n$ as parameters; see Section \[sec:sampling\_dist\]). Then, given a fixed $\hat{\mathsf q}$, we sample $\hat{\mathsf u}$ from the corresponding $\mathcal{T}^n$ (which depends on $\hat{\mathsf q}$). When we compute the probability of a "false correlation" in our case studies (Section \[sec:case\_studies\]), we marginalize over $\hat{\mathsf q}$.

Expected Correlation of ${\widehat{\bf \mathsf u}}\in \mathcal{T}^n$ with ${\mathbf{v}}$ {#sec:qr}
========================================================================================

When we use an automatic classifier $d$ to obtain a vector of measurements, then we obtain a vector ${\widehat{\bf u}}$ whose correlation with the underlying construct $U$ (e.g., stress) is $q$. However, as illustrated in the example above, there can be multiple such vectors, and which one is obtained can make a big difference on the estimated correlation. As we show below, the set of $0$-mean unit-length vectors with a fixed correlation to another unit-vector is an $(n-3)$-sphere embedded in $\mathbb{R}^n$. If we sampled uniformly at random from this sphere, then what would be the expected sample correlation between ${\widehat{\bf \mathsf u}}$ and some other vector ${\mathbf{v}}$ (e.g., academic performance)?

To simplify our analyses below, we assume ${\mathbf{u}},{\widehat{\bf u}},{\mathbf{v}}$ all have $0$-mean and unit-length since Pearson correlation is invariant to these quantities. (Regarding the uniformity assumption: see Future Work in Section \[sec:conclusions\].)

\[prop:qr\] Let ${\mathbf{u}},{\mathbf{v}}$ be $n$-dimensional, $0$-mean, unit-length vectors with a Pearson product-moment correlation $\rho({\mathbf{u}},{\mathbf{v}})=r$. Then (1) the set $\mathcal{T}^n$ of $0$-mean, unit-length vectors whose correlation with ${\mathbf{u}}$ is $q$ is an $(n-3)$-sphere embedded in $\mathbb{R}^n$. Moreover, (2) if ${\widehat{\bf \mathsf u}}$ is a random vector sampled uniformly from $\mathcal{T}^n$, then the expected sample correlation $\textrm{E}[\rho({\widehat{\bf \mathsf u}},{\mathbf{v}})]=qr$.

The set of all $0$-mean $n$-vectors constitutes a hyperplane $$\mathcal{H} \doteq \{ \mathbf{x} \in \mathbb{R}^n: \mathbf{1}^\top \mathbf{x}=0 \}$$ that passes through the origin with normal vector $\mathbf{1} \doteq (1,\ldots, 1)$. The set of all unit-length vectors constitutes an $(n-1)$-sphere $$\mathcal{S}^{n-1} \doteq \{ \mathbf{x} \in \mathbb{R}^n: \|\mathbf{x}\|_2 = 1 \}$$ embedded in $\mathbb{R}^n$. Therefore, ${\mathbf{u}},{\mathbf{v}},{\widehat{\bf u}}\in \mathcal{H} \cap \mathcal{S}^{n-1}$. Figure \[fig:example\] (left) shows $\mathcal{H}$ in blue, as well as the intersection of $\mathcal{H}$ with $\mathcal{S}^{n-1}$ as a red circle. Since all three vectors have $0$-mean and unit-length, then the correlations between these vectors depend only on the angles between them. Hence, w.l.o.g. we can rotate the axes so that $\mathcal{H}$ consists of all vectors whose first coordinate is $0$, and all correlations will be preserved. After doing so, the only remaining constraint is that the projected vectors have unit-length.

More precisely, we can compute an orthonormal basis $\mathbf{B}$ such that the first coordinate of vector $\mathbf{B} \mathbf{x}$ is 0 for every $\mathbf{x} \in \mathcal{H}$, and such that $$\begin{aligned}
\mathbf{B} {\mathbf{u}}&=& (0,1,\overbrace{0,0,\ldots,0}^{n-2}) \label{eqn:transformed_u}\\
\mathbf{B} {\mathbf{v}}&=& (0,a,b,0,\ldots,0)\end{aligned}$$ Geometrically, this means that we can define $\mathbf{B}$ so that the projected ${\mathbf{u}},{\mathbf{v}}$ lie in the plane spanned by the second and third vectors in basis $\mathbf{B}$ (see Figure \[fig:example\] (right)) – this makes the rest of the derivation much simpler. $a$ represents the component of ${\mathbf{v}}$ parallel to ${\mathbf{u}}$, and $b$ is the component orthogonal to ${\mathbf{u}}$. Since the correlation between ${\mathbf{u}}$ and ${\mathbf{v}}$ is $r$, and since $\mathbf{B}$ is orthonormal, then $$\begin{aligned}
\lefteqn{\left(\mathbf{B} {\mathbf{u}}\right)^\top \left(\mathbf{B} {\mathbf{v}}\right) = {\mathbf{u}}^\top {\mathbf{v}}} &&\\
         &=& r \\
         &=& 0\times0 + 1\times a + 0\times b + 0 + \ldots + 0 \\
     &=& a\end{aligned}$$ and hence $a=r$. Since $\|{\mathbf{v}}\|_2=\|\mathbf{B} {\mathbf{v}}\|_2 = 1$, then $b=\sqrt{1-r^2}$. Now consider any vector ${\widehat{\bf u}}$ whose correlation with ${\mathbf{u}}$ is $q$. Let us define $(\hat{u}_1, \ldots, \hat{u}_n) \doteq \mathbf{B} {\widehat{\bf u}}$. By construction of $\mathbf{B}$, we already know that $\hat{u}_1=0$. We also have $$\begin{aligned}
\lefteqn{\left(\mathbf{B} {\widehat{\bf u}}\right)^\top \left(\mathbf{B} {\mathbf{u}}\right) = {\widehat{\bf u}}^\top {\mathbf{u}}} &&\\
         &=& q \\
         &=& \hat{u}_1 \times 0 + \hat{u}_2 \times 1 + \hat{u}_3 \times 0 + \ldots + \hat{u}_n \times 0 \\
     &=& \hat{u}_2\end{aligned}$$ and hence $\hat{u}_2 = q$. Since $\mathbf{B} {\widehat{\bf u}}$ is a unit-vector, then $$\mathbf{B} {\widehat{\bf u}}\in \left\{ (0, q, \hat{u}_3, \ldots, \hat{u}_n): \sum_{i=3}^n \hat{u}_i^2 = 1 - q^2 \right\}$$ This set is the surface of an $(n-3)$-sphere, with radius $\sqrt{1-q^2}$, embedded in $\mathbb{R}^n$. Since $\mathbf{B}$ simply rotates the axes, then $\mathcal{T}^n$ is likewise a $(n-3)$-sphere embedded in $\mathbb{R}^n$. This proves part 1.

For part 2: When sampling uniformly from $\mathcal{T}^n$, the distribution of $\hat{\mathsf u}_3$ on the $(n-3)$-sphere is symmetrical about 0. Then $\textrm{E}[\hat{\mathsf u}_3]=0$, and hence: $$\begin{aligned}
\textrm{E}[\rho({\widehat{\bf \mathsf u}}, {\mathbf{v}})] &=& \textrm{E}[{\widehat{\bf \mathsf u}}^\top {\mathbf{v}}] \\
             &=& \textrm{E}[(\mathbf{B} {\widehat{\bf \mathsf u}})^\top (\mathbf{B} {\mathbf{v}})] \\
             &=& \textrm{E}[0 + q\times r + \hat{\mathsf u}_3\times \sqrt{1-r^2}] \\
             &=& qr + \textrm{E}[\hat{\mathsf u}_3] \sqrt{1-r^2} \\
                      &=& qr\end{aligned}$$

<span>**Example**</span>: For the case $n=3$, consider the four vectors shown in Figure \[fig:example\] (left) whose values are approximately: $$\begin{array}{ll}{\mathbf{u}}= (.816, -.408, -.408) & {\mathbf{v}}= (-.211, -.577, .788)\\
                 {\widehat{\bf u}}= (.707, 0, -.707) & {\widehat{\bf u}}' = (.707, -.707, 0)  \end{array}$$ By construction, $\rho({\widehat{\bf u}},{\mathbf{u}})=\rho({\widehat{\bf u}}',{\mathbf{u}})=\cos(30^\circ)=q$, and $\rho({\mathbf{u}},{\mathbf{v}})=\cos(105^\circ)=r$. Via a change of basis $\mathbf{B}$, the vectors can be rotated so that $$\begin{aligned}
\mathbf{B} {\mathbf{u}}&=& (0, 1, 0)\\
\mathbf{B} {\mathbf{v}}&=& (0, \cos(105^\circ), \sin(105^\circ))\\
\mathbf{B} {\widehat{\bf u}}&=& (0, \cos(30^\circ), -\sin(30^\circ))\\
\mathbf{B} {\widehat{\bf u}}' &=& (0, \cos(30^\circ), \sin(30^\circ))\end{aligned}$$ The rotated vectors are shown in Figure \[fig:example\] (right). The set $\mathcal{T}^3$ contains exactly two elements (since it is a $0$-sphere): ${\widehat{\bf u}}$ and ${\widehat{\bf u}}'$. If ${\widehat{\bf \mathsf u}}$ is sampled uniformly at random from $\mathcal{T}^3$, then $\textrm{E}[\rho({\widehat{\bf \mathsf u}}, {\mathbf{v}})]=qr\approx -.224$. This result agrees with $$\begin{aligned}
\frac{1}{2} \left[ \rho({\widehat{\bf u}},{\mathbf{v}}) + \rho({\widehat{\bf u}}',{\mathbf{v}})\right] &=& \frac{1}{2} \left[ \cos(135^\circ)+ \cos(75^\circ)\right] \\ & \approx & -.224\end{aligned}$$

Probability of false correlations {#sec:false_corr}
=================================

One of the most fundamental distinctions is whether two phenomena are positively or negatively correlated with each other (or neither). What is the probability that $\rho({\widehat{\bf \mathsf u}}, {\mathbf{v}})\geq 0$ given that the correlation $r<0$ (*false positive correlation*); or that $\rho({\widehat{\bf \mathsf u}}, {\mathbf{v}})< 0$ given that the correlation $r\geq 0$ (*false negative correlation*)? How do these probabilities change as $n$ increases or $q$ increases? The proofs of the following propositions are given in the appendix.

\[prop:deviation\] Let $q \in (0,1]$ be the correlation between the detector's output ${\widehat{\bf \mathsf u}}$ and ground-truth ${\mathbf{u}}$; let $r$ be the correlation between ${\mathbf{u}}$ and ${\mathbf{v}}$; and let ${\widehat{\bf \mathsf u}}$ be sampled uniformly from $\mathcal{T}^n$. If $r <0$, then the probability of a *false positive* correlation (in the sense defined above) is given by the function $$h(n,q,r) =
\left\{ \begin{array}{ll}\frac{1}{2} \textrm{I}[c^2 \leq 1-q^2] & n=3 \\
 \frac{1}{2} \int_0^\infty f_1(t) F_{n-3}\left(\frac{1 - q^2 - c^2}{c^2} t\right) dt & n>3\end{array}\right.$$ where $\textrm{I}[\cdot]$ is the 0/1 indicator function, $f_k$ and $F_k$ are the PDF and CDF of a $\chi^2$-random variable with $k$ degrees of freedom, and $c = |qr|/\sqrt{1-r^2}$. If $r > 0$, then the probability of a *false negative* correlation is also given by $h$.

\[prop:monotone\] For every fixed $c>0$ and $q \in (0,1]$, function $h$ is monotonically decreasing in $n$.

\[prop:monotone2\] For every fixed $n> 3$, function $h$ is monotonically decreasing in $q \in (0,1]$.

Propositions \[prop:monotone\] and \[prop:monotone2\] imply that the probability of a false correlation diminishes as $n$ increases or $q$ increases.

Marginalizing over the sampling distribution of $\hat{\mathsf q}$ {#sec:sampling_dist}
-----------------------------------------------------------------

Up to now we have glossed over the important detail that, when a scientific instrument with *average* accuracy (Pearson correlation) of $q$ is used to obtain measurements for $n$ subjects, the correlation of the sampled ${\widehat{\bf u}}$ with their ground-truth values need not be exactly $q$; rather, the actual correlation $\hat{\mathsf q}$ is drawn from a sampling distribution $\mathrm{Pr}(\hat{\mathsf q}\ |\ q, n)$. Particularly for small $n$, $\hat{\mathsf q}$ can deviate substantially from $q$. Hence, to compute the probability of a false correlation, it is necessary to marginalize (via numeric integration) over $\hat{\mathsf q}$: $$\int_{\hat{\mathsf q}} h(n,\hat{\mathsf q},r) \mathrm{Pr}(\hat{\mathsf q}\ |\ q, n) d\hat{\mathsf q}$$ The sampling distribution of $\hat{\mathsf q}$ can be estimated using the formula derived by @soper1913probable; see the appendix for more details.

Case Studies {#sec:case_studies}
------------

To put these theoretical results into perspective, we conducted simulations based on two recent affective computing studies that used automated detectors as scientific instruments. The first study ($n=14$), by @perugia2017electrodermal, used an Empatica E4 wrist sensor to investigate how electrodermal activity (EDA) ($U$) is correlated with the subjects' emotions ($V$). The second study ($n=20$), by @whitehill2014faces, explored the relationship between student engagement ($U$), as measured by an engagement detector that analyzes static images of students' faces, and test performance ($V$) in a cognitive skills training task. In order to estimate the probability of a false correlation (in the sense described above), we need to know the accuracy of the automatic detector – i.e., the correlation $q$ between the automatic measurements and ground-truth of construct $U$ – as well as the *true* correlation $r$ between constructs $U$ and $V$.

<span>**Estimating $q$ and $r$**</span>: The value of $q$ can easily be estimated using cross-validation or other standard procedures. For the first study (EDA), we use the value $q=0.57$ reported in @poh2010wearable for cognitive tasks with a distill forearm sensor of EDA. The value of $r$ is not knowable without access to ground-truth measurements; instead, we hypothesize that the ground-truth correlation between $U$ and $V$ is exactly what was estimated by the authors @perugia2017electrodermal using the E4 sensor and emotion survey instruments: $r=-.497$. For the second study (Engagement), we use the value $q=0.50$ reported in @whitehill2014faces that was obtained using subject-independent cross-validation. For $r$, we use the correlation obtained by the authors ($r=0.37$) when correlating test performance with *human*-labeled student engagement.

<span>**Results**</span>: Plots of the probability of a false correlation (obtained from function $h$ derived above) as a function of the number of participants $n$ are shown for each study (with their associated $q$ and $r$ values) in Figure \[fig:curves\]. The red dot in each graph shows the actual number of participants from each experiment. Even for $n \geq 100$ subjects, the probability is non-trivial. For the values $n=14$ and $n=20$, these probabilities are substantial – around $20\%$ for the EDA study and around $30\%$ for the Engagement study. <span>**The possibility of a false correlation is *not* protected against by statistical significance testing**</span> – it is possible for the estimated correlation between constructs $U$ and $V$ to be highly significant and yet have the wrong sign compared to the ground-truth correlation. While this is almost always theoretically possible due to the inherent separation between a construct and its measurement, the use in basic research of automatic detectors that are trained to estimate another estimator can make this problem worse.

Coverage of $\mathcal{T}^n$ when training a detector
====================================================

Given that *which* vector ${\widehat{\bf \mathsf u}}\in \mathcal{T}^n$ is obtained from an automatic detector $d$ can substantially impact the estimated correlation $\rho({\widehat{\bf \mathsf u}}, {\mathbf{v}})$ between constructs $U$ and $V$, it could be useful to *average* the sample correlations over *many* vectors ${\widehat{\bf \mathsf u}}^{(1)},\ldots,{\widehat{\bf \mathsf u}}^{(m)}$ from $\mathcal{T}^n$, i.e., to compute $\frac{1}{m} \sum_{i=1}^m \rho({\widehat{\bf \mathsf u}}^{(i)}, {\mathbf{v}})$. This could help to reduce the variance of the estimator. In this section we explore whether it is feasible to generate many different ${\widehat{\bf \mathsf u}}^{(1)},\ldots,{\widehat{\bf \mathsf u}}^{(m)}$, all with similar correlation $q$ with ground-truth ${\mathbf{u}}$, by training a set of automatic detectors $d^{(1)},\ldots,d^{(m)}$ using slightly different training configurations. In particular, we varied: (1) the architecture (VGG-16 @simonyan2014very versus ResNet-50 @he2016deep) and (2) the random seed of weight initialization. Inspired by recent work by Huang, et al. @huang2017snapshot on how an entire ensemble of detectors can be created during a *single* training run, we also varied (3) the number of training epochs, and saved snapshots of the trained detectors at regular intervals.

During training, each detector's estimates ${\widehat{\bf \mathsf u}}$ of the test labels evolves, and so does the correlation between ${\widehat{\bf \mathsf u}}$ and the ground-truth labels ${\mathbf{u}}$. However, for the tasks we examined (described below), the test correlations tend to stabilize over time, and they converge to roughly the same value even across different training runs and detection architectures. Given a set of measurement vectors ${\widehat{\bf \mathsf u}}^{(1)},\ldots,{\widehat{\bf \mathsf u}}^{(m)}$ (produced by detectors $d^{(1)},\ldots,d^{(m)}$) whose accuracies (Pearson correlations with ground-truth) are all approximately $q$, we can project them onto the $(n-3)$-sphere $\mathcal{T}^n$ of $0$-mean, unit-length vectors whose correlation with ${\mathbf{u}}$ is $q$. We can then visualize the "coverage" of this sphere by projecting it onto a 2-D plane, and also compare the coverage to a random sample of $m$ elements of $\mathcal{T}^n$.

We explored the coverage of $\mathcal{T}^n$ for two automatic face analysis problems: student engagement recognition and age estimation using the HBCU @whitehill2014faces (Engagement) and GENKI @GENKI (Age) datasets, respectively; see Figure \[fig:datasets\] for labeled examples.

<span>cccccccc</span>\
![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10642 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face9408 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10697 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10313 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10685 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10655 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10690 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](EngagementRecognition/face10687 "fig:"){width=".34in"}\
1 & 1 & 2 & 2 & 3 & 3 & 4 & 4

<span>cccccccc</span>\
![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face0 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face1 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face2 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face3 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face4 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face5 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face6 "fig:"){width=".34in"} & ![Examples of face images used in the experiments in Section \[sec:coverage\_examples\]. <span>**Top**</span>: student engagement dataset @whitehill2014faces, in which engagement is rated on a 1-4 scale. <span>**Bottom**</span>: images from the GENKI @GENKI dataset that were labeled with their perceived age (in years).<span data-label="fig:datasets"></span>](AgeEstimation/face7 "fig:"){width=".34in"}\
55 & 60 & 30 & 38 & 31 & 30 & 70 & 30

Detection architectures
-----------------------

We examined two modern deep learning-based visual recognition architectures – VGG-16 @simonyan2014very and ResNet-50 @he2016deep – to assess how much "coverage" of $\mathcal{T}^n$ each architecture can produce, as well as to compare the variability of the resulting measurement vectors to each other.

Training procedures
-------------------

<span>**Engagement detector**</span>: We performed $25$ training runs for each of the two network architectures (VGG-16, ResNet-50). Training data consisted of $7629$ face images from 15 subjects of HBCU @whitehill2014faces, and testing data were $500$ images from the remaining 5 subjects. (This corresponds to just one cross-validation fold from the original study @whitehill2014faces.) Optimization was performed using SGD for $10000$ iterations, and the network weights were saved every $1000$ iterations. In total, this produced $250$ detectors. The average correlation (over all $250$ detectors) between the detectors' test outputs ${\widehat{\bf \mathsf u}}$ and ground-truth ${\mathbf{u}}$ was $0.61$ (s.d. $0.081$) for VGG-16 and $0.64$ (s.d. $0.009$) for ResNet-50. Inspired by @huang2017snapshot, we also tried both cosine and triangular @smith2017cyclical learning rates. However, in pilot testing we found that these delivered worse accuracy than exponential learning rate decay and we abandoned the approach.

<span>**Age detector**</span>: We performed $25$ training runs for VGG-16 and ResNet-50 using SGD for $10000$ with snapshots every $1000$ iterations, as for engagement recognition. This produced $250$ detectors. Training data consisted of $31040$ face images of the GENKI dataset @GENKI, and testing data consisted of $500$ face images. The average correlation of the automatic measurements with ground-truth on the test set was $0.595$ (s.d. $0.036$) for VGG-16 and $0.60$ (s.d. $0.014$) for ResNet-50.

Visualizing elements of the $(n-3)$-sphere $\mathcal{T}^n$ {#sec:viz_disc}
----------------------------------------------------------

Given a set of $m$ trained detectors, we can sample vectors of age/engagement estimates ${\widehat{\bf u}}^{(1)},\ldots,{\widehat{\bf u}}^{(m)} \in \mathbb{R}^n$ whose correlation with ground-truth ${\mathbf{u}}$ is approximately $q$. Then we can visualize how these vectors "cover" the $(n-3)$-sphere $\mathcal{T}^n$ using the following procedure:

1.  Normalize ${\mathbf{u}}$, as well as each ${\widehat{\bf u}}^{(j)}$, to have $0$-mean and unit-length.

2.  Compute an orthonormal basis $\mathbf{B}$ (e.g., using a QR decomposition) so that (a) the first component of $\mathbf{B} \mathbf{x}$ is $0$ for every $\mathbf{x} \in \mathcal{H}$, and (b) $\mathbf{B} {\mathbf{u}}= (0,1,0,0,\ldots,0)$ (see Equation \[eqn:transformed\_u\]).

3.  Project each ${\widehat{\bf u}}^{(j)}$ onto the new basis $\mathbf{B}$. By construction, the first component of each projection will be $0$ and the second component will be $q=\rho({\widehat{\bf u}}^{(j)}, {\mathbf{u}})$.

4.  Define each $\mathbf{x}^{(j)}$ to be the last $n-2$ components of vector $\mathbf{B} {\widehat{\bf u}}^{(j)}$.

5.  Project the $\{ \mathbf{x}^{(j)} \}$ onto the two principal axes obtained from principal component analysis (PCA).

Since the 2-D projection of a 0-centered sphere onto any orthonormal projection is a disc, the output of the procedure above is a set of points that lie on a disc of radius $\sqrt{1-q^2}$.

Generating random vectors on $\mathcal{T}^n$ {#sec:sampling}
--------------------------------------------

In order to assess how evenly the sphere $\mathcal{T}^n$ is "covered" by the vectors obtained from the automatic detectors, we can generate random vectors of $\mathcal{T}^n$ and likewise project them onto a 2-D disc. We generate each such vector as follows:

1.  Sample each $\mathbf{z}_i$ ($i=1,\ldots,n-2$) from a standard normal distribution.

2.  For $i=1,\ldots,n-2$, set $\mathbf{\hat u}_i = \frac{\sqrt{1-q^2} \times {\mathbf z}_i}{\sqrt{ \sum_{i'=1}^{n-2} {\mathbf z}_{i'}^2 }}$.

We then project the vectors in the set $\{ \mathbf{\hat u}^{(j)} \}$ onto the two principal axes obtained from PCA. To enable a fair comparison between the variances of the randomly generated elements of $\mathcal{T}^n$ and those obtained from the trained detectors, we run PCA *separately* for each set.

Results {#sec:coverage_examples}
-------

We projected all vectors $\{ {\widehat{\bf u}}^{(j)} \}$ whose correlation with ${\mathbf{u}}$ was between $0.575$ and $0.625$ for Engagement recognition and $0.625$ and $0.65$ and Age estimation; this amounted to $50\%$ of the engagement detectors and $45\%$ of the age detectors. The projections are shown for each task in Figure \[fig:coverage\]. First, we observe that there is some "spread" – the measurement vectors occupy different clusters on the sphere. This indicates that the same training data can still yield automatic measurements ${\widehat{\bf u}}$ on testing data whose correlations with each other is far less than 1. In fact, for engagement recognition, the minimum correlation, over all pairs $({\widehat{\bf u}}^{(j)}, {\widehat{\bf u}}^{(j')})$, was $0.64$.

For engagement recognition, the VGG-16 based measurements and the ResNet-50 based measurements each resided within their own clusters on the sphere, and these clusters did not overlap. This suggests that, even though both architectures yielded similar overall accuracies, they are making different kinds of estimation errors on the test set. Interestingly for both age estimation and engagement recognition we can see that VGG-16 has a bigger "spread" compared to ResNet-50. We speculate this might be due to VGG-16 ($138$ million) having significantly more parameters compared to ResNet-50 ($25$ million), thus enabling it to learn more varied features.

Finally, a comparison of the variance between the automatic measurements ${\widehat{\bf u}}^{(1)},\ldots,{\widehat{\bf u}}^{(m)}$ and random samples from $\mathcal{T}^n$ indicates that varying the training configuration (architecture, hyperparameters) provides only limited ability to cover the sphere: the variance in the vectors, as quantified as the sum of the trace of their covariance matrix, was statistically significantly less compared to randomly sampled points on $\mathcal{T}^n$ ($p<0.01$, 1-tailed, Monte Carlo simulation).

Conclusions {#sec:conclusions}
===========

Advances in machine perception present a powerful opportunity to create new scientific instruments that can benefit basic research in sociobehavioral sciences. However, since detectors are often trained to estimate existing measures, which are already only an estimate of underlying constructs, then these instruments are essentially one step further removed from ground-truth. For this reason, it is important to interpret results obtained with them with care.

In this paper, we investigated how measurements of construct $U$ obtained with an automatic detector can impact the estimated correlation between $U$ and another construct $V$. We showed that: (1) The set of $0$-mean unit-length $n$-vectors with a fixed Pearson product-moment correlation $q$ to vector ${\mathbf{u}}$ is a $(n-3)$-sphere $\mathcal{T}^n$ embedded in $\mathbb{R}^n$. (2) If the correlation between automatic measurements ${\widehat{\bf \mathsf u}}$ and the ground-truth measurements is $q$; if the true correlation between $U$ and $V$ is $r$; and if ${\widehat{\bf \mathsf u}}$ is sampled uniformly from $\mathcal{T}^n$; then the expected sample correlation obtained with the automatic detector is $qr$. (3) The probability of a "false correlation", i.e., a sample correlation between constructs $U$ and $V$ whose sign differs from the true correlation, is monotonically decreasing in $n$ (number of participants) and also monotonically decreasing in $q$ (accuracy of the detector). These probabilities can be non-trivial for small values of $n$ that are nonetheless sometimes found in contemporary research using automatic facial expression and affect detectors. Moreover, the danger of a false correlation is not eliminated through statistical significance testing. (4) We explored empirically how efficiently multiple neural network-based detectors of age and student engagement, when trained using different architectures and hyperparameters but the same training data, can "cover" the sphere $\mathcal{T}^n$.

In practice, our results suggest that, particularly when the number of participants is small and/or the accuracy of the detector is modest, it is important to consider the possibility of a false correlation, or at least a skewed correlation (by factor $q$), when drawing scientific conclusions. <span>**Limitation and future work**</span>: In our study we assumed that ${\widehat{\bf \mathsf u}}$ is a random sample from the uniform distribution over $\mathcal{T}^n$ – this expresses the idea that *a priori* we may have no idea which *particular* element of $\mathcal{T}^n$ detector $d$ will return. In reality, however, detectors have biases – e.g., due to head pose, lighting conditions, training set composition, etc. – and these can affect which element of $\mathcal{T}^n$ is obtained.

<span>**Acknowledgements**</span>: This research was supported by a Cyberlearning grant from the National Science Foundation (grant no. \#1822768).

Appendix
========

Proof of Proposition 2
----------------------

We prove the proposition for the case that $r <0$; the case for $r > 0$ is similar.

From Section III, we have that $$\rho({\widehat{\bf \mathsf u}},{\mathbf{v}}) = qr + \mathsf{\hat u}_3 \sqrt{1-r^2}$$ Since each $\hat{\mathsf u}_i$ ($i=3,4,\ldots,n$) is a coordinate on an $(n-3)$-sphere, it can be re-parameterized @muller1959note by sampling $n-2$ standard normal random variables and normalizing, i.e.: $$\hat{\mathsf u}_i = \frac{\sqrt{1-q^2} \times {\mathsf z}_i}{\sqrt{ \sum_{j=3}^n {\mathsf z}_j^2 }}$$ where each ${\mathsf z}_i \sim \mathbb{N}(0,1)$. A false positive correlation thus occurs when $\hat{u}_3$ is at least $c = |qr|/\sqrt{1-r^2}$ more than its expected value $qr$: $$\textrm{Pr}[\hat{\mathsf u}_3 \geq c] = \textrm{Pr}\left[\frac{\sqrt{1-q^2} \times {\mathsf z}_3}{\sqrt{ \sum_{j=3}^n {\mathsf z}_j^2 }} \geq c\right]$$ Due to the inequality, we must handle the cases that ${\mathsf z}_3 \geq 0$ and ${\mathsf z}_3 < 0$ separately. Note that the latter case contributes 0 probability since $c\geq 0$ and $q>0$. Also, since ${\mathsf z}_3$ is a standard normal random variable, $\textrm{Pr}[{\mathsf z}_3\geq 0]=0.5$. $$\begin{aligned}
\lefteqn{\textrm{Pr}[\hat{u}_3 \geq c]} && \\
 &=& \textrm{Pr}\left[\frac{\sqrt{1-q^2} \times {\mathsf z}_3}{\sqrt{ \sum_{j=3}^n {\mathsf z}_j^2 }} \geq c\ \Big|\ {\mathsf z}_3 \geq 0\right] \textrm{Pr}[{\mathsf z}_3\geq 0] + \\
 && \textrm{Pr}\left[\frac{\sqrt{1-q^2} \times {\mathsf z}_3}{\sqrt{ \sum_{j=3}^n {\mathsf z}_j^2 }} \geq c\ \Big|\ {\mathsf z}_3 < 0\right] \textrm{Pr}[{\mathsf z}_3< 0] + \\
 &=& \frac{1}{2} \textrm{Pr}\left[\frac{\sqrt{1-q^2} \times {\mathsf z}_3}{\sqrt{ \sum_{j=3}^n {\mathsf z}_j^2 }} \geq c\ \Big|\ {\mathsf z}_3 \geq 0\right] + 0 \\
 &=& \frac{1}{2} \textrm{Pr}\left[(1-q^2){\mathsf z}_3^2 \geq c^2 \sum_{j=3}^n {\mathsf z}_j^2\right] \\
 &=& \frac{1}{2} \textrm{Pr}\left[(1-q^2-c^2){\mathsf z}_3^2 \geq c^2 \sum_{j=4}^n {\mathsf z}_j^2\right] \\
 &=& \frac{1}{2} \textrm{Pr}\left[{\mathsf z}_3^2 \geq \frac{c^2}{(1-q^2-c^2)} \sum_{j=4}^n {\mathsf z}_j^2\right]\end{aligned}$$ For $n>3$, each side of the inequality is a sum of squared normally distributed random variables, i.e., a $\chi^2$-random variable (though with different degrees of freedom). We can thus rewrite this probability as $$\begin{aligned}
\textrm{Pr}[\hat{u}_3 \geq c] &=&\frac{1}{2} \textrm{Pr}\left[\chi^2_1 \geq \left(\frac{c^2}{1 - q^2 - c^2}\right) \chi^2_{(n-3)} \right] \\
                            &=& \frac{1}{2} \int_0^\infty f_1(t) F_{n-3}\left(\frac{1 - q^2 - c^2}{c^2} t\right) dt \\
                            &\doteq& h(n,q,r)\end{aligned}$$ where $\chi^2_1$ and $\chi^2_{(n-3)}$ are $\chi^2$ random variables with $1$ and $(n-3)$ degrees of freedom, respectively. The probability is equivalent to the integral because, for any value $t$ of the $\chi_1^2$ variable, we require that the $\chi_{n-3}^2$ variable be less than $t$ (after applying a scaling factor). To our knowledge, there is no closed formula for this integral, but we can compute it numerically. For $n=3$, we have $$\begin{aligned}
\textrm{Pr}[\hat{u}_3 \geq c] &=& \frac{1}{2} \textrm{Pr}\left[(1-q^2 - c^2) {\mathsf z}_3^2 \geq 0\right] \\
                           &=& \frac{1}{2} \textrm{Pr}[c^2\leq 1-q^2]\end{aligned}$$ since a $\chi^2$-random variable is non-negative, and where the probability of $c^2\leq 1-q^2$ is $1$ if the inequality is true and $0$ otherwise.

Proof of Proposition 3
----------------------

For convenience, define $\alpha = \frac{1 - q^2 - c^2}{c^2}$. $$\begin{aligned}
\lefteqn{h(n+1,q,r) - h(n,q,r)} && \\
&=&
\int_0^\infty \left[f_1(t) F_{(n+1)-3}\left(\alpha t\right) -
f_1(t) F_{n-3}\left(\alpha t\right)\right] dt \\
&=& 
\int_0^\infty f_1(t) \left[F_{n-2}\left(\alpha t\right) -
                           F_{n-3}\left(\alpha t\right)
                           \right] dt \label{eqn:monotone}\end{aligned}$$ Ghosh @ghosh1973some proved that, for any fixed $t>0$, $\textrm{Pr}[\chi_k^2 > t]$ is monotonically increasing in the degrees of freedom $k$; hence, $F_k(t)$ is monotonically decreasing in $k$. Therefore, $F_{n-2}\left(\alpha t\right) - F_{n-3}\left(\alpha t\right) < 0$ for all $t$. Since $f_k$ is a non-negative function for all $k$, then the integral in Equation \[eqn:monotone\] must be negative; hence, $h$ is monotonically decreasing in $n$ for every $c>0$ and $q\in(0,1]$.

Proof of Proposition 4
----------------------

First, we show that $\alpha$ is monotonically decreasing in $q^2$: $$\begin{aligned}
\alpha(q) &=& \frac{1 - q^2 - c^2}{c^2} \\
       &=& \frac{1 - q^2 - q^2 r^2/(1-r^2)}{q^2 r^2/(1-r^2)} \\
       &=& \frac{(1-r^2)(1-q^2) - q^2 r^2}{q^2 r^2} \\
              &=& \frac{1 - r^2 - q^2}{q^2 r^2} \\
       &=& \frac{1 - r^2}{q^2 r^2} - \frac{1}{r^2}\end{aligned}$$ The first term is monotonically decreasing in $q^2$, and the second term is constant in $q^2$.

Next, let $\epsilon$ be a positive real number such that $q+\epsilon \leq 1$: $$\begin{aligned}
\lefteqn{h(n,q+\epsilon,r) - h(n,q,r)} && \\
&=&
\int_0^\infty f_1(t) F_{n-3}\left(\alpha(q+\epsilon) t\right) dt - \\
&& \int_0^\infty f_1(t) F_{n-3}\left(\alpha(q) t\right) dt \\
&=& 
\int_0^\infty f_1(t) \left[F_{n-3}\left(\alpha(q+\epsilon) t\right) -
                           F_{n-3}\left(\alpha(q) t\right)
                           \right] dt\end{aligned}$$ Since $F_{n-3}$ is monotonically *increasing*, then the expression in brackets is negative. Since $f_1$ is non-negative, then the entire integral must be less than 0.

Sampling distribution $\textrm{Pr}(\hat{\mathsf q}\ |\ q, n)$
=============================================================

The sampling distribution can be computed exactly @fisher1915frequency, but this is computationally feasible only for small $n$. Hence, we use the approximation from Soper @soper1913probable: Let $q$ denote the population Pearson correlation coefficient, and let $\hat{\mathsf q}$ denote the sample correlation from $n$ data. Then

$$\begin{aligned}
\textrm{Pr}(\hat{\mathsf q}\ |\ q,n) &\propto&
(1-\hat{\mathsf q})^{m_1}  (1+\hat{\mathsf q})^{m_2}\\
m_1&=& \frac{1}{2} (\lambda-1)(1-\mu_q)-1\\
m_2&=& \frac{1}{2} (\lambda-1)(1+\mu_q)-1\\
\lambda&=& (1-\mu_q^2)/\sigma_q^2\\
\sigma_q&=& \frac{(1-q^2)}{\sqrt{n}}  \left(1+\frac{(1+5.5q^2)}{2n}\right)\\
\mu_q&=& \sqrt{q^2 - \frac{c}{n}-\frac{c(1+5q^2)}{2n^2}}\\
c&=& q^2 (1-q^2)\end{aligned}$$

{'source': 'arXiv_out/1812'}