# Non negative time series

I've been given to analyse a continuous non negative time series. Please give me an idea of whether I can use normal time series analysis for this or should I use differently. Also when converting a non-negative series to a time series should I consider this matter and change accordingly or can I just convert it in the usual manner (concerned with r).

I've been also asked to do time series clustering as well.

0.0 0.0 0.0 2.0 5.0 10.0 1.0 0.5 0.0 3.5 2.5 3.5 2.5 2.5 3.5 1.5 21.0 22.0 21.0 23.0 2.5 2.0 2.5 3.0 3.0 2.0 3.5 3.0 3.5 2.0 1.5 0.0 7.0

• What is the goal of the analysis? Prediction? Otherwise? Are the values close to zero or away from zero? Some more context could help. – kjetil b halvorsen Oct 2 '18 at 6:13
• The goal is to predict and also time series clustering. There are values that are exactly equal. – ap123 Oct 2 '18 at 7:10
• We could still do with some more context. What does your measurements represent? Counts of something, sales, speed, ... ? Can you show us a plot? Also don't understand what you mean by "converting a non-negative series to a time series should I consider this matter and change accordingly or can I just convert it in the usual manner"? If you model with arma/arima, do you get negative predictions? – kjetil b halvorsen Oct 2 '18 at 7:55
• please note that one of the time series plot has been uploaded – ap123 Oct 2 '18 at 9:09
• You still didn't give enough context, but what you have plotted could look like a time series of counts. I would look into generalized linear models for time series, googling for "time series modelling for generalized linear models" gives a lot of hits. – kjetil b halvorsen Oct 2 '18 at 9:19

The 33 observations are essentially the # of half-days observed per month. Time series analysis does not require that the observations be integers ,just equally spaced . Think of taking the integer data reflecting airline passengers and expressing it in millions. The identified model wouldn't change ,, just the scale of the parameters.

The non-zero data starts at period 4 thus we have an effective # of 30.

Analysis of the data suggests that there are 4 anomalies and a useful model might be with stats here

The Actual,Fit and Forecast graph is here with forecasts shown for the next 12 months . Since anomalies have occurred in the past , they may occur in the future. I used Monte-Carlo bootstrapping to reflect possible future "pulses" rather than to assume symmetric limits based upon an assumption of normally distributed model errors.

All models are wrong .. but this one seems potentially useful.

If one tried to do this separately by employee .... the data might be too sparse i.e. too many 0's to form a useful model.

• Thank you for the detailed replay. Is there a way I can do this in r – ap123 Oct 2 '18 at 11:20
• There is a free program in R that will identify the pulses cran.r-project.org/web/packages/tsoutliers/tsoutliers.pdf but it requires you to pre-specify the arima component . In this case it is (0,0,0)(0,0,0) . Futhermore it doesn't have the facility to fully develop the forecast via monte-carlo . Secondly there is r version of AUTOBOX which is commercially available that might be appropriate. Thanks for the kudos ... – IrishStat Oct 2 '18 at 11:55
• If my answer has been helpful then upvote it and subsequently accept it to close the question – IrishStat Oct 2 '18 at 12:04