Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fit quadratic polynomial and find minimum value and its site??
Date: Thu, 15 May 2008 10:14:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 44
Message-ID: <g0h2d9$m7q$1@fred.mathworks.com>
References: <g0gvl6$l97$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210846441 22778 172.30.248.35 (15 May 2008 10:14:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 May 2008 10:14:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:468542


"Rajesh Acharya" <rv_acharya@yahoo.com> wrote in message 
<g0gvl6$l97$1@fred.mathworks.com>...
> Hello,
> I have a set of data 
> y = (say) 199 175 163 155 (142) 153 168 179 .. total 30 
> numbers 
> x= 1 2 3 4 5 ....29 30.
> 
> i fit a second order polynomial to this using polyfit and 
> find the coeficients in descending order. 
>  
> now i want to find the 'minimum value' of 'y' and its site 
> with respect to x i.e. in this data y minimum is (142) 
> which is at x=5 but infact the polynomial may be reaching a 
> further minimum value between x=5 and 6 say 5.2145 etc... 
> how to find such a value of x at which the polynomial is 
> minimum using the above polynomial????
> or
> is there another method to find a quadratic function which 
> fits the above data and which i can solve easily to find 
> minval and minsite???
> 
>  I tried 'fnmin' which requires spline/cubic fit but i did 
> not succeed in getting minimum value 
> this is what i did: 
>    fun=spline(X,[0 Y 0]);
>    [minval minsite]= fnmin(fun, X); %interval-X
> for the actual data that i have (not the above one) i got 
> minsite = 2 which was not the site for minval. the min 
> value was at x=13 and i wanted further refinement in x... 
> 
> what could be the solution???

Why would fitting a spline necessarily
reproduce the shape and location of the
minimum of the least squares quadratic
polynomial?

You have the quadratic polynomial.

What do you know about the location
of the minimum of a quadratic?

John