[R-sig-Geo] Parameter tuning of the bfastlite function

Nikolaos Tziokas n|ko@@tz|ok@@ @end|ng |rom gm@||@com
Fri Sep 27 02:19:00 CEST 2024


I am using the bfastlite() function from the BFAST package to run a
time-series analysis. From the author's paper (BFAST Lite: A Lightweight
Break Detection Method for Time Series Analysis) (table 2), I quote:

"Needs parameter tuning to optimise performance, does not differentiate
between breaks in seasonality and trend"

So far, I was fine-tuning the model manually, that is, I was changing the
parameters one by one, which is time-consuming. Does someone have a better
solution regarding the fine-tuning of the model?

To see which parameters of the model achieve the best results, I was
checking the dates in the detected breakpoints (visual inspection). I am
not sure if that method (visual inspection) is appropriate.

I apologize if this question sound a bit vague, so let me expand a little
bit. After running the bfastlite() using the default parameters (i.e., bp =
bfastlite(datats)), we get a result. Is there a way to measure (something
like rmse, or r-squared) how well the algorithm modeled the ts? What I
basically mean is that if there is an index equivalent to let's say rmse
when someone is running a linear regression. For example, what if the
parameter breaks with BIC instead of LWZ detects more accurate the
breakpoints (by visually inspecting the detected breakpoints)? Apart from
the visual inspection, shouldn't be some other way to measure the
performance of the model?

Based on the above, is there a more efficient way to optimize the
parameters of the model (based on some metric)? What do I mean by
optimizing the parameters? I think with an example I can explain it better.
When someone is tuning a random forest model, he/she can perform a full
grid search to find the optimal parameters of the model (mtry, number of
trees, etc) by searching all the possible combinations and for each
combination he/she checks the rmse (or mse, r-squared). Is this what the
authors of the paper meant when they said "Needs parameter tuning to
optimise performance"? And if so, how did they do it?

library(bfast)

plot(simts) # stl object containing simulated NDVI time series
datats <- ts(rowSums(simts$time.series))

# sum of all the components (season,abrupt,remainder)
tsp(datats) <- tsp(simts$time.series) # assign correct time series
attributes
plot(datats)

# Detect breaks. default parameters
bp = bfastlite(datats)
plot(bp)

# optimized model ??????
bp_opt <- bfastlite()

R 4.4.1, bfast 1.6.1, Windows 11.

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list