# How to estimate the confidence interval for a "predicted difference" from a quadratic model?

Assume you have past consumption levels $$c_1, \dots c_n$$ at times $$t_1, \dots t_n$$ and cumulated consumption levels $$y_1=c_1, y_2 = c_1 + c_2, \dots y_n=\sum_{k=1}^{n} c_k$$.
(I use the quadratic term to indicate an expected positive / negative change in the consumption $$c$$.)

The question is, how can we estimate the predicted consumption $$E\left[c_{n+1}\right]$$ at $$t_{n+1}$$ and its variance $$\text{Var}\left(c_{n+1}\right)$$ for a $$t_{n+1} > t_n$$?

My thoughts are as follows, formulas are in line with the great book by Kutner et. al., "Applied Linear Statistical Models" (2004):
I use a quadratic model $$y \sim 1 + t + t^2$$ to obtain the estimated coefficients $$\hat{\beta}$$ (5.60) and their estimated variance $$\hat{s}^2$$ (5.93). Using these estimates I get the model

$$y\left(t\right) = \hat{\beta_0} + \hat{\beta_1}\cdot t + \hat{\beta_2}\cdot t^2$$

and I can calculate $$E\left[c_{n+1}\right] = \hat{y}\left(t_{n+1}\right) - \hat{y}\left(t_n\right)$$. Then I would estimate the variance $$\text{Var}\left(c_{n+1}\right) = \text{Var}\left(y_{n+1}\right) + \text{Var}\left(y_n\right)$$ as $$y_n$$ and $$y_{n+1}$$ are uncorrelated in case of uncorrelated error terms $$\epsilon_i$$. Then I use similar to (2.33)

$$\left[E\left[c_{n+1}\right] - t_{n-3}\left(1-\frac{\alpha}{2}\right) \cdot \sqrt{\text{Var}\left(c_{n+1}\right)} ; E\left[c_{n+1}\right] + t_{n-3}\left(1-\frac{\alpha}{2}\right) \cdot \sqrt{\text{Var}\left(c_{n+1}\right)} \right]$$

to obtain the $$1- \alpha = 95$$ % confidence interval, where according to (5.100) and (5.98)

$$\text{Var}\left(y_{n+1}\right) = \text{MSE}\cdot \left( 1 + X_{n+1}'\left(X'X\right)^{-1}X_{n+1}\right)$$ $$\text{Var}\left(y_{n}\right) = \text{MSE}\cdot X_n'\left(X'X\right)^{-1}X_n$$

and as (1.22 with 3 parameters)

$$MSE = \frac{\sum \left(y_k - \hat{y}_k\right)^2}{n - 3}, X_k = \left(1, t_k, t_k^2\right)$$

Is this procedure correct?

PS: There are for sure other ways (timeseries, ...) to do the job, but I would be interested, in how far I can get with this approach.