Looking for a time-series jump test package

Are there any Julia packages that can detect time-series jumps?

There are many packages that do this, this being one

If your time series has some known structure or model, you might be able to exploit that as well.

1 Like

Thanks so much for pointing this out. Could show some other similar packages as well?

If your signal has structure

If it has no particular structure, but repeats itself

There are probably a lot of packages doing this in the economic organisation’s as well

I had an old example laying around using LTVModels

using LTVModels, TotalLeastSquares
using LTVModels: matrices, seg_bellman, cost_lin, argmin_lin, cost_ss, argmin_ss
y0 = randn(100) # random input
# construct signal that changes nature after 100 samples
y = [filt(1, [1, 0.9], y0); filt(1, [1, 0.2, 0.6], y0 .+ 5)]
M = 1 # number of change points, computation time for this particular algorithm scales poorly with this choice

# construct input data to alg
x = hankel(y, 10)'
u = ones(1,size(x,2)) # this can be left as ones, not really important.
dn = iddata(x,u,x)
input = matrices(SimpleLTVModel(dn), dn)

@time V,t,a = seg_bellman(input,M, u, cost_ss, argmin_ss, doplot=false)
plot(y, layout=2, title="Signal")
plot!(V, sp=2, title="Change-point cost")

3 Likes