Adaptive sampling method to monitor low-risk pathways with limited surveillance resources

The rise of globalisation has led to a sharp increase in international trade, with high volumes of containers, goods and items moving across the world. Unfortunately, these trade pathways also facilitate the movement of unwanted pests, weeds, diseases, and pathogens. Each item could contain biosecurity risk material, but it is impractical to inspect every item. Instead, inspection efforts typically focus on high risk items. However, low risk does not imply no risk. It is crucial to monitor the low risk pathways to ensure that they are and remain low risk. To do so, many approaches would seek to estimate the risk to some precision, but the lower the risk, the more samples needed to estimate the risk. On a low-risk pathway that can be afforded more limited inspection resources, it makes more sense to assign fewer samples to the lower risk activities. We approach the problem by introducing two thresholds. Our method focuses on letting us know whether the risk is below certain thresholds, rather than estimating the risk precisely. This method also allows us to detect a significant change in risk. Our approach typically requires less sampling than previous methods, while still providing evidence to regulators to help them efficiently and effectively allocate inspection effort.


INTRODUCTION
International trade increases the likelihood of new pest incursions, and these risks are increasing over time.According to the World Trade Organisation, world trade volume has increased nearly 45 times since 1950 (World Trade Organization, 2023).In 2021 alone, international merchandise exports were worth US$22.3 trillion, and over 11.0 billion tons of goods were loaded for international maritime trade (United Nations Conference on Trade and Developement, 2022).These high-volume trade pathways facilitate the movement of unwanted, invasive and non-indigenous pests, weeds, diseases, and pathogens.These pests can disperse into new environments at an unprecedented rate along these trade pathways, be it accidental or deliberate, and cause significant ecological, economic, and human health consequences.
The economic impacts from biological invasions are significant.The costs of multiple biological invasions, their impact, and their management, has been estimated to cost the United States over USD$21 billion annually over 2010-2020(Fantle-Lepczyk et al., 2022), and estimated to cost a minimum of USD$1.288 trillion worldwide over 1970-2017 (Diagne et al., 2021).One example of a major pest is the brown marmorated stink bug (BMSB), which has spread into North America and Europe and caused significant economic impacts (T.C. Leskey & Nielsen, 2018).BMSB has caused estimated crop losses of 20% to over 90% (T.Leskey & Hamilton, 2010) and millions of dollars of damage to mid-Atlantic apple crops in 2010 (Herrick, 2011).Meanwhile, emerald ash borers and other invasive insects are estimated to kill 1.4 million street trees in the United States between 2020-2050, costing over US$900 million for replacement (Hudgins, Koch, Ambrose, & Leung, 2022).
Inspection and intervention at the border are one of the key strategies to prevent biological incursions and spread.For example, New Zealand regularly intercepts live and dead BMSB at the border each year (Burne, 2019), including 61 live BMSB during 2021/22, and as of 2022, there is no evidence of any established BMSB population (Ministry for Primary Industries, 2022).Aside from stopping the incursion of biological pests and reducing invasion risk, inspections and surveillance can also give us information about pest arrival rates and composition (Turner et al., 2021), thus allowing further targeting of inspection and other biosecurity strategies.Inspections can also encourage importer compliance (Hester et al., 2020) by streamlining the import processes of compliant importers.
However, surveillance systems require resources and prioritisation.Given the sheer volume of international trade and movement, it is infeasible to inspect every single parcel, container, or item that passes through a country border, due to both cost and delays in trade movement.Effective systems must prioritise within their budget constraints, while ideally achieving its intended purpose within some level of tolerance.Often, the priority is to target high-risk pathways and reduce invasion risk to a pre-defined acceptable level (World Trade Organization, 1994).
An important aspect of designing an effective surveillance system is knowing the underlying rates at which incoming items are contaminated or non-compliant, and where the pests with high possible impact and damage are likely to come from, and then applying differentiated surveillance and controls based on stratified risk-i.e., high risk and low risk (Powell, 2015;Turner et al., 2020;Saccaggi, Wilson, Robinson, & Terblanche, 2022).Inspection data and other known information about pest distribution and pest impact are crucial to determining which pathways are high-risk and should be targeted for border inspections.Based on 1.9 million border interception records, Fenn-Moltu et al. ( 2022) evaluated that high-risk pathways for insect pests include plants, wood, textiles, animal products, food stuffs, live plants and cut flowers, fruit and nuts, and items with wood packaging.Kriticos et al. (2017) examined the possible future distribution of BMSB using bioclimatic niche model, thus determining which locations are at risk of BMSB establishment.Meanwhile, Saccaggi et al. (2022) used machinelearning on inspection data to determine the strongest predictors of pest interception and found that factors such as country, crop, and year of import can help predict future interceptions.
Given that risk is the combination of likelihood and consequence, this often involves focusing inspection resources on pathways that have either high infestation, or have damaging pests, or both.For example, Australia has a "Country Action List (CAL)", defining high-risk pathways for sea containers and breakbulk cargo based on documented high contamination or have high risk pests.These have mandatory inspection (Department of Agriculture, Fisheries and Forestry, 2023).Turner et al. (2020) developed a arrival-interceptionestablishment model combined with insect interception data to predict the number of invasive pests that were not detected by biosecurity and could establish.
While there has been a lot of work on profiling high-risk pests and items, and while border inspections target these highrisk pathways, there is less work looking at the rest of the low-risk pathways.Low-risk pathways still need to monitored: compliance surveys and/or general random surveys should be conducted on low-risk pathways so that we can ensure the risk remains low, and to know whether it is no longer low risk.Monitoring these low-risk pathways should be an important part of overall trade pathway management and analysis.
However, there is an additional challenge: the majority (or all) of the resources were concentrated on the high-risk pathways for a reason, and low-risk pathways can be very large.Our problem is thus: given limited resources for surveillance, what is the best way to sample such that we have sufficient information regarding the contamination prevalence, on a low-risk pathway?
There are existing methods for setting sample sizes, but these were not designed for low-risk pathways and/or do not allow for time-varying sampling.Sampling methods that suggest high volumes of inspection (e.g., 20% of all items) are not feasible, and perhaps ineffective if the goal is to monitor the low-risk pathway, rather than to prevent all possible (ideally low-risk) incursions.Robinson, Burgman, and Cannon (2011) have a sample-size-selection method that uses the null hypothesis that the contamination rate is above a specified level based on a risk cutoff, and returns the volume that should be sampled by using a power analysis.However, the method can lead to excessively high sample sizes as the estimated rate approaches the cutoff.
The simplest method is to choose a fixed number, which we could chose to be small.For example, Australian phytosanitary inspection can involve sampling 600 units in a consignment (Australian Department of Agriculture, Water and the Environment, 2021), as this will result in a 95% chance of detecting contamination if the infestation rate is 0.5% (International Standards for Phytosanitary Measures, 2008;Whyte, 2009).In the low-risk setting, we could apply a 600-sampling volume across the entire low-risk pathway.However, this method does not vary through time and thus cannot adjust to changing risk situations.
In this paper, we formulate a new sampling method that identifies the sampling effort required to be confident that the leakage rate is below a set threshold.This method uses past data of sampling effort and interceptions to recommend minimum future sample sizes.We start by describing our new methodology, and we compare the performance of our method to Robinson et al. (2011)'s risk-sensitive method and the fixed 600-volume method via simulation.We find that our model is able to detect upward changes in contamination rates in a timely manner, with reduced sampling compared to Robinson et al. (2011) and will adjust to be less effort than 600 if there is sufficient evidence that the pathway is very low risk.In general, our method can be used in any situation where assurance is sought about whether some pathway or stream of entities has rates of non-compliance between some low but nonzero risk threshold-but where knowing the exact non-compliance rate is not important-and where the non-compliance rate of the items are expected to be related by some underlying factor(s).
In Section 2, we present our new survey design and inspection method.In Section 3, we compare the performance of the three different sampling methods on simulated scenarios.We discuss the results and our method in Section 4 and conclude in Section 5.

