I am not sure if I am asking on the right place.
But given a set of independent variables $X_i$ and the dependent variable $Y_i = f(X_i, b) +c$, how can I estimate the regression equation given a set of known $(X_i, Y_i)$ (the normal regression analysis) and a constraint on the forecast data $\sum_{r=1}^{r=n} Y_i= T$. Where $T$ is a given number, $\{Y_1,.., Y_n\} $ are the data to be forecast.
In general, what am I supposed to go through to understand how to approach this trend analysis problem with an added constraint.
If you have $$SSQ=\sum_{i=1}^n (ax_i+b - y_i)^2\qquad \text{and} \qquad \sum_{i=1}^n a x_i + b = T$$ this gives $$b=T-a\sum_{i=1}^n x_i=T -a S_x$$ and $$SSQ=\sum_{i=1}^n \big(a(x_i-S_x)+T - y_i\big)^2$$ Computing the derivative with respect to $a$ and setting it equal to $0$ would give $$a=\frac {S_{xy}+(n-1)TS_x-S_xS_y } {(n-2)S_x^2+S_{xx} }\qquad \text{and} \qquad b=T -a S_x$$