roqua / physiqual

Ruby Engine for merging various datasources with diary questionnaire data
MIT License
1 stars 1 forks source link

Optimise the heart-rate selection function #68

Closed frbl closed 8 years ago

frbl commented 8 years ago

Currently, when we have a draw in heart-rate peeks (if they are evenly close to the mean), we select the highest of the two. The complete heart-rate selection method will be as follows:

  1. Select the peek after applying top-hat smoothing (if #peeks > 1, go to step 2)
  2. Select the peek closest to the average of all peeks (if there are multiple 'winner' peeks, go to step 3)
  3. Select the average of the two peeks closest two the average.

The reason for selecting the hear-rate using the top-hat kernel methods is because we'd like to know what happened the most often in the past measurement interval. Taking a simple average does not suffice, and taking the mode will yield invalid results if the heart-rates are distributed in a strange way.

frbl commented 8 years ago

fixed in #70