METHOD
We are addressing the following ongoing surveillance problem: how many items should we inspect on a low risk-pathway, each reporting period, to be confident that the low-risk items are indeed low risk?The solution should allow us to sample less when we believe the risk is very low, and the solution should be able to detect when our risk is rising.
Our method uses two thresholds-one to detect changes in risk, and one to signal when the pathway is no longer low risk.

Conceptual model of low-risk pathways
We consider a pathway to be a series of incoming items that can be inspected, such as containers or goods.The pathway may involve only a certain type of container or cargo, or involve only certain transport routes, or importers, or shippers, or source countries etc., or some combination of these selection criteria.An item can be non-compliant if it contains something of biosecurity concern (e.g.invasive and non-indigenous pests, weeds, diseases, and pathogens).There can also be other forms of non-compliance, such as documentation-related noncompliance.In general, we say that items with non-desirable elements to be "contaminated" or "non-compliant".Contamination that is not detected and released from all interventions forms the "leakage" from the pathway.The true unknown leakage rate is r true , which is the proportion of contaminated items.
Our focus is on low-risk pathways.This assumes that pathway managers have conducted risk-profiling to stratify the risk in different pathways.We also assume that we have some prior inspection data on the pathway (such as from a pilot study, past inspection regimes, or other historical data), such that the pathway is deemed low-risk according to that prior data.As part of this low-risk designation, we assume that pathway managers and policy makers have defined a low-risk threshold, T risk , and that if contamination rises about this threshold, then the pathway would no longer be considered low-risk.We also assume that the low-risk pathway comprises a very large number of units.

