I've built a non-linear time series regression model in R that I would like to write down as an equation, so that I can back-test against my data in an Excel spreadsheet. I've created a .ts object and created a model using the tslm function, as shown below:
model16 <- tslm(production ~ date + I(date^2) + I(date^3) +
I(temp_neg_32^3) +
I(humidity_avg^3) +
I(dew_avg^3) +
below_freezing_min,
data = production_temp_no_outlier.ts)
I find the coefficients for each variable in the model by using the following code:
summary(model16)
The output is below:
So, my understanding is that the equation of my model should be:
y = -7924000000 + 1268000*date -67.62*(date^2) + 0.001202*(date^3) +
0.04395*(temp_neg_32^3) + 0.008658*(humidity_avg^3) -0.03762*(dew_avg^3) + -11930*below_freezing_min
However, whenever I plug the data into this equation, the output is just completely off - it has nothing in common with the fitted curve visualization that I build in R based on this model. So I am clearly doing something wrong. I will be very grateful if someone could help point out my errors!