The problems is as follows: you have $n$ points $(x_1,y_1),\dots,(x_n,y_n)$ and you want to fit the following equation to the data points:
$$y=\theta_1\cos(\theta_2 x+\theta_3) + \theta_4\cos(\theta_5 x+\theta_6) + e_k,$$
where $e_k$ is the error. I can replace $x$ by $t$ if needed, as clearly, the context is time series. I am trying to solve this via least squares: the solution is the parameter ($\theta_1^*,\dots,\theta_n^*)$ that minimizes the sum of squared errors. Of course you can compute the gradient, vanish it and then use some Newton-like algorithm to find the solution.
I am wondering if there is a simpler approach. Also, is it a lot easier if the phases $\theta_3,\theta_6$ are zeros? My approach, assuming $\theta_3=\theta_6=0$, is this.
Start with $j=0$ and crude parameter estimates.
At iteration $j+1$, compute the optimum $\theta_2,\theta_5$ using the fixed values $\theta_1,\theta_4$ obtained in the previous iteration.
At iteration $j+1$, compute the optimum $\theta_1,\theta_4$ using the fixed values $\theta_2,\theta_5$ obtained in step 2.
Repeat steps 2 and 3 until convergence.
Is this the best way to handle this problem? How would you do? (not to mention convergence issues)