Before starting my answer, let me remark that all your questions concern a general distribution , and isn't really related to the fact that
.
In point 2, the usual definition is indeed with any test function (it is a trivial definition: ; then the specificity of
rely on the fact that
with
).
However, your proof of this fact is incorrect as
are not
. Though I trust the result, but you should find a proof of the fact : if
satisfies
, then
.
For point 1, you should require a sign for . More generally, the definition of
when
is a distribution is
A simple reason for that is to notice that if
for a locally integrable function, then the above definition is equivalent to
.
If you didn't require a sign on
, then using
, you would be lead to point 1!
About your last question:
if is a positive (Radon) measure (depending on the setting you work in, you could consider non-positive measure), then it is a positive distribution.
The converse is true: if
is a positive distribution, then it is of order
, and therefore, according to Riesz representation theorem, can be represented with of positive (Radon) measure. The proof of that is a classical and short exercise (start on a compact set so that you don't have issue with the compact support of test functions)
If you want per second results that don't vary, you'll want to GROUP BY time(1s). This will give you accurate perSecond results.
Consider the following example:
Suppose that the value of the counter at each second changes like so
0s → 1s → 2s → 3s → 4s
1 → 2 → 5 → 8 → 11
Depending on how we group the sequence above, we'll see different results.
Consider the case where we group things into 2s buckets.
0s-2s → 2s-4s
(5-1)/2 → (11-5)/2
2 → 3
versus the 1s buckets
0s-1s → 1s-2s → 2s-3s → 3s-4s
(2-1)/1 → (5-2)/1 → (8-5)/1 → (11-8)/1
1 → 3 → 3 → 3
Addressing
So to me, that means that the value at a given point should not change that much when expanding the time view, since the value should be rate of change per unit (1s in my example query above).
The rate of change per unit is a normalizing factor, independent of the GROUP BY time unit. Interpreting our previous example when we change the derivative interval to 2s may offer some insight.
The exact equation is
∆y/(∆x/tu)
Consider the case where we group things into 1s buckets with a derivative interval of 2s. The result we should see is
0s-1s → 1s-2s → 2s-3s → 3s-4s
2*(2-1)/1 → 2*(5-2)/1 → 2*(8-5)/1 → (11-8)/1
2 → 6 → 6 → 6
This may seem a bit odd, but if you consider what this says it should make sense. When we specify a derivative interval of 2s what we're asking for is what the 2s rate of change is for the 1s GROUP BY bucket.
If we apply similar reasoning to the case of 2s buckets with a derivative interval of 2s is then
0s-2s → 2s-4s
2*(5-1)/2 → 2*(11-5)/2
4 → 6
What we're asking for here is what the 2s rate of change is for the 2s GROUP BY bucket and in the first interval the 2s rate of change would be 4 and the second interval the 2s rate of change would be 6.
@Michael-Desa gives an excellent explanation.
I'd like to augment that answer with a solution to a pretty common metric our company is interested in: "What is the maximum "operation per second" value on a specific measurement field?".
I will use a real-life example from our company.
Scenario Background
We send a lot of data from an RDBMS to redis. When transferring that data, we keep track of 5 counters:
TipTrgUp-> Updates by a business trigger (stored procedure)TipTrgRm-> Removes by a business trigger (stored procedure)TipRprUp-> Updates by an unattended auto-repair batch processTipRprRm-> Removes by an unattended auto-repair batch processTipDmpUp-> Updates by a bulk-dump process
We made a metrics collector that sends the current state of these counters to InfluxDB, with an interval of 1 second (configurable).
Grafana graph 1: low resolution, no true max ops
Here is the grafana query that is useful, but does not show the true max ops when zoomed out (we know it will go to around 500 ops on a normal business day, when no special dumps or maintenance is taking place - otherwise it goes into the thousands):
SELECT
non_negative_derivative(max(TipTrgUp),1s) AS "update/TipTrgUp"
,non_negative_derivative(max(TipTrgRm),1s) AS "remove/TipTrgRm"
,non_negative_derivative(max(TipRprUp),1s) AS "autorepair-up/TipRprUp"
,non_negative_derivative(max(TipRprRm),1s) AS "autorepair-rm/TipRprRm"
,non_negative_derivative(max(TipDmpUp),1s) AS "dump/TipDmpUp"
FROM "$rp"."redis_flux_-transid-d-s"
WHERE
host =~ /$server
timeFilter
GROUP BY time($interval),* fill(null)
Sidenotes: $rp is the name of the retention policy, templated in grafana. We use CQ's to downsample to retention policies with a larger duration. Also note the 1s as a derivative parameter: it is needed, since the default is different when using GROUP BY. This can be easily overlooked in the InfluxDB documentation.
The graph, seen by 24 hours looks like this:

If we simply use a resolution of 1s (as suggested by @Michael-Desa), an enormous amount of data is transferred from influxdb to the client. It works reasonably well (about 10 seconds), but too slow for us.
Grafana graph 2: low and high resolution, true max ops, slow performance
We can however use subqueries to add the true maxops to this graph, which is a slight improvement. A lot less data is transferred to the client, but the InfluxDB server has to do a lot of number crunching. Series B (with maxops prepended in the aliases):
SELECT
max(subTipTrgUp) AS maxopsTipTrgUp
,max(subTipTrgRm) AS maxopsTipTrgRm
,max(subTipRprUp) AS maxopsRprUp
,max(subTipRprRm) AS maxopsTipRprRm
,max(subTipDmpUp) AS maxopsTipDmpUp
FROM (
SELECT
non_negative_derivative(max(TipTrgUp),1s) AS subTipTrgUp
,non_negative_derivative(max(TipTrgRm),1s) AS subTipTrgRm
,non_negative_derivative(max(TipRprUp),1s) AS subTipRprUp
,non_negative_derivative(max(TipRprRm),1s) AS subTipRprRm
,non_negative_derivative(max(TipDmpUp),1s) AS subTipDmpUp
FROM "$rp"."redis_flux_-transid-d-s"
WHERE
host =~ /$server
timeFilter
GROUP BY time(1s),* fill(null)
)
WHERE $timeFilter
GROUP BY time($interval),* fill(null)
Gives:

Grafana graph 3: low and high resolution, true max ops, high performance, pre-calculate by CQ
Our final solution to these kind of metrics (but only when we need a live view, the subquery approach works fine for ad-hoc graphs) is: use a Continuous Query to pre-calculate the true maxops. We generate CQ's like this:
CREATE CONTINUOUS QUERY "redis_flux_-transid-d-s.maxops.1s"
ON telegraf
BEGIN
SELECT
non_negative_derivative(max(TipTrgUp),1s) AS TipTrgUp
,non_negative_derivative(max(TipTrgRm),1s) AS TipTrgRm
,non_negative_derivative(max(TipRprUp),1s) AS TipRprUp
,non_negative_derivative(max(TipRprRm),1s) AS TipRprRm
,non_negative_derivative(max(TipDmpUp),1s) AS TipDmpUp
INTO telegraf.A."redis_flux_-transid-d-s.maxops"
FROM telegraf.A."redis_flux_-transid-d-s"
GROUP BY time(1s),*
END
From here on, it's trivial to use these maxops measurements in grafana. When downsampling to an RP with longer retention, we again use max() as the selector function.
Series B (with .maxops appended in the aliases)
SELECT
max(TipTrgUp) AS "update/TipTrgUp.maxops"
,max(TipTrgRm) AS "remove/TipTrgRm.maxops"
,max(TipRprUp) as "autorepair-up/TipRprUp.maxops"
,max(TipRprRm) as "autorepair-rm/TipRprRm.maxops"
,max(TipDmpUp) as "dump/TipDmpUp.maxops"
FROM "$rp"."redis_flux_-transid-d-s.maxops"
WHERE
host =~ /$server
timeFilter
GROUP BY time($interval),* fill(null)
Gives:

When zoomed in to 1s precision, you can see that the graphs become identical:

Hope this helps, TW
Derivative of nulls is not null
Is it possible to have a null value at a given point of the derivative of function while having this point not a local maximum or minimum? - Mathematics Stack Exchange
Non-negative difference and non-negative derivative aggregate functions
distribution theory - non negative distributional derivative - Mathematics Stack Exchange
There may be a countable number of jump discontinuities.
If $h > 0$, then $f(x+h) \geq f(x+)$ and $f(x-) \geq f(x-h)$ and the derivative must be non-negative where it exists.
$$\frac{f(x+h)-f(x)}{h}\geq 0 \implies \lim_{h \rightarrow 0}\frac{f(x+h)-f(x)}{h}\geq 0$$
$$\frac{f(x)-f(x-h)}{h}\geq 0 \implies \lim_{h \rightarrow 0}\frac{f(x)-f(x-h)}{h}\geq 0$$
Let the function $f$ be monotone non-decreasing. Then wherever the derivative of $f$ exists, it must be non-negative. This follows from the definition of the derivative. If $\lim_{h\to 0^+} \frac{f(a+h)-f(a)}{h}\lt 0$, there must be an $h\gt 0$ such that $\frac{f(a+h)-f(a)}{h}\lt 0$, and hence $f(a+h)\lt f(a)$.
The function $V$ may have an infinite collection of very small intervals where its derivative is bounded away from $0$. It is easy to construct a counterexample if the sum of their lengths is finite.
I think I remember similar questions here before. By contraposition: If k(t) is bounded away from 0, i.e.k(t)> r, then, using the MVT, on each interval (a,b),$\frac {f(b)-f(a)}{b-a}>r(b-a)>>0$ Now apply this to an interval (b,c), then an interval (c,d) , etc. and if you do it long-enough, your f values can become indefinitely-large, i.e., unbounded.
I guess this would be more rigorous: we can construct a collection of intervals $(a_1,a_2),(a_2,a_3),...,(a_k,a_{k+1}),.....$, and applying the MVT on each interval:
$\frac {f(a_2)-f(a_1)}{a_2-a_1}>r(a_2-a_1); \frac{f(a_3)-f(a_2)}{a_3-a_2}>r(a_3-a_2))$, so that $f(a_3)-f(a_1)>r(a_3-a_1)$, so that you get a telescope*, and $\frac {f(a_n)-f(a_{n-1})}{a_n-a_{n-1}}>r(a_n-a_1)$. Then choose $(a_n-a_1)>\frac{2M}{r}$, and you can see your function going away to $\infty $
EDIT: I clearly worked under the assumption that the condition given was that f'(x) is bounded away from 0 as $x\rightarrow \infty$. Like the above reply, we need for f to be bounded away from 0 outside of an interval of finite length for the above argument to hold. One of these days I'll actually read the question, I promise.
*always wondered where that name 'telescope' came from.
$f: f^{(l)}\geq 0$ is called absolutely monotone, or totally monotone; see
https://www.encyclopediaofmath.org/index.php/Absolutely_monotonic_function
The derivative of $g(t)$ can always be computed with the chain rule, so long as $f(t)$ is differentiable. If the function $f(t)$ has the form $f(t) = b(t+c)^a$ where $b,c$ are real constants and $1 < a < 2$, then the derivative of $g(t)$ becomes $$ g'(t) = f'(t)e^{f(t)} = ab(t+c)^{a-1}e^{f(t)}. $$ As long as $t + c > 0$, so we don't need to make sense of possibly taking the $(a-1)$th root of a negative number, for instance, then the derivative $g'(t)$ is positive. When a function's derivative is positive everywhere, that function is an increasing function in the sense that whenever $t_1 < t_2$, then $f(t_1) < f(t_2)$. Moreover, $g(t)$ is infinitely differentiable because it is the composition of two infinitely differentiable functions, one of them being $t\mapsto e^t$ and the other $t\mapsto f(t)$. You could prove this using the chain rule and induction, for instance.
It makes sense to say that if a function is increasing, the first derivative >= 0, but I see that in my book it is written that the first derivative > 0.