# Developing an Empirical Model for Non-Linear Data

I have collected Temp vs. Time data for a controlled environment. I performed three tests, with the thermocouple in the same location for all three tests. I now have three Temp. vs. Time curves for this location. The graphs are shown here:

I am looking to generate an empirical model based on the Temp. vs. Time at this location that can predict the temperature at this location over time. How should I approach this? My initial approach was to identify the local minima and maxima, and average the three points together (for each maximum and minimum). And then correlate that average to a sequence of time, for example, 30C between 750 and 1250s, or something like that. I really don't think this is an efficient approach...

What do you all think would be an efficient approach to this?

• Are the temperatures related to any temporal events ? The mean is least squares optimal, but perhaps that does not capture some aspect of the sequences which you wish to account for ? WHy are you particularly interested in the extrema ? – image_doctor Aug 19 '15 at 15:50
• So the environment is inside of a coffee roaster, and I have temperature measurements in different areas inside of the enclosure of the system. The picture shows just one of these areas. I also have measurements for Watts, Volts and Amps. Given certain conditions (say, Power draw), I want to predict what the temperature would be in each of these areas that I've tested. – Gary Aug 19 '15 at 16:17

A couple of thoughts...

First as a (former) physicist:

As a scientist/physicist I would likely never be satisfied to analyze the data that you have presented because there are some obvious issues with it. I was initially thinking that it was way to schizophrenic, but then I noticed that you referred to the time units as seconds, in which case this is a pretty slowly varying time series. Are the units really seconds? If they happen to be milliseconds or microseconds then you might want to think about a probe that is less noisy (i.e. a larger probe with more of a temperature sink) and check weather you are seeing the effects of ground loop feedback in your system or just EMF interference from your electrical system.

Secondly, there are clear patterns in the data and these do not line up very well, so I would rerun the experiment with things timed much more accurately. For instance, the event that occurs midway through the experiment that drops the temperature (looks like an icicle or dagger) occurs 5-8 minutes apart in comparing the dark blue experiment to the purple experiment. It would be great if these could be synced better. The point being that if you can't sync them better, then the noise of the time series renders most phenomenon apart from a flat line, almost useless.

Now as a data scientist:

This data is really noisy or at least fluctuates significantly! You should stay away from averaging minima and maxima as you suggest in your post. extrema are very sensitive to noise where as you are trying to reduce the noise in your system.

You should perhaps think about applying some sort of smoothing method to reduce the jitter in your data. Perhaps a second-order exponentially weighted moving average like Holt-Winters.

Finally, you could probably just average the three signals to produce a mean signal. Means are more suseptable to outliers than medians,so the median signal is also an option.

Some other options include separating the trend from the general behavior using some type of de-seasoning or double ARIMA procedure. But, it seems like these are too extreme given that the dagger/icicle event looks significant and you don't want to transform it away. So I would only use these if there is some type of periodicity to your data.

Hope this helps!

• This is a great response! When I try to use the Holt-Winters function, an error is shown telling me that my time series has no or less than 2 periods. How do I correct this issue? – Gary Aug 20 '15 at 12:20
• I answered my own question: HoltWinters(watts, gamma=false) I had to set gamma=false to apply a non-seasonal model. – Gary Aug 20 '15 at 13:02
• I can see some distinct trends. Trends. Now that I've seen these trends, how can I create a "model" based off of these trends? – Gary Aug 20 '15 at 14:41
• That's a whole lot of smoothing. If you think the real temperature varies that slowly then you probably have a bad temperature probe. It not, then I would dial the smoothing way back. Try a linear regression to get things started. But after shaking out the bugs, it seems like you probably want to capture the non-linearity with a nonlinear model like a Support Vector Regression (SVR) – AN6U5 Aug 20 '15 at 20:07