Sensor Variability

Necessary Packages

Importing Data

We’re working with data from October across 4-5 sensors.

Creating and Manipulating Variables

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

Let’s Orient Ourselves

Mapping Sensors

Hover over the map points for more information.

Sensor Reading Graphs

Daily Sensors Readings (October)

Hourly Sensors Readings (October)

Boxplots of Ranges

Ranges at each hour of the day (October)

Dean’s Questions:

Which sensors are different and are they constant from day to day?

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).

Difference from Group Over Time (October)

Do they cool and heat differently?

  1. For each sensor we compare temperature values between readings (3 minute intervals) to calculate the rate of change at each instance.

  2. Each instance tells us if that temperature change was maintained this is how much the temperature would change in an hour.

  3. We then average out the rate of change for sensors across periods of “heating” and “cooling”.

  4. Heating and cooling periods are defined by +2 (F) or -2 (F) of degree change, respectively.

Heating vs Cooling Rates by Sensor (October)

Are they taking time to converge to the average?

  1. At each hour, we find the average temperature of all other sensors. (Moving average)

  2. Calculate how far each sensor is from the other sensors’ average

    • Label as “close” (within 1°F) or “far” (1.5°F+ away)
  3. We track when a sensor goes from “close” to “far” (starts diverging) or inverse (converging)

  4. For each episode we track from when the sensor became “far” to when it became “close” again.

  5. 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>

Average time to converge by Sensor (October)