Article View: sci.math.stat
Article #495Re: least squares fit to function
From: William Skelly
Date: Wed, 14 Oct 1992 02:02
Date: Wed, 14 Oct 1992 02:02
36 lines
2222 bytes
2222 bytes
In article <1992Oct13.151606.8435@cbfsb.cb.att.com> rizzo@cbnewsf.cb.att.com (anthony.r.rizzo) writes: >Some time ago, I asked for net-wisdom on the subject of constrained >least squares. Many of you responded, letting me know that I was >on track. First, let me thank all those who responded. I've since >written my own little program to do constrained least square fits >of n-degree polynomials. But now I have a slightly off-the-wall >question for you. Read on. ;-) > >Given some explicitely defined function g(x), say, g(x) = sin(x), >can the method of least square errors be applied such that >we derive a second function f(x) = a0 + a1*x + a2*x^2 + ... + an*x^n >where f(x) is the best least squares fit to g(x)? > >I know that this request sounds strange. But I have a legitimate >application. The application software that I'm using, ANSYS, >forces me to input certain quantities as polynomial functions >of temperature. So I can't get around using a polynomial. >Given this restriction, I at least want to use a best-fit polynomial. > >Has anyone ever heard of this being done before? > >Tony Rizzo > Yes. I think you want to check out Generalised Least-Squares fitting routines. I am currently using the one in Numerical recipes for which fitting a polynomial is straightforward. Press et al. recommend their singular value decomposition over least-squares or weighted least-squares routines. If you figure out how to use it you might let me know how I can find the best fit for a spherical variogram using these routines ;-). Cheers, Chris
Technical Details
Message-ID:
<1992Oct14.020228.26449@mailhost.ocs.mq.edu.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!mel.dit.csiro.au!mineng.dmpe.CSIRO.AU!dmssyd.syd.dms.CSIRO.AU!metro!sunb!laurel.ocs.mq.edu.au!wskellyReferences:
<1992Oct13.151606.8435@cbfsb.cb.att.com>Show Full Headers
Complete Article Headers
Newsgroups: sci.math.stat Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!mel.dit.csiro.au!mineng.dmpe.CSIRO.AU!dmssyd.syd.dms.CSIRO.AU!metro!sunb!laurel.ocs.mq.edu.au!wskelly From: wskelly@laurel.ocs.mq.edu.au (William Skelly) Subject: Re: least squares fit to function Message-ID: <1992Oct14.020228.26449@mailhost.ocs.mq.edu.au> Sender: news@mailhost.ocs.mq.edu.au (Macquarie University News) Nntp-Posting-Host: laurel.ocs.mq.edu.au Organization: Macquarie University, Australia. References: <1992Oct13.151606.8435@cbfsb.cb.att.com> Date: Wed, 14 Oct 1992 02:02:28 GMT Lines: 36