Re: Fitting a rational function for a set of data in two column




In article <43ce4290$0$65728$892e7fe2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
sanju_smg@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (sanju_smg) writes:
>Hi everyone
>I want to fit a rational function for a set of data in two columns x
>and y, how do i do?.
>I need to analyse the data, and fit a rational function.
> How to find Asymptote from a set of data in two column x and y.
>Thanx in advance
>
> Regards
>sanjay
>

in principle you can do that as a nonlinear least squares problem,

sum_i { y_i - (sum_{j=0 to n} a_j (x_i)^j)/(1+ sum_{j=1 to m} b_j (x_i)^j) }^2

= min_{a_0,..,a_n,b_1,..,b_m}

where I deliberately have normalized the denominator to have no zero at x=0.
of course you must decide on n and m in advance.
even better, you can transform this into a linear least squares problem by
multiplying through with the denominator :
sum_i {y_i*(1+ sum_{j=1 to m} b_j (x_i)^j)
- (sum_{j=0 to n} a_j (x_i)^j) }^2
= min_{a_0,..,a_n,b_1,..,b_m}
,
but this means that you use the denominator as a weight function for the
data points which can be quite detrimental. at least this linear least squares
case can give you an initial guess for the nonlinear least squares case
above.
there is a problem with this approach: it might turn out that the optimal
discrete least squares solution exhibits poles inside the interval of the
x_i, which occurs quite often even for modest denominator degree if the
data are noisy. hence in principle you must add the (infinite) set
of constraints

(1+ sum_{j=1 to m} b_j (x_i)^j) >=eps>0 for x in [min x_i, max x_i}

this makes it a so called semiinfinite nonlinear optimization problem
but also for this there exists ready to use software .
look in the sections "least squares" and "constrained"
at the page
http://plato.la.asu.edu/topics/problems.html
hth
peter
.



Relevant Pages

  • Re: wims ineq
    ... theorem to know it would be expressible as a sum of squares. ... was a rational function whose denominator ... That numerator was a quadratic polynomial ...
    (sci.math)
  • Re: fsolve - nonlinear equations
    ... but if the sum of squares ... least squares problem via lsqnonlin. ... If you need to enforce explicitly, ... I am trying to solve a system of nonlinear equations using ...
    (comp.soft-sys.matlab)
  • Re: Minimizing the Frobenius norm
    ... the frobenius norm squared is the sum of the squares of the elements of the ... hence you have here a typical "least squares" problem. ... should each of the elements of these matrices be an affine linear ... Otherwise you have a nonlinear least squares problem and need a corresponding ...
    (sci.math.num-analysis)
  • Re: Vandermonde Solution for Least Squares
    ... is it possible to find a least squares parabolic fit for a redundant ... this is a linear least squares problem: ... and in some programming language using one of the many linear least squares ...
    (sci.math.num-analysis)
  • Re: Scaled root of the mean square
    ... sums of squares, rather than a straight sum that is in ... the denominator of the "scaled root of the mean square" forumula ... or "scaled RMS deviation", but none that came with an explanation. ...
    (sci.math)