class reliability.Repairable_systems.ROCOF(times_between_failures=None, failure_times=None, CI=0.95, test_end=None, show_plot=True, print_results=True, **kwargs)

Uses the failure times or failure interarrival times to determine if there is a trend in those times. The test for statistical significance is the Laplace test which compares the Laplace test statistic (U) with the z value (z_crit) from the standard normal distribution. If there is a statistically significant trend, the parameters of the model (Lambda_hat and Beta_hat) are calculated. By default the results are printed and a plot of the times and MTBF is plotted.

  • times_between_failures (array, list, optional) – The failure interarrival times. See the Notes below.

  • failure_times (array, list, optional) – The actual failure times. See the Notes below.

  • test_end (int, float, optional) – Use this to specify the end of the test if the test did not end at the time of the last failure. Default = None which will result in the last failure being treated as the end of the test.

  • CI (float) – The confidence interval for the Laplace test. Must be between 0 and 1. Default is 0.95 for 95% CI.

  • show_plot (bool, optional) – If True the plot will be produced. Default = True.

  • print_results (bool, optional) – If True the results will be printed to console. Default = True.

  • kwargs – Plotting keywords that are passed directly to matplotlib (e.g. color, label, linestyle).


  • U (float) – The Laplace test statistic

  • z_crit (tuple) – (lower,upper) bound on z value. This is based on the CI.

  • trend (str) – ‘improving’,’worsening’,’constant’. This is based on the comparison of U with z_crit

  • Beta_hat (float, str) – The Beta parameter for the NHPP Power Law model. Only calculated if the trend is not constant, else a string is returned.

  • Lambda_hat (float, str) – The Lambda parameter for the NHPP Power Law model. Only calculated if the trend is not constant.

  • ROCOF (float, str) – The Rate of OCcurrence Of Failures. Only calculated if the trend is constant. If trend is not constant then ROCOF changes over time in accordance with Beta_hat and Lambda_hat. In this case a string will be returned.


You can specify either times_between_failures OR failure_times but not both. Both options are provided for convenience so the conversion between the two is done internally. failure_times should be the same as np.cumsum(times_between_failures).

The repair time is assumed to be negligible. If the repair times are not negligibly small then you will need to manually adjust your input to factor in the repair times.

If show_plot is True, the ROCOF plot will be produced. Use to show the plot.