Exercise

Suspicious timestamps

A confidence interval (CI) for the time of a transaction can indicate a suspicious timestamp. By estimating the parameters mu and kappa of the von Mises distribution on previous timestamps, you can calculate the density (or likelihood) of a new timestamp.

The dataset ts containing all timestamps and the circular package are already loaded. The estimates of the first 24 timestamps are available in your workspace, as well as the probability level alpha set to 95%.

Instructions

100 XP
  • Get the periodic mean (mu) and the concentration (kappa) of the first 24 estimates.
  • Use dvonmises() to estimate the densities of all timestamps in ts.
  • Use dvonmises() and qvonmises() to determine the 95% cutoff value for (1 - alpha)/2). Refer to the slides if necessary!
  • Define the variable time_feature: it should be true if densities are greater than or equal to the cutoff and false otherwise. Submit answer to see which timestamps lie outside the 95% confidence interval.