I'm working with monthly data. Have to forecast drug sales. Also, the data points are less in count.
library("readxl")
library(dplyr)
library(doBy)
library("TTR")
library(forecast)
ts_dr1
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2016 0 0 0 0 0 0 0 0 0 0
2017 0 0 0 0 4341 3993 3495 2478 337
>dput(ts_dr1)
structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4417, 4135,
3118, 2415, 500), .Tsp = c(2016.16666666667, 2017.66666666667,
12), class = "ts")
However, when i try to convert monthly data into quarter (as none of the functions is working with less than 2 periods),it doesn't yield expected results.
> quarterly <- aggregate(ts_dr1 , nfrequency=4, mean)
> quarterly
Time Series:
Start = 2016.16666666667
End = 2017.41666666667
Frequency = 4
[1] 0.000 0.000 0.000 0.000 1472.333 3222.667
Problem area: 1) It shows 1 observation ,whereas ideally, it should be 2 . 2) Also,no function is working with these(auto.arima or decompose,etc.):"as the periods are less than 2". Any workaround ! Although, my ultimate aim is to use ARIMAX on it . I'm starting with the univariate(Arima) as this is my 1st project.
Any help would be appreciated.