2 minute read

A computer monitor.
Source: Luis Gomez from Pexels

I only started to properly learn to code last year. As part of my MSc at QMUL, I undertook the Topics in Scientific Computing moduel, taught and organised by Dr Clough. Due to the patience and encouragement of the tutor, I quickly learned the basics of Python and understood how numerical methods could be implemented to solve complex problems.

I had assumed that computing was only necessary for complex problems with non-analytical solutions.

This was a very dumb take.

I am now realising this as part of my sixth week of study into my PhD; reading alone is not enough to retain information long-term. Practice by doing is essential. But, what does that look like for research-level mathematics? We may not be able to rely on carefully crafted and thought-out textbook answers. However, we can begin to code (in your language of preference) and replicate the results you find.

My supervisor had asked me to replicate the results of his paper on the Linear Network Effects model - a cool novel way of thinking about experimental designs on networks (see Definition 1 below).

Definition 1: Linear Network Effects Model

Let an experiment comprise of \(T\) treatments and \(N\) units. Then, the response, \(Y_{i}\), of unit \(i\) undergoing treatment $t(i)$, can be modelled by: \begin{equation} Y_{i} = \mu + \tau_{t(i)} + \sum_{k=1}^N A_{ik}\gamma_{t(k)} + \epsilon_{i} \end{equation} where: - \(\mu = \sum_{a}Y_{a}/{N}\) is the grand average of all the responses - \(\tau_{t(i)}\) is the deviation of the response $Y_i$ from $\mu$ as an inherent result of the treatment. This is known as the treatment effect of treatment $t(i)$ on unit $i$. - \(A_{ik}\) is the \(ik\)-th element of the adjacency matrix (see Definition \ref{adj-matrix}). - \(\gamma_{t(k)}\) is the influence from neighbouring nodes as a result of treatment assignment, known as the network effect of treatment $t(k)$ on unit $k$. - \(\epsilon_{i}\sim \mathcal{N}(0, \sigma^2)\) is a random variable to account for the experimental error.

This allowed me to understand fully what is happening. Specifically, how treatments and network effects are incorporated into the model. How random graphs can be used in the model and so much more. It gave me context around the model too; rather than just be able to quote it, I was able to comprehend what is actually happening. Prior to this, just by reading alone, I could quote formulas and tell you what a paper I have just read has said. However, most of my understanding of a paper’s results is surface-level.

Even as a teacher, I always struggled with the definition of what ‘deep’ understanding is. However, if ‘deep understanding’ is to mean a greater comprehension of the context of the concept and how it is implemented, then I would certainly say my understanding of the model, after coding the model, is deeper.

To that end, understanding coding is an important facet of understanding mathematics. Many of us will never be Neo-level at coding. However, I would strongly encourage early-career researchers to grasp the basics, as it will allow them to retain more information by doing.