Hi Julien,
I merged your topic with an existing topic on the alternating on/off background method. The answer to your regression question is in the posts above.
That said, I agree that it is a little misleading to show the regression of the alternating on and off-peak (and P-B) measurements, since the regression is not actually utilized in the background correction. It's just displayed as a aid for visualization.
But, I think your alternating on/off measurements look to be doing exactly what they should be doing. That is tracking the relative changes in the on and off-peak intensities over time. And as shown in your on and high and low intensity plots, we see significant drift in the x-ray counts as the glass is damaged. This is a very appropriate application for this acquisition method.
The beauty of the alternating on/off method is that it tracks these intensity drifts through the entire acquisition, therefore characterizing the thing we actually care about, which is the delta between the on and the off-peak intensities (i.e., the net intensity). Look at the P-B plot. The fact that the P-B plot shows more scatter is exactly what one would expect when subtracting two noisy signals from each other. That is, the noise increases in quadrature. In fact what is particularly wonderful about your particular P-B plot example is that it shows that in spite of the large changes over time in the raw data, the P-B values are relatively constant, albeit a little noisy. So I think this is working exactly as intended.
Now, as a reminder, these P-B values are recorded (for documentation purposes) at acquisition time, but the sum of all the sub intervals for the on and high and low off-peak intensities are also summed and stored at acquisition time for subsequent quantification. The basic idea is that one is spreading the beam damage effects on intensity over both the on and off-peak measurements as the sample is damaged, thus producing a more accurate trace element measurement.
You are a coder, so if you are interested in the gory details, I can send you the acquisition code module (it is over 30K characters so I can't post it here).