Sampling and risk-evaluation process
The overall process of our sampling method is shown in Figure 1.An R implementation of the method is available.† We are interested in the leakage rate, r true .There will always be uncertainty about the value, as we cannot sample the full pathway in our setting.However, we can use any conducted inspections to quantify our belief of the rate.
Note that our method will not be focused on estimating the true rate of contamination.Instead, we are focused on determining, with sufficient confidence, whether we are below the low-risk threshold, T risk .
In this section, we go through the different steps in our method.

2.2.1
Step 0: The thresholds Our method relies on two thresholds, the low-risk threshold T risk , and a lower change-detection threshold, T change .Non-compliance rates above the upper threshold, T risk , are considered unacceptable.Meanwhile, the lower threshold T change is tunable, and we use this to detect changes in the non-compliance rate.

2.2.2
Step 1: Estimating the leakage rate given past data and the colour status system The initialisation of the problem follows Robinson et al. (2011).We need to be able to mathematically encode our belief about the leakage rate, r from the data.To do this, we will encode our belief of the leakage rate r using a Beta probability distribution with shape parameters α, β.
In the absence of data, we begin with the uninformative Jeffrey's prior (Tony Cai, 2005), with α = β = 0.5: r ∼ Beta(0.5, 0.5). (2) We assume that we have some past data about the pathway: y 0 detected contamination, among N 0 samples.This information is important, to fulfil our starting assumption that the pathway is historically low-risk.We assume that the pathway is very large, and that the number of leakages obeys a binomial distribution, Because we have chosen to use a Beta distribution to encode our belief about the underlying rate, r, we can easily update The overall sampling and risk evaluation process.Using prior data, we can determine the minimum recommended sampling volume for the next reporting period.After sampling, we update our belief about the leakage risk and evaluate the pathway.
the initial uninformative prior Beta(0.5, 0.5) with the past data results as follows (Gelman et al., 2021, §2.1, §2.8): where : α 0 = y 0 + 0.5 (4) The beta distribution now encodes our belief about the true leakage rate, using the data previously gathered.Intuitively, the more parcels are inspected, the more certain we are about the closeness of the sampled leakage rate versus the underlying true leakage rate.Up to this point, we have followed the same steps as Robinson et al. (2011) to assign confidence about underlying leakage rates given the available data.In the following steps, we depart from Robinson et al. (2011)'s method with a different sample-size calculation suited for low-risk low-resourced pathways.Our method relies on a colour status system.
Based on the thresholds and the shape parameters α, β, we will categorise our belief about the leakage rate using a 'trafficlight' colour system, as depicted in Figure 2: That is, • The status is "green" if the upper one-sided 95% credible interval of our belief is below T change , i.e. ; • The status is "orange" if the upper one-sided 95% credible interval of our belief is below below T risk ; • And the status is "red" otherwise.
Note that both statuses orange and red are warnings that the risk may be rising, and are causes for concern.

