Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news.aset.psu.edu!support1-1.mathforum.org!not-for-mail
From: Torsten Hennig <Torsten.Hennig@umsicht.fhg.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: simple parameter estimation
Date: Fri, 10 Oct 2008 06:34:28 EDT
Organization: The Math Forum
Lines: 57
Message-ID: <8782248.1223634898604.JavaMail.jakarta@nitrogen.mathforum.org>
References: <gcmgn2$amq$1@fred.mathworks.com>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1-1.mathforum.org 1223634898 27672 144.118.30.135 (10 Oct 2008 10:34:58 GMT)
X-Complaints-To: news@mathforum.org
NNTP-Posting-Date: Fri, 10 Oct 2008 10:34:58 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:494537


> "John D'Errico" <woodchips@rochester.rr.com> wrote 
> > Then I guess it is time for you to learn what
> > nonlinear regression is. If you have the
> > optimization toolbox,
> > 
> > help lsqnonlin
> > help lsqcurvefit
> > 
> > John
> 
> I guess those functions work out with non-linear
> equations, but it's with the derivatives that I am
> worried about. How to tell MATLAB they are not just
> non-linear equations?
> 
> Thanks!

Assume for a moment that you know the analytical 
solution for your system of ordinary differential
equations, say y_i(t,a,b,c) (i=1,2,3).

Then the problem to determine optimal parameters
can be formulated as

min_{a,b,c}: 
sum_{j=1}^{n} sum_{i=1}^{3} 
(y_i(t_j,a,b,c)-y_measured_i(t_j))^2

where the t_j are times where measurements for the
y_i are available.

This would define a normal nonlinear 
parameter fitting problem for which you could use
lsqnonlin, lsqcurvefit.

Now in your case an analytical solution for the 
above system of differential equations 
seems hard to determine.

For this reason, you have to couple ODE45 and one of the
parameter estimation routines:

In each step k, you get suggestions for parameters 
a_k, b_k, c_k from lsqnonlin or lsqcurvefit.
With these parameters, you call ODE45 to
determine the y_i(t_j,a_k,b_k,c_k) and transfer 
these values to lsqnonlin or lsqcurvefit.
In the next step, lsqnonlin or lsqcurvefit will 
transfer new a_(k+1), b_(k+1), c_(k+1).
You call ODE45 and so on.

I don't know how this can be implemented in MATLAB 
in practise, but that's the general idea how you 
will have to proceed.

Best wishes
Torsten.