How do you predict data that contains multiple levels of nearly constant data?
Simple linear models even with weights (exponential) did not cut it.
I experimented with some clustering and then robust linear regression but my problem is that the relationship between these levels of constant data is lost.
Here is the data:
structure(list(date = structure(c(32L, 10L, 11L, 14L, 5L, 6L,
1L, 2L, 12L, 9L, 19L, 13L, 4L, 17L, 15L, 3L, 18L, 7L, 8L, 21L,
16L, 22L, 28L, 29L, 30L, 26L, 27L, 31L, 20L, 23L, 24L, 25L), .Label = c("18.02.13",
"18.03.13", "18.11.13", "19.08.13", "19.11.12", "20.01.13", "20.01.14",
"20.02.14", "20.05.13", "20.08.12", "20.09.12", "21.04.13", "21.07.13",
"21.10.12", "21.10.13", "22.04.14", "22.09.13", "22.12.13", "23.06.13",
"25.01.15", "25.03.14", "25.05.14", "26.02.15", "26.03.15", "26.04.15",
"26.10.14", "26.11.14", "27.07.14", "27.08.14", "28.09.14", "28.12.14",
"29.03.10"), class = "factor"), amount = c(-4, -12.4, -9.9, -9.9,
-9.94, -14.29, -9.97, -9.9, -9.9, -9.9, -9.9, -9.9, -9.9, -9.9,
-9.9, -9.9, -9.9, -4, -4, -11.9, -11.9, -11.9, -11.9, -11.98,
-11.98, -11.9, -13.8, -11.64, -11.96, -11.9, -11.9, -11.9)), .Names = c("date",
"amount"), class = "data.frame", row.names = c(NA, -32L))
revisiting rollmedian
@Gaurav - you asked: Have you tried building a model with moving averages? as ARIMA didn't work - I did not try it. But I have now.
zoo::rollmedian(rollTS, 5)
Seems to get the pattern of the data. However I wonder now how to reasonably forecast it. Is this possible?