2.2.3
Step 2: Calculating the recommended minimum sampling For our method to work, the pathway must begin in low risk (green) status.This means that, based on the prior data (N 0 , y 0 ), the 95% credible interval of our belief is below T risk , i.e.P r < T risk N 0 , y 0 ≥ 0.95. (7) If the pathway does not satisfy this condition, then it is not low risk, and the high-risk subpathways' data should be removed before proceeding.Now, with the low-risk pathway, we proceed by tuning the change-detection threshold T change , such that i.e., T change marks the one-sided 95% credible interval of the prior beta distribution based on past data (N 0 , y 0 ).

<5% >5% <5%
F I G U R E 2 Our state of belief regarding the leakage rate.Green -the 95% credible interval is below the threshold T change ; orange -the 95% credible interval is below the threshold T risk ; red -otherwise.
Note that we could also define T change at a different credible interval, e.g. the 94% or 96% one-side credible interval, provided that the requirement in Eq. ( 7) is still satisfied.Now, if we take N 1 samples and detect y 1 contaminated samples, then our leakage rate posterior would be updated as follows (Gelman et al., 2021, §2.4): where : α 1 = y 1 + α 0 = y 1 + y 0 + 0.5 ( 9) Our aim is to take N 1 samples in the next reporting period, such that our updated belief has the correct resulting colour according to the underlying situation, with some confidence.The colour assignment we want is given in Table 1.
T A B L E 1 Table summarising correct posterior colour assignment c r α 1 , β 1 , T change (N 0 , y 0 ) , T risk given the true rate r true after updating with new data, i.e. with posterior r N 0 , y 0 , N 1 , y 1 as in Eq. ( 9).(Note that T change is defined relative to the prior data.)

