6
$\begingroup$

so this is getting a little complex for me and hope someone can help me out. I do not have a mathematical background. I have a time series of daily rainfall for 50 years for a particular location. That location is marked by a very defined rainy season (normally starting around first week of June every year). Therefore you would expect a sudden surge of rainfall around June which lasts for approx 2-3 months and then subsides down.

I was interested to know what sort of statistical or mathematical techniques can be used to mark the dates for each year when the monsoon begins. Basically I want to compute the rough onset dates for each year.

Sorry if this question is a little vague.

Thanks

$\endgroup$
1
  • 3
    $\begingroup$ Put a plot up of the data :) Hopefully with one line for each year starting mid-dry season. $\endgroup$ Commented May 21, 2015 at 23:13

4 Answers 4

1
$\begingroup$

You could use Outlier Detection from Time Series (Zhao - R and data mining). Time Series Decomposition - Outlier Detection

The first chart is the original time series, the second the seasonality , the third shows the trend and the last one plots the outliers on top of the remaining components after removing trend and seasonality. Reproducible example code:

# use robust fitting
f <- stl(AirPassengers, "periodic", robust=TRUE)
(outliers <- which(f$weights<1e-8))

# set layout
op <- par(mar=c(0, 4, 0, 3), oma=c(5, 0, 4, 0), mfcol=c(4, 1))
plot(f, set.pars=NULL)
sts <- f$time.series

# plot outliers
points(time(sts)[outliers], sts[,"remainder"][outliers], pch="x", col="red", cex=2)
par(op) # reset layout
$\endgroup$
0
0
$\begingroup$

This really depends on what the data looks like.

Without a plot and from the description it sounds like the mean increases during the rainy season. If it is just a case of a baseline value of rainfall outside the rainy season and then this switches to another (higher) baseline during rainfall season then you are looking at a change in mean model. You can fit this using the cpt.mean function in the R package changepoint.

Alternatively, if there aren't really two baselines and during the rainy season you can see an increase in the mean but it isn't really constant and the variability is higher then you might want to transform your data. The easiest way to do this is to take first differences, i.e. $x_2-x_1$ (you can use the diff function in R). Then you find the changepoint in the differences you would use the cpt.var function in the changepoint package.

Both of these find changes in the mean and variance respectively. Without seeing the data it is hard to know which one (if either) might be appropriate for your data.

$\endgroup$
0
$\begingroup$

I would start with applying the kernel smoother, such as Gaussian. It'll give you a smooth curve $f(t)$, where you can play with the scale of the length $b$ to get it the curve as smooth as you wish. Now, you can apply analytical methods, such as the first derivative $\frac{df(t)}{dt}>a$, where $a$ is some threshold, to identify the point of onset of the rainfall during the year. Start with graphing the $f(t)$, to get more intuition about the smoothed curve.

$\endgroup$
1
  • $\begingroup$ The question asks for something else: "to compute the rough onset dates for each year." I suspect this mis-match between the question and this answer may be why it has started to collect downvotes. $\endgroup$
    – whuber
    Commented Jan 5, 2015 at 16:17
0
$\begingroup$

If you are just looking at modelling the seasonality in the data, you could use a (possibly non-linear) regression model to predict the rainfall as a function of the sine and cosine of the day of year. If you want to look for changes or trends, then you could include other variables, such as the number of days since the start of the dataset.

However, rainfall data (unless averaged over a very large area) will have lots of zeros, representing days where it didn't rain at all, and this is likely to skew the analysis unless this is taken into account. The method I like best is the mixed Bernoulli-Gamma model devised by Peter Williams, which jointly models the ocurrence and amount processes using a single likelihood. It really is very elegant and I have found it very useful for my work in downscaling rainfall data. I suspect that paper would be of interest to anybody performing statistical analyses of rainfall data (at least at station level). Note this paper discussed modelling of seasonality and trends.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.