I have a sensor that can detect minute changes in distance. It produces a time series.
I would like to point it at people and detect things like their sleeping pattern. How would one build a system that figures out what 'normal' means for this user and can say things like 'over the past 3 months your sleeping pattern has shifted 3 hours, this is bad'.
Here is a picture of what the series looks like over the course of one day
One transformation of it we call position, it tries to illustrate the position the subject holds (laying down, sitting up, etc)
Any and all ideas are welcome. I've skimmed "Time Series Analysis and Its Applications: With R Examples" by Shumway and Stoffer. I think I should explore Spectral Analysis and Filtering due to the cyclical nature of the data. I've been using python/pandas and am looking into doing work with statsmodels and scikit-learn.
EDIT1: Activity is the 'raw' data from the sensor. It is distance (higher values are closer to the sensor) but it's value lies in it's sensitivity. I want to detect breathing patterns if possible. As far as position, I'm not actually sure what the formula for that transformation was, I'll ask the author.