True rate
Wanted posterior colour assignment rtrue ≤ T change Green or orange T change < rtrue < T risk Green or orange or red rtrue ≥ T risk Orange or red In particular, given that we are focused on being able to detect if the pathway is increasing in risk, we calculate the minimum number of samples such that, should the true rate of non-compliance change to be above T risk , we will obtain an orange or red posterior belief with probability 95%, averaged over leakage rates above T risk (weighted by the probability from the prior distribution).
In Figure 3, we have calculated the recommended sampling for different parameters.
Mathematically, consider a fixed N 1 , and a hypothetical noncompliance rate r ′ > T risk .We can calculate the probability that the policy of taking N 1 samples is successful: where f r N 0 , y 0 , N 1 , y 1 flags whether the leakage rate posterior given new data (N 1 , y 1 ) is orange or red, or not: As above (Eq.3), the detected leakage follows a binomial distribution: Our model recommends sampling N 1 times, where N 1 solves: and where P r ′ r ′ > T risk , N 0 , y 0 is the conditional truncated Beta distribution: The calculate recommended minimum sampling volume given different choices choice of T risk and different past detected leakages (y 0 ).Here, we assume there were N 0 = 10, 000 prior samples.(a) We choose T change at the upper limit of the onesided 95% credible interval of leakage rate belief given prior data (see Eq. ( 8)) (b) The range is derived from different definitions of T change (range between 94% and 96% of the one-sided credible interval, where the 96% interval requests more sampling).
This method aims to choose the smallest N 1 so that, if r > T risk , then taking N 1 samples will result in an orange or red posterior with 95% probability.Our implementation in R uses a log transformation before calculating certain parts (Appendix A) to improve numerical precision.We use the normal approximation throughout because it shortens calculation run time and also gives smooth results (see Appendix B).Note that the normal approximation gives conservative results, meaning that the sample sizes are sufficient, but may be slightly higher than necessary.
Our recommended sampling is an weighted average.The sampling volume to detect a certain fixed rate above T risk with 95% probability would deviate from the calculated 'minimum sampling'.For rates very close and just above T risk , the sampling required will increase compared to the weighted average.Meanwhile, for rates far above T risk , the sampling required will decrease.
Note that the changing parcel volumes do not impact the risk estimation.The method require certain minimum numbers of samples for statistical significance to characterise the leakage rate distribution in the pathways, determined by the sample size calculation.This leakage rate is insensitive to changing parcel volumes -i.e.we assume that the percentage is the same even as parcel volumes fluctuate.

2.2.4
Step 3: Conduct sampling over the reporting period Given the assumptions of our model, the sampling should be random.After sampling N 1 items, we find some y 1 contaminated items.

2.2.5
Step 4: Update our belief regarding the leakage rate As we acquire more data, we need to adjust our corresponding belief by updating the beta distribution.After sampling N 1 items and finding y 1 contaminated items, the updated belief distribution is given by the beta distribution r N 0 , y 0 , N 1 , y 1 ∼ Beta(α 1 , β 1 ) as given in Eq. ( 9), i.e. with updated posterior parameters (Gelman et al., 2021, §2.4): 2.2.6 Step 5: Evaluate the current status of the pathway Given the updated belief distribution Beta(α 1 , β 1 ), we can now assign an updated status, based on the traffic light system in Figure 2 and Eq. ( 6).That is: • The updated status is green if P r < T change (N 0 , y 0 ) N 0 , y 0 , N 1 , y 1 ≥ 0.95.
• The updated status is orange if P r < T risk N 0 , y 0 , N 1 , y 1 ≥ 0.95.
• The updated status is red otherwise.
(Note that T change is defined relative to the prior data.) If the updated status is red, then the pathway is no longer confidently low risk and should be dealt with in some manner.This could mean separating out the high-risk subpathway or applying targeted investigation.

2.2.7
Step 6: Repeat To continue the process, we append the newly collected data to our prior data, and remove appropriately old data.If the pathway now appears to have a red status, our method will not work, and the high-risk subpathway needs to be removed before continuing back to step 1.

SIMULATED SCENARIOS
To validate our sampling procedure, we ran simulations of the possible outcomes.We considered a scenario where the leakage rate remains acceptable ("routine"), a scenario where the leakage rate rises above the risk threshold T risk ("risky"), and a scenario where the leakage rate is very low below the risk threshold ("very low risk").We compared our method with two other methods, that of Robinson et al. (2011), and fixed sampling at 600 inspections (International Standards for Phytosanitary Measures, 2008;Whyte, 2009).

Simulation process
We simulate the pathway by using fixed true rates r true for the approaching contamination.For a given number of inspections N 1 (chosen by the methods), we run N 1 random Bernoulli trials with rate r true , leading to a list of N 1 inspection results, with some y 1 detected contamination.The process is repeated.Some model-specific parameters are given in Table 2.Note that we call a single reporting period a "quarter" (i.e., three months), but this is simply for illustration.

