I have plotted my xts time series as following:
library(xts)
data(sample_matrix)
prices <- as.xts(sample_matrix)[,"Close"]
pw_returns <- diff(log(prices))
plot(pw_returns, main="", col="darkblue", lwd=1)
I would like to highlight volatility clusters as it has been done in the following graph:
someone knows how to do it in R?