## 3 Methodology
### Particle Filter Approach and Implementation
This is achieved by computing the likelihood of the measurement \(y\) (SSM observation) giving the particle \(x\) using the probability density function (PDF) described by:  
\[p\left(y_{i}\middle|x_{i}^{k}\right)=\frac{1}{\sqrt{2\pi\text{ det}(C_{V})}}e^{-0.5*(y_{i}-x_{i}^{k})^{T}*C_{V}^{-1}(y_{i}-x_{i}^{k})} \tag{4}\]  
This is a simplified form (adaptation to our case where only one observation is assimilated per window) of the probability density function obtained from [PERSON] theorem in [65]. The likelihood is driven by the difference between the measurement and a given particle \(\left(y-x^{k}\right)\). The closer the particle is to the measurement, the higher the likelihood. Another important parameter is the error covariance of observations \(C_{V}\) that controls the weight distribution. A small \(C_{V}\) will provide very high weight to the particles closest to the measurement [31]. As SSM only is assimilated here, \(C_{V}\) is a scalar. Its value is set to the error on the SSM products assimilated in this work. The likelihood is translated into weight by normalizing with the sum of all the particles' likelihoods, so that the sum of the weights equals to 1:  
\[w_{i}^{k}=\frac{p\left(y_{i}\middle|x_{i}^{k}\right)}{\sum_{k=1}^{N}p\left(y_{ i}\middle|x_{i}^{k}\right)} \tag{5}\]  
\(w_{i}^{k}\), the weight of the particle \(k\) at time \(i\) takes a value between 0 and 1 and \(N\) is the number of particles. \(N\) has been defined to 1000 in this study in order to achieve a good performance [61; 66; 67]. After several assimilation windows, it is likely that a single particle will have a weight close to 1 while all the other particles will end up with weights close to 0. For example, it is shown by [68] that after a few iterations, all the weight is concentrated on one particle, even using a relatively simple system. This is known as particle degeneracy [63; 69; 56]. To overcome this problem, a resampling of the particles must be carried out to eliminate particles with low weight and duplicate those with high weights. Several particle resampling methods have been proposed [70; 71; 72; 73; 74; 75; 76] showing their effectiveness in improving the performance of the particle filter algorithm. In this study, the \"systematic\" method (also called \"stratified\" on some references) introduced by [77] is used. The authors argued that greater accuracy can be achieved using this method according to sampling theory. It is also preferred because of its simple implementation [61; 70; 75]. Degeneracy of particles is measured using either the effective particle number [78] or the entropy [79]. Here, the resampling of the particles is performed based on the effective particle number:  
\[N_{\mathit{eff}}=\frac{1}{\sum_{k=1}^{N}\left(w_{i}^{k}\right)^{2}} \tag{6}\]The ratio \(N_{eff}/N\) measures the importance of the particle's contribution to the state estimation. When the ratio is \(\sim\)1, this means that all the particles contribute equally (\(w_{i}^{k}\sim\frac{1}{N}\), \(\forall k\)). In contrast, \(N_{eff}/N\sim\)0 means that one particle has a very high weight while the others are close to nil. In this study, when the ratio \(N_{eff}/N\) is less than a fixed threshold of 0.5 [80], the resampling is performed. Finally, the particles and their weights can be used in different ways to extract the best state estimation (SSM in our case). Here the particle with the highest weight is considered as the best state estimate and translated afterwards into the irrigation amounts and timing assuming that the best estimated SSM state corresponds to the best irrigation amounts and timing. The algorithm is applied over all the growing season from sowing to harvest.