Skip to content

Compare's three tables

tsdive compare answers "something changed on this unit, what?". You name every tag of the unit, a period before and a period after, and it prints three tables. Each is a statement about the samples. None names a cause: a recalibrated transmitter, a rate change and a sticking valve can give the same numbers.

$ tsdive compare data/demo/fic101_demo.parquet data/demo/tic101_demo.parquet \
    --before 2024-03-30T20:00:00Z/2024-03-30T23:00:00Z \
    --after 2024-03-31T04:00:00Z/2024-03-31T06:00:00Z
demo  2 tags   refused 0   pairs 1 of 1 clearing

before    2024-03-30 20:00:00Z -> 23:00:00Z   (3 h)
after     2024-03-31 04:00:00Z -> 06:00:00Z   (2 h)
grid      rate 60 s (declared)   coverage 1.000 -> 1.000

Tags that changed
  tag        quality   sigma  spread  flagged  changed at
  TIC101.PV  ok         +0.8    x6.0      62%  2024-03-31 04:18:00Z
  FIC101.PV  ok         +0.4    x0.5       0%  2024-03-31 04:00:00Z

Pairs that decoupled  (Pearson on first differences, 95% block bootstrap)
  pair                   before   after   delta  interval
  FIC101.PV ~ TIC101.PV    0.69    0.17   -0.53  [-0.76, -0.26]

Joint structure  (PCA fitted on before, 2 of 2 tags aligned)
  components 1 of 2   explained 0.9767 -> 0.5129 on after
  rows 121   T2 breaches 70   SPE breaches 108
  SPE contributors   TIC101.PV 50%   FIC101.PV 50%

The headline demo 2 tags refused 0 pairs 1 of 1 clearing counts the tags, the tags whose read was refused, and the pairs that clear. grid is the rate the pair and joint tables align on.

Table 1: tags that changed

One row per tag, every tag listed, ranked by the size of its shift:

column means demo TIC-101
quality the after period's quality against the before period's: ok, a severity share, censored or frozen ok
sigma the level shift: after median minus before median, in before-period sigmas +0.8
spread the spread ratio: after MAD over before MAD x6.0, six times noisier
flagged the share of after samples a MAD screen built on the before period flags 62%
changed at the first changepoint at or after the after period starts, from segment over both periods 04:18

The table lists every tag, so a row with a small shift and 0% flagged, such as FIC-101's +0.4 x0.5 0%, is a tag that did not change much. A column that cannot be computed stays empty and --json gives the reason, such as no spread before for a tag whose MAD was 0.

Table 2: pairs that decoupled

One row per pair of tags. For each period, tsdive takes the Pearson correlation of the first differences, the change from one sample to the next, which removes the slow drift both tags share. delta is after minus before, and interval is a 95% moving block bootstrap interval on that delta. A pair clears when the interval excludes 0: the change is larger than resampling noise.

FIC101.PV ~ TIC101.PV 0.69 0.17 -0.53 [-0.76, -0.26] says the temperature followed the flow minute by minute before, barely after, and the drop is well outside the noise. That is a decoupled pair.

Table 3: joint structure

A PCA fitted on the before period, read on the after period, as mspc does. explained 0.9767 -> 0.5129 on after says one component carried 98% of the before variance and 51% of the after variance: half of the after variance lies off the structure the tags shared. The T2 and SPE breaches count after rows over the before period's limits. The SPE contributors divide the residual of the breach rows over the tags. With two tags the residual splits evenly, 50% each, so the tag table names the tag that changed. See MSPC.

When a table is refused

The pair and joint tables align every tag on one grid, so they need a sample_rate_s on every archive, or --rate-s. Without one they are refused, and the headline lists each refused table with its reason. The tag table still prints, because it reads each tag alone.

What to do

  • Name every tag of the unit, not only the suspect. A tag that changed alone points at that tag; a broken pair points at the relationship.
  • Pick a before period of normal running at the same operating point, clean of clipping. The after period may hold the fault.
  • Use the changed at time to line the change up with the shift log and the operator actions.