Page’s trend test
Historical context
The statistical discussed so far (MUF, MUF, and SITMUF) are insufficient alone to detect a loss of material. Statistical testing must be performed. For example, the CuMUF test is a simple one that compares the summed MUF values to a threshold. There are many different statistical tests that have been studied and deployed for use in material accountancy. One such test is Page’s trend test. Page has been a popular sequential test given its relatively good performance on a wide range of loss scenarios. Page’s trend test can be applied to any sequence, but is most commonly applied to SITMUF. Page’s trend test on SITMUF specifically is what is implemented in MAPIT.
Theory
Page’s test is similar to CuMUF, but instead of allowing for negative values, the test statistic is constrained to positive values only. Page’s statistic can be defined as:
Where:
is the th page statistic for the sequence
is the previous page statistic (zero if )
is the th element of sequence
is a hyper parameter
An alarm occurs if for some threshold , although is often taken to be constant. Parameter is used to tune the false alarm probability while is designed to give some control over the size loss that the test is designed to detect. Generally, smaller is better for small protracted losses whereas larger is better for detecting abrupt losses. A good rule of thumb is to set where is the magnitude of the loss to detect in terms of material balance standard deviation. In practice, there might be two page’s tests calculated on the same sequence, one for abrupt losses and one for protracted losses, each with a different set of values.
Implementation
Important
Note that this function is not intended to be used standalone through direct calls, rather, it is designed to be called through the MBArea
class of StatsProcessor
.
Note
As of MAPIT 1.4.6, K
value is set to 0.5 and is only adjustable through the API, not the GUI.
The implementation of the trend test is straightforward following the equation given in the theory section. The only addition from the page’s equation above is the tiling in line 808 which copies the page test statistic for all time steps between material balances.
797 for P in range(1,int(MBPs)):
798
799 if P == 1:
800 RZN = inQty[k,int((P - 1) * MBP)]
801 else:
802 RZN = inQty[k,int((P - 2) * MBP)] + inQty[k,int((P - 1) * MBP)] - K
803
804 if RZN < 0:
805 RZN = 0
806
807 PageCalcs[k,int((P - 1) * MBP):int(P * MBP)] = np.ones((MBP,)) * RZN
808