1
$\begingroup$

I know it's an unusual function to calculate an uncertainty for, but I haven't been able to figure out a reasonable means for calculating derivatives for it to do so myself. I know modular arithmetic extends to complex values, so I don't think it's a matter of being outside the bounds of integer arithmetic.

I'm halfway through writing a generic class (vb.net) implementing propagation of uncertainty. Since the modulus function is little more than an algorithm built on elementary functions, I could replicate the behavior with the class itself, but I would much rather find a way to perform one simple calculation.

Replicating the modulus function with elementary functions using instances of the class I'm writing to propagate the uncertainty would likely introduce excess rounding error and consume an impractical amount of memory for moderately large operands since garbage collection could get bogged down with intermediate values.

So, I guess the real meat of my question lies in whether or not there are formally defined derivatives for the modulus function. Any thoughts?

$\endgroup$
1
  • $\begingroup$ One thought that came to mind overnight is the extant geometric interpretation that naturally arises from polar coordinates: the angle coordinate forms a ring that is naturally, or unnaturally if you favor tau, modulo 2*pi. This still leaves the issue of specifying an appropriate means of propagating uncertainty unanswered if the modulus defining a ring in the set of real numbers is itself a statistic. At this point, the other of the two propagations of error for a single statistic may be defined, which I will put in an answer below. $\endgroup$
    – xenomancer
    Jan 23, 2014 at 18:33

1 Answer 1

0
$\begingroup$

So, this only answers to the first of the three possible situations where propagating uncertainty would be necessary: s mod a, a mod s, and s0 mod s1, where a is a real number and s,s0,s1 are real valued statistics.

The modulus may be thought of in the context of the long division algorithm with multiplication carried out manually by sequential addition: the modulus is subtracted an integer number of times to produce a remainder that is a member of the modular ring. In the case of a statistic as the operand and a real number as the modulus, the remainder should have the same uncertainty as the statistic as the algorithm only involves repeated subtraction (a linear operation) of a value with zero uncertainty (the modulus).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .