Matlab lsqnonlin problem

Joined
9/12/08
Messages
3
Points
11
hi,
i m running the attched code for minimizing two parameters. However, the lsqnonlin command is giving erratic results, with high residuals. the problem is

1. The parameter x(1) has to be close to 0.5, while x(2) should not be too big less than 10 approx.
2. Also the same values for different row entires indicate an error, so it should vary.

I implemented it in Excel solver and resutls are good but i dont know y matlab is behaving strangely.

I have attached both the code file and data file.. may be someone can help..

thanks.
 

Attachments

I don't have a lot of time to reinstall matlab to try out your code, but just looking at it, i think you can probably improve the code by specifying "valid ranges" of values, and also max numbers of iterations etc.

What I mean is, the matlab code you have now might, for example, use some default maximum of search values, say 1000, and if it hasnt converged to the true result by that time, it quits anyway. Depending on the seed values you supply teh various matlab optimisation routines, they will max out the number of tries, and you will get erratic results.

I had similar problems for a research project, the solution was to specify min/max ranges if you already have an idea of what the true value should be approximately, and to greatly up the number of maximum attempts that the search routine will try before quitting.

Check out the documentation on your lsqnonlin function at the matlab site, it shouild explain in more detail what i was talking about. Let us know how you go.
 
thnxx for ur suggestion ..actually the problem is that it converges on the 1st or second iteration..however, the local minima that it is finding is not wt i m looking for..i try to use bounds, n play with other options but no success..anyhow i m working on it..lets c how it ends up..
 
Back
Top Bottom