1 view (last 30 days)

Show older comments

Star Strider
on 29 May 2017

You are doing sequential parameter estimation. A thorough discussion by James V. Beck, an expert in the field, is SEQUENTIAL METHODS IN PARAMETER ESTIMATION available free online.

It includes MATLAB code. (It was written in 2002, so it may be necessary for you to update the code.)

John D'Errico
on 29 May 2017

Edited: John D'Errico
on 29 May 2017

This is not even a question about MATLAB, so I'm not sure why I'm answering, therefore I must be bored. :) People think they can gain so much in problems like this. You don't in general.

If the problem is nonlinear, there is no magic updating scheme at all. Just redo the curve fit, but with one more point. Since you will use the previous start point, the estimation will be a bit more efficient, fairly robust to problems as long as the new point is consistent with the rest. The new iterations will be few since schemes like Gauss-Newton are generally quadratic in their convergence near the solution.

Again though, for the nonlinear case, there is no magic update.

If the model is linear in the parameters, then why are you bothering to ask this? Backslash is really fast. Just add the extra data point and redo the estimate. Yes, there are linear algebraic schemes to update a QR factorization to add an extra row. Then you will need to redo the solve anyway from the newly factored system. Unless you have a HUGE amount of data and you are doing this hugely many times, it will be easier to just redo the fit.

The point is, don't waste your effort in trying to optimize code for a problem that does not need the optimization in the first place. The gain, even IF you truly know what you are doing in the linear algebra won't be huge anyway. And I'm sorry to say, that if you don't know enough about the linear algebra to already have known the answer to this question in the first place, then your code will probably be far less efficient than if you had just redone the curve fit with that extra point included! (Hey, somebody had to say it.)

(IFFFF you can find code that works, written by an expert, that you will be able to use, and learn how to use, then you can gain some speed, IF it works in your MATLAB release. If you need to modify the code to make it run, then don't forget that your time is of some value too.)

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!