# Useful debugging trick

If you have a thing with lots of indices, such as a fourth-order sampling probability $$\pi_{ijk\ell}$$ (the probability that individuals $$i$$, $$j$$, $$k$$ and $$\ell$$ are all sampled), there will likely be scenarios where it has lots and lots of symmetries.

A useful trick is to write a wrapper that checks them:

FourPi<-function(i,j,k,l){
}
More generally, properties of estimating functions are often easier to check in small samples than properties of the estimators.  This is especially useful when you have an estimator that takes $$\Omega\left(M^2N^2\right)$$ time for large $$N$$ and moderate $$M$$, so you can’t just scale up and use asymptotics.  If the computation time isn’t $$O(N)$$ or near offer, tests you can do with small samples are enormously useful