LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stationarity test

I wanted to test the TSA Stationarity Test.vi with a simple example. I gave it a vector of length 150, each with value 0.5. The mean and variance based stationarity test returned false. I was expecting both of them to be true since the mean is 0.5 and the variance is 0. Why is it so? See attached vi.

Girish

0 Kudos
Message 1 of 5
(1,111 Views)

I'm not "up" in the mathematics of Stationarity and its tests, but I'm wondering if you've used a "data set" (a constant array) that causes the analysis to "blow up" in such a fashion that it returns zeros.  What happens if you generate a series of random numbers, particularly normally-distributed ones?  

 

Bob Schor

0 Kudos
Message 2 of 5
(1,087 Views)

That is not a very comforting feeling. This is the simplest case of steady state, and instead of blowing up it should check for variance. If variance is 0.0, it should return both True. Is there a way to make a suggestion? I tried with uniform random numbers and it returned both True.

Girish

0 Kudos
Message 3 of 5
(1,072 Views)

I don't have the module that contains the Stationarity Test installed, so cannot comment on whether or not there is a "bug" in NI's implementation, or whether you might just be hitting a case where the test is simply inappropriate (since, as you note, constant data, almost by definition, is stationary, so it makes no logical sense to even test it for stationarity).  A better test would be a "stationary" random number sequence (which you found to be "stationary".  What happens if you add a ramp function to the "stationary noise"?  Do you get "non-stationary"?

 

Does the Help file for the Stationary test discuss the algorithm NI uses?

 

Bob Schor

0 Kudos
Message 4 of 5
(1,048 Views)

I don't think there is a 'bug' in the test. A check for the degenerate case should be included to make it more robust. It should not be the user's responsibility to check for it. For example, I am using this test to monitor the response from a chemical reaction where the composition reaches a constant value asymptotically. Therefore, the trailing numbers will have the same value when the steady state is reached. It will be similar to a vector of constants that I tried in the test case. There will be some noise due to the noise in the measuring instrument. I hope it will work in my case.

Girish

0 Kudos
Message 5 of 5
(1,012 Views)