I cannot define proper equations to return onset time and the relative difference between a valley and the next peak. What is the common used notation for a time series? I have been struggling with set theory and index sets.
Main challenges are to say how many significant peaks exist in a window and what in the onset time of the first significant peak.
I thought about a set S and a set T (which should be ordered and finite, i.e. starting in 1 and finishing in 10). Then, I would store peaks in P and valleys in V and the time indices in TP and TV, respectively, as follows:
=
=
=
=={ ∈ | ( > −1) ⋀ ( ≥ +1) }
=={ ∈ | ( ≤ −1) ⋀ ( < +1) }
= = { ∈ ∶ ∃ ∈ | ( > −1) ⋀ ( ≥ +1) }
= = { ∈ ∶ ∃ ∈ | ( ≤ −1) ⋀ ( < +1) }
=
=
Then, I would look for pairs of valleys and peaks with a difference greater than a threshold, for peaks that are preceded by a valley, as follows:
={ ∈ R* | {−, ∈ ∶ =(<) ⋀ − ≥ ℎ
∅, ∄ ∈ ∶ <
∅, ∄ ∈ ∶ <
}.
={ ∈ R* | {, − ≥ ℎ
∅, ∄ ∈ ∶ <
∅, ∄ ∈ ∶ <
}.
Note: =(<) should stands for the maximum ∈ which is still lower than k. This way we consider only the closest valley just prior to the peak, but I guess the notation is wrong.
Then I can count the significant responses as the cardinality of R. And the onset of the first significant response would be the first element of the finite ordered set TR.
Are the notations right? I'm not sure about that.