I'm confused about the form of the objective function for some global curve calibration. It seems simple enough: minimized the squared loss of the price of the input instruments and the price stripped off the built curve.
Suppose I want to interpolate rates using cubic splines, then I can write
$$r(a,b,c,d; t) = r(t) = a_i + b_i(t-t_i) + c_i(t-t_i)^2 + d_i(t-t_i)^3$$
where $t_i \leq t < t_{i+1}$ and the maturity of the input instruments are $t_1, t_2, \ldots, t_n.$ We want to find the parameters $a,b,c,d$ such that the the instrument prices stripped from this curve are consistent with the input prices. Write $Z(0,t) = e^{-r(t)\tau(0,t)}$ for the discount factor associated with the rate $r.$
In the case of a par swap (forget OIS discounting for now so that the floating leg is priced at 1) the swap rate $R_j$ is known so we would like to minimize
$$error = \sum_j\left(\frac{1 - Z(0,t_j)}{\sum_{k=1} Z(0,t_k)} - R_j\right)^2$$
which is the squared difference between the swap rate stripped off the interpolated curve and the input rate $R_j$ for each instrument $j$.
Is the correct? Is the error in the correct form? Please feel free to fill in any details I'm missing or clear up confusions I am having.