Thresholds
As the 600-sample method is based on being able to detect contamination rates above 0.5% with 95% probability (International Standards for Phytosanitary Measures, 2008;Whyte, 2009), we take 0.5% as the low-risk threshold T risk , which is also known as the risk-cutoff in Robinson et al. (2011).Meanwhile, we take T change to be the 95% one-sided credible interval (c.f.Eq. ( 8)).

Prior data
Our method and Robinson et al. (2011)'s method both require some prior data.We assume that during the last two reporting periods, there were 5000 samples each, with 3 detected leakages each, for a total of N 0 = 10000 samples and y 0 = 6 detected non-compliance.These two methods also require prior data for each subsequent iteration.We chose to keep the most recent data from the last two reporting periods, while discarding older samples.

Pathway size
As part of Robinson et al. (2011)'s method, there is regime where 100% of samples are inspected, which would necessitate us having some full pathway size.However, for simulations, we end the simulations before this happens, so this is not necessary.

Routine scenario
First, consider the scenario where the contamination rate r true = 0.12% is fixed below T risk = 0.5% for the duration of the study: the results are shown in Figure 4. Notably, Robinson et al. (2011)'s method requires the most sampling, our method the second most, while the 600-sampling method results in the least sampling.
If we focus on our method (Fig. 4(a)), we see that the number of samples requested during each quarter (reporting period) can vary widely.The sampling process is stochastic, so occasionally more leakages will be detected, leading to an orange belief (even though the true rate is fixed in these simulations).As a result, more samples are recommended for the subsequent quarters (e.g.quarters 3 and 4).The resulting green statuses allows the recommended sampling to reduce again.
It can be seen that the benefit of more sampling, as in Robinson et al. (2011)'s method, is that the proportion of detected leakages during each quarter is small and more stable (Fig. 4(b)).In contrast, with only a 600 sample volume, finding a few extra leakages causes a big spike in apparent leakage rate (quarter 4 in Fig. 4(c)), which could lead one to erroneously T A B L E 2 Model-specific parameters used as part of the simulation process.*Note: While Robinson et al. (2011)'s method technically requires a pathway size for calculations, the sample size is independent of the pathway size for sufficiently large pathways and if we are not in the 100%-inspection stage.**The sampling size determination of International Standards for Phytosanitary Measures (2008); Whyte (2009) depends on detection level, confidence level, and efficacy.Given those parameters (0.5%, 95% and 100% respectively), the sampling volume is fixed (technically to 598) and does not vary in relation to past sample results.believe that the leakage rate has increased about the low-risk threshold T risk .

Risky scenario
In an alternative scenario, suppose if the underlying leakage rate increases from quarter 5 onwards, and remains elevated at 2%.The example of the result surveys is shown in Figure 5.We see that in all methods detect a sharp rise in contaminated items.

Very low risk scenario
See Figure 6, where we consider if the risk is very quite low.
In this scenario, our model recommends sampling volumes close to 600, roughly aligning with the 600-sampling method.
(Alternatively, this can allow us to interpret a 600-sampling volume as being suitable for a situation when the expected risk in the pathway is many orders of magnitude smaller than the unacceptable risk threshold.)Meanwhile, (Robinson et al., 2011)'s method recommends almost double the number of samples.

Probability of the recommended minimum sampling value to detect different rises in contamination rate
The scenario examples in Figures 4, 5, and 6 were just thatexamples.Due to the randomness inherent in the sampling, the actual results would differ across each iteration.
So here, we calculate the proportion of colour statuses that result from inspection, given different contamination rates, over 100 iterations.We start with the prior N 0 = 10000, y 0 = 6, with T risk = 0.5% and T change set at the 95% one-sided credible interval.If so, the recommended minimum sampling from our model for the next time period is N 1 = 756.We consider true rates from 0.0% to 5%.
In Figure 7, we see that the status is more frequently green at very low risk value, before becoming primarily orange by the time the low-risk threshold is passed.Frequent red status only starts occurring after the leakage rate rises above 3%.

