This test is used in a [[Paired Test]], when you cannot use a [[T-Test]] because the data $X_i$ does not come from a [[Gaussian Distribution]]. The Wilcoxon-Signed-Rank Test only assumes that $X_1,\dots, X_n$ is symmetric around a mean $\mu$.
## Test Statistic
First we rank the absolute differences to the mean $\mu$, assigning rank $1$ for the lowest absolute difference and rank $n$ to the largest absolute difference. Then each rank is multiplied by $1$ or $(-1)$ dependent on the sign of difference.
$
\begin{align}
R_i &=\text{rank}\big(\lvert X_i-\mu \rvert \big) \\
W &= \sum_{i=1}^n\text{sign}(X_i-\mu)*R_i
\end{align}
$
When $n \to \infty$ this test statistic converges to a Gaussian, which allows for asymptotic statements. The null-hypothesis usually states that the median difference between the two sets of measurements is zero.