Preface - I am a software engineer. I have a rudimental understanding of statistics from some university classes and an ability to google properly. No more. So please excuse my inaccuracies and keep that in mind when answering.

Here is the problem I am trying to solve - I have an athlete and his/her resting heart rate data for let's said the last 30 days. I have a new incoming measurement and I would like to decide whether this new measurement is "abnormal" given the previous data. Either too high or too low given some threshold I decide.

The intuitive way to do this I came up with is to create a probability distribution from the historical data and then decide whether the new incoming value is outside the 10-90% range (arbitrary decision, not important for the question).

To do so, I would need to know what is the proper distribution to choose for the historical data. Eg what distribution does the resting heart rate for one person follow.

Gaussian distribution seems very unlikely since from the mean the values can go much higher than they can go lower. Generally, you can go about 3-4 beats lower from the mean, but it is possible to go even 10 above the mean.

Form my intuition about the shape the curve should have, I think a Beta distribution might be a good fit.

Is there any other probability distribution you would suggest would fit better for this problem? If so, could you provide any intuition or better yet research supporting this suggestion?

  • 1
    $\begingroup$ 'Control charts' have been used by quality management engineers to monitor whether a production process is out of control according to a particular metric. Values are plotted in sequence, and various criteria are used to judge when new values are to be judged suspicious. You may find something useful by googling that topic. $\endgroup$
    – BruceET
    Apr 8, 2020 at 22:22
  • $\begingroup$ ... or look through the tag control-chart $\endgroup$ Apr 8, 2020 at 22:52
  • $\begingroup$ You could profit from general info about heart rates. How is it in a normal population? To echo Ben's answer, besides gathering this data yourself there might already be some data and publications on this topic. In addition, it is important to specify the goals more specifically. For example, I can imagine that this resting heart rate measure is being used to detect whether an athlete might get over-trained. For this purpose you might want to do more than just tracing anomalies. Possibly you want to use averages over multiple days and add additional data sources (like recovery heart rates). $\endgroup$ Mar 22, 2021 at 8:56

2 Answers 2


Rather than trying to re-invent the wheel, I recommend you first review the literature on statistical process control (SPC) and have a look at the existing techniques that are used to determine when a process like this is "out of control". There are broad classes of nonparametric models and methods that are used in this field that do not require any a prior specification of the "in control" distribution being observed. Most of these methods use rank-based tests to determine when new observations are sufficiently aberational from past observations to constitute evidence of a change in the underlying distribution.

Anyway, you can find an overview of nonparametric SPC in Chakraborti et al (2001), and this paper has many references to the statistical literature on this topic. This would be a good place to start your inquiries. This is a very old field of statistical analysis and there is a huge amount written about it. Indeed, you should easily be able to find whole books on the topic. If you want to use a method that avoids making assumptions about the underlying distribution of the values, it is most likely that you will find nonparametric tests and control charts to be useful for what you want to do.

  • 2
    $\begingroup$ Than you for the reference. It seems to me that "control charts" are the way to go and the solution I came up with is actually way too complicated. $\endgroup$ Apr 8, 2020 at 23:17

Comment: A simple beta distribution takes values in $(0,1)$ so that does not seem a good candidate for modeling heart rate. (Perhaps you meant to say 'gamma' distribution.) Furthermore, with data from only 30 days, you might have trouble modeling any particular distribution with sufficient confidence in order to use the model to warn if the data for the most recent day is 'typical'.

Until you have more data, you might note something like quantiles 0.05 and 0.95 of the previous observations and give extra scrutiny to new values outside that range.

Here is a simple example with 50 'heart rates' simulated using a gamma distribution, which you should pretend is not known. Then you might question values below 52 or above 102.

x = rgamma(50, 15, 1/5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  45.26   63.80   75.59   75.73   83.67  147.82 
q = quantile(x, c(.05,.95));  q
      5%      95% 
 52.3706 101.5740 
stripchart(x, pch="|")
abline(v = as.numeric(q), col="red")

enter image description here

  • $\begingroup$ With regards to the amount of data - 30 days was an arbitrary value. I can, of course, have more data if necessary. $\endgroup$ Apr 8, 2020 at 22:58
  • $\begingroup$ With regards to the beta distribution - I was talking about the shape - I think the actual data might be distributed with that shape. So if I transform the curve - scale it, shift it etc. I would get the values I need. $\endgroup$ Apr 8, 2020 at 22:59
  • $\begingroup$ Depending on the shape parameters of a beta distribution, which govern the value and slope of the density curve near 0 and 1, respectively, there are about 25 distinctly different shapes of a beta PDF. Can you say more precisely what shape you;re proposing? Anyhow, with less than 100 observations, you may be better off using quantiles of the data you have--as in my Answer. Modeling the distribution will be realistic when you have much more data. $\endgroup$
    – BruceET
    Apr 8, 2020 at 23:36
  • $\begingroup$ So I meant something like the black one in this image: images.app.goo.gl/zaiBDF6CsGXtAZ9p7. Really short tail on the low end and really long tail on the high end. To satisfy the intuition that the mean is just a slightly higher than the lowest possible resting HR for the person, but given enough stress to the body, the resing HR can climb drastically.. $\endgroup$ Apr 8, 2020 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.