Summary of findings
In this paper, we introduced a methodology to calculate minimal sample sizes required to be confident that a pathway is low risk, i.e. that the rate of non-compliance is below the risk threshold.
Using our methodology, the minimum number of samples for each sampling period depends on the past rate of noncompliance and on the risk threshold.In general, higher risk thresholds and lower past rates of non-compliance each lead to lower sampling in the future.We provide some simulations to demonstrate how survey effort could be used and how our method behaves when the rate of non-compliance in a pathway changes.
The advantage of our new method is that we can reduce sampling effort compared to the method by Robinson et al. (2011), and is adaptive to changes in risk unlike the fixed sampling number, while maintaining confidence in our risk.

Comparison with Robinson et al.'s method
Our method has many similarities with that of Robinson et al. (2011).We both use a beta distribution to estimate leakage rates, and the update method is the same (following the work of Tony Cai (2005)).However, the approach previously taken to calculate recommended future sampling is different.Statistically speaking, their analysis is premised on the hypothesis that the non-compliance rate is above the given risk threshold.Then, the number of samples is formulated to reject this assumption in the case that it is false.
In contrast, we took a different approach.Rather, the null hypothesis should be that the leakage rate remains constantthe number of samples is chosen to reject this whenever the rate goes above the specified risk level.This allows us to reduce the amount of sampling in a low risk low-search setting, while maintaining statistical confidence about the underlying leakage risk.
As such, our method requires less sampling effort when the risk is low when compared to the method by Robinson et al. (2011).Because we have less sampling, we also incorporated an aspect of change detection to give confidence that risks are below certain thresholds.

4.3
Comparison with fixed 600 samples F I G U R E 7 Posterior colour status after sampling the recommended minimum sample size, given different contamination rates (0.0% to 5%), in one reporting period.The black vertical line marks the low-risk threshold T risk at 0.5%.
sizes, confidence levels, tolerance levels etc.The 600 sample size is such that there is a 95% probability of detecting contamination if the infestation rate is 0.5% or above.Technically, this is designed for per-consignment inspection; here, we applied it to the entire low-risk pathway, using the same premise.Notably, this method does not use any past data.
When the leakage rate is very low, our method would suggest sample sizes close to 600.However, in most other cases, our method suggested larger sample sizes.The disadvantage of having a sample size is the lowered statistical power.

Model assumptions and limitations
Our method makes some assumptions.Notably: the sampling should be chosen randomly.We assume that the contamination/non-compliance is also distributed randomly across the pathway.We also assume that inspection sensitivity is 100%.We also assume that the low-risk pathway is large, so that we use the binomial distribution to represent the leakages, rather than a hyper-geometric distribution.We also assume that we can vary sampling volumes across different reporting periods.We do not stratify the low-risk pathway (e.g., by importer (Powell, 2015)).

Choosing model parameters
Our method requires several parameters that must be chosen, which are described in this section.

Choosing the thresholds
Firstly, the low-risk threshold T risk is not defined by our method.Instead, it should be chosen by regulators and managers, based on what they consider to be no longer acceptably low-risk.
In practice, we can vary the definition of T change , such that it is either more or less sensitive to changes in the rate.This in turn affects the amount of sampling the method recommends: if T change is set to the one-sided 96% credible interval (instead of 95%), then more sampling is recommended.This is illustrated in the right plot of Figure 3.

