Jump to content

Removeoutliers function on signals with Gaps


Recommended Posts

  • Super Seeqer

Today in Office Hours I ran into an interesting problem when using the removeoutliers() function on a signal that also had gaps in the data. If you use the function directly on a signal of this type it will not detect the outlier point as you might expect. However there is a quick work around that I will detail below. 

image.png

The signal looks like the one above where the outlier was right after a data gap. In order to work around this problem we chained together a couple of functions in formula. 

$gaps = $signal.isValid()
$signal.validValues().removeOutliers().within($gaps)

Step 1 - create a condition $gaps that captures only the periods of time that contained valid data in the original signal

Step 2 - use the validValue() function to ignore the gaps in the original signal, next run the removeoutliers() function finally add back in the gaps by using the within function 

image.png

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...