Time-series forecasting

Here is the data:

l <- data.frame(date = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24))

k <- data.frame(cost = c(25,20,18,15,5,0,0,0,10,15,30,40,45,34,26,20,10,7,4,4,15,34,57,62))

m <- cbind(l,k)

ggplot(m, aes(m$$date,m$$cost)) + geom_line()


This is the graph I get:

What is a good prediction model? I think I can use polynomial regression if I subset the max and min values. see image below for better understanding. (Red for max, blue for min, lines were created using paint to explain a point)

Another way, I don't know what it is called, but I think they use it to predict weather, Not sure what the formula to obtain the blue line below would look like. (Look at graph below for better understanding)

What would be an appropriate formula to get the blue fitted line and predict the points highlighted in red??

• Looks like a cosine curve Commented May 9, 2019 at 17:25

Something simlar to the blue fitted line can be obtained using Holt-Winters model. Check HoltWinters() function from stats package in R.