Choosing prior data sizes
The prior sample size is different from the future sample size.At the start of each time period, we must choose a certain amount of prior samples to keep.For example, we could choose a fixed number of prior samples (e.g. the most recent 5000 samples); alternatively we could choose the prior samples within a certain time period (say, the last 6 months).
There is a minimum condition: the prior data kept must be such that it is classed as low-risk, i.e. the 95% credible interval of our leakage rate distribution is below T risk .
Beyond this minimum necessity, the precise choice of prior data size depends on a number of factors.The most important factor to consider is how confident we are about the change of the rate in the pathways.If we have reason to believe that the leakage rates are stable across time, then more prior samples, or prior data going further back in time, can be included to reflect this.
Aside from this, another factor to consider is how past prior sample size affects the future sample size.For example, in Figure 8, we see that the smallest prior sample sizes will lead to the largest future sample sizes (largest recommended minimum next sample size).
Initially increasing the number of prior samples leads to a reduction in future sample sizes.At a certain point, this trend reverses and increasing prior sample sizes subsequently means larger future sample sizes are needed.More generally, Figure 8 shows that it is typically not ideal to have the absolute minimum number of prior samples possible, whilst there is more flexibility at larger prior sample sizes as they do not change the future sample size as much.

4.5.3
If there was no prior data If there is no prior data, then we must first estimate the prior leakage rate through various methods.If this pathway is very different from other pathways for which data are available, then expert elicitation can be used to create the beta distribution encoding the experts' belief about the leakage rate.
If this pathway is similar to other pathways (for various external reasons, or from expert opinion), then we could use historical data from other pathways and proceed from there.As the reporting periods continue, the old historical data from other pathways will eventually be discarded.

4.5.4
When the posterior or prior status becomes red Our method assumes that the initial belief is low risk (green).Therefore, the method to generate the minimum recommended sample volumes for the next time period does not apply if the posterior or prior status becomes red.This is because the survey design calculates the minimum sample size to detect when the rate goes above the T risk value; if the prior or posterior status is red, then technically zero samples are needed in the next time period as red-status has already been obtained.
If the status of the posterior or prior beta distribution of the leakage rate becomes red -and thus potentially no longer low risk -and we wish to continue using the survey design method, then the subpathway where the leakages are detected should be removed from the rest of the pathway.That is, in general, the increased risk should be within a particular subpathway (e.g.items from a certain country, of certain type, etc.), rather than the full pathway.To continue the survey method, the excess leakages and samples from this subpathway should be removed from the rest of the data.The pathway with increased risk should be analysed separately as it no longer classed as low risk and outside the purview of the baseline survey.

CONCLUSION
We developed a method that uses prior data to inform future survey volumes on low-risk pathways.Our methods works by focusing on determining whether the risk is below a threshold, rather than estimating the risk precisely, which allows us to use relatively lower sampling volumes.If we start to find more contamination, then the sampling volume increases to confirm whether or not this rise in risk is true.This method could help regulators efficiently and effectively allocate inspection effort.

F
I G U R E 4 An illustrative example of routine sampling (with the underlying leakage rate fixed at 0.12%).(a) Our method; (b) Robinson et al. (2011)'s method; (c) Fixed 600 samples method.The bars' height shows the amount of sampling done in that quarter (see left axes).The black line shows the proportion of leakages per quarter (see right axes).F I G U R E 5 An illustrative example of routine sampling (underlying leakage rate is fixed at 0.12%) followed by rise in contamination (to 2%) in quarter 5. (a) Our method; (b) Robinson et al. (2011)'s method; (c) Fixed 600 samples method.The bars' height shows the amount of sampling done in that quarter (see left axis).The black line shows the proportion of leakages per quarter (see right axis).
The work by the ISPM (International Standards for PhytosanitaryMeasures, 2008;Whyte, 2009) sets out a range of possible recommended sampling volumes, given different consignment F I G U R E 6 An illustrative example of routine sampling when the risk is very low (the underlying leakage rate is fixed at 0.01%).(a) Our method; (b) Robinson et al. (2011)'s method; (c) Fixed 600 samples method.The bars' height shows the amount of sampling done in that quarter (see left axes).The black line shows the proportion of leakages per quarter (see right axes).

F
I G U R E 8 The minimum recommended number of samples different prior sample sizes with T risk = 1% and T change set at 95% credible interval of the prior distribution.(a) With either zero leakages or one leakage, (b) with fixed past leakage rates.