what is your opinion for the best function can be fitted to these plots?

62 Views Asked by At

I have three sets of data (x,f(x)) as follows:

setA={{0., -0.089772065541}, {0.405465108108, -0.108090184631}, \
{0.69314718056, -0.12075482495}, {1.09861228867, -0.136713310362}, \
{2.30258509299, -0.157557628096}, {3.91202300543, -0.124471537798}, \
{5.33271879327, -0.0801408424879}, {5.99146454711, -0.0626234699497}, \
{6.80239476332, -0.0451132549058}, {7.51534457118, -0.0332461226979}}

setB={{0., -2.73726021706}, {0.405465108108, -2.5635349861}, \
{0.69314718056, -2.45687874502}, {1.09861228867, -2.33885028583}, \
{2.30258509299, -2.25010185834}, {3.91202300543, -2.61123676241}, \
{5.33271879327, -3.14138743301}, {5.99146454711, -3.4084055453}, \
{6.80239476332, -3.74171459151}, {7.51534457118, -4.05221791235}}

setC={{0., -0.0513220378362}, {0.405465108108, -0.0598535159266}, \
{0.69314718056, -0.0628371387026}, {1.09861228867, -0.0622774482268}, \
{2.30258509299, -0.0396889415734}, {3.91202300543, -0.0121637513607}, \
{5.33271879327, -0.00330346154785}, {5.99146454711, \
-0.00172143838541}, {6.80239476332, -0.000717519675494}, \
{7.51534457118, -0.000325599564725}}

where their plots respectively are

enter image description here

enter image description here

enter image description here

I look for a function which can be fitted to these data and has small error. I tried the Morse function by Mathematica with the following form $$ a (1 - \exp[-b (x - c)])^4 + d $$ where $a$, $b$, $c$ and $d$ are fit parameters. The fitted plot seem so good as follows respectively

enter image description here

enter image description here

enter image description here

but they have large errors up to 370% (specially in very small data) which is not good at all. As I'm not a mathematician and don't know large category of functions I decided to expose it to discussion in this site hoping that you (who know mathematics well) can help me by suggesting an appropriate function. Thanks in advance.

1

There are 1 best solutions below

2
On

You can fit a polynomial function with the structure

$$ s(x,t) = \sum_{k=1}^nc_k(t)x^k $$

with $c_k(t) = \sum_{j=1}^m \alpha_j t^j$ as follows in the MATHEMATICA script

grA = ListPlot[setA];
grB = ListPlot[setB];
grC = ListPlot[setC];

fA = Fit[setA, {1, x, x^2, x^3, x^4, x^5, x^6}, x];
fB = Fit[setB, {1, x, x^2, x^3, x^4, x^5, x^6}, x];
fC = Fit[setC, {1, x, x^2, x^3, x^4, x^5, x^6}, x];

coeft[pol_, k_] := D[pol, {x, k}]/k! /. {x -> 0}

Ct = Table[Fit[{{0, coeft[fA, k]}, {1/2, coeft[fB, k]}, {1, coeft[fC, k]}}, {1, t, t^2}, t], {k, 0, 6}];

fun = Sum[Ct[[k]] x^(k - 1), {k, 1, 7}];

gr0 = Plot[{fun /. {t -> 0}, fun /. {t -> 1/2}, fun /. {t -> 1}}, {x, 0, 7.6}];
Show[gr0, grA, grB, grC]

Plot3D[fun, {x, 0, 7.6}, {t, 0, 1}, PlotRange -> All]

enter image description here

enter image description here