Skip to content

ENH: out-of-sample cusum, k-step forecast, anomaly detection #3295

Open

Description

@josef-pkt

an idea related to outlier/anomaly detection

(a bit related to cusum control charts *)

If we have rolling or online 1 to k-step ahead (dynamic) forecasts, then we could use the 1 to k CUSUM or just the k-sum prediction error to see if it is an outlier (outside a threshold). This would provide more power to detect multi-period outliers compared to only using one step ahead forecasts.

The simple case would be to assume that the k observations are independent and we can calculate the normal distribution for the k-sum. We have a small correlation in the residuals coming from using the same parameters that are random variables, i.e. with associated cov_params.
With serial correlation as in ARMA, the residuals would also be correlated in themselves, and the joint distribution of k prediction errors or residuals is more difficult. I don't think we have that yet.

(*) semi-random reference:
http://www.jmp.com/support/help/Statistical_Details_for_CUSUM_Control_Charts.shtml#1165418

aside: outlier/anomaly or change point.
Standard CUSUM test is used for change point detection. In this case we don't know why a sequence of observations doesn't correspond to the previous observation, or to the model estimated with those observations. Maybe it's an anomaly, maybe a structural change, maybe our model was wrong in the first place, ...

main question for code: Can we get the joint distribution of several predicted or forecast observations? Or of a linear combination of those predictions or residuals?

related: t_test evaluates several hypothesis separately. wald_test evaluates one joint hypothesis, which might work for a linear prediction.
We don't have anything yet, that provides the joint distribution of several linear combination of parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions