We’re working with data from October across 4-5 sensors.
I need to:
Convert Time Columns to Dates
Create a date_hour variable to aggregate at hours of each day
Create a date variable to aggregate at each day
Create a box_id variable to shorten the names of the sensor for visualization purposes
Converting Temperature to Fahrenheit with the Temp_F variable
Hover over the map points for more information.
For each hour of the day during October we get the average of other sensors. Then for each sensor we calculate it’s own average to compare to the average of other sensors. We get the variable diff_from_other = avg_heat (of a sensor) - other_sensors_avg (of other sensors).
For each sensor we compare temperature values between readings (3 minute intervals) to calculate the rate of change at each instance.
Each instance tells us if that temperature change was maintained this is how much the temperature would change in an hour.
We then average out the rate of change for sensors across periods of “heating” and “cooling”.
Heating and cooling periods are defined by +2 (F) or -2 (F) of degree change, respectively.
At each hour, we find the average temperature of all other sensors. (Moving average)
Calculate how far each sensor is from the other sensors’ average
We track when a sensor goes from “close” to “far” (starts diverging) or inverse (converging)
For each episode we track from when the sensor became “far” to when it became “close” again.
Average the convergence times across all episodes for each sensor
# A tibble: 8 × 6
box_id phase avg_convergence_time median_convergence_t…¹ max_convergence_time
<int> <chr> <dbl> <dbl> <dbl>
1 4 cooli… 3.88 3.5 7
2 27 cooli… 2.33 2 3
3 5 cooli… 1.57 1 3
4 15 cooli… 1.5 1.5 2
5 27 heati… 12.9 5 29
6 5 heati… 10.1 3 26
7 15 heati… 6.86 2 40
8 4 heati… 6.38 3 45
# ℹ abbreviated name: ¹median_convergence_time
# ℹ 1 more variable: n_episodes <int>