Interpolation function



> Thanks for directing me to that. It is close but not exactly what I need 
>    because I want to approximate some experimental data which is a 
> little bit noisy. In this case I think the Lagrange interpolation would 
> give a very wiggly curve, but I will try it anyway.
> 
> Glenn
> 

Ok, I understand.

Maybe interpolation is not the best tool for your problem.

Do you have a theoretical model in mind for your experimental data? In
that case I'd suggest a regression approach.

The Maxima package lsquares can be of some help:

----------------  begin Maxima session ---------------------

(%i1) /* this is a simulation with gaussian noise */
      sample: makelist([i,2*i^2-5*i+2+gauss(0,10)],i,1,10) $
(%i2) load(lsquares)$
(%i3) numer:true$
(%i4) /* fit a polynomial model */
      fitting: part(lsquares(apply(matrix,sample),
                    [x,y],y=a*x^2+b*x+c,[a,b,c]),2);
       Determination Coefficient = 0.976582995949952
                           2
(%o4)    1.94203342953343 x  - 6.795056517556517 x + 19.10244588744589
(%i5) /* construct the prediction function */
      f(x):=''%;
                                2
(%o5) f(x) := 1.94203342953343 x  - 6.795056517556517 x +
19.10244588744589
(%i6) /* plot data together with the estimated model */
plot2d([f(x),[discrete,sample]],[x,0,10],[gnuplot_curve_styles,["with
lines","with points pointsize 3"]])$

----------------  end Maxima session ---------------------

See how the curve doesn't necessarily pass through all experimental
points.

Unfortunately, this is only part of the job:
* How good does your model fit the real process?
* How good are your predictions based on your estimated model?

These questions are related to some statistical inference procedures
which are not (yet) programmed in Maxima, as far as I know.

Glenn, I CC my reply to the mailing list in the hope someone is working
on this.

Good luck

-- 
Mario Rodriguez Riotorto
www.biomates.net