1
$\begingroup$

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: enter image description here

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)

enter image description here

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??

enter image description here

$\endgroup$
2
$\begingroup$

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

You can find some examples here and here.

| improve this answer | |
$\endgroup$
1
$\begingroup$

By drawing that blue line, you’ve got a view that if things go up they must come back down again. If so, that’s a periodic behavior so ARIMA (or even just arma) would be a good place to start

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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