Skip to main content
Tweeted twitter.com/StackMma/status/865959900610007041
edited tags
Link
Source Link

Fitting data to a unknown function

I'm researching data which looks somewhat like this:

data

I want to research it's properties, and for that I'd like to approximate it with a function.

Most of the data could be approximated with a x^3 + b x^2 + c x + d, except that the function that should be approximated by this should has a limit at somewhere around 1.05-1.1

So far, I've tried fitting the data to a + b CDF[NormalDistribution[c,d],x] + e CDF[NormalDistribution[g,h],x], since if a fit would be found that would work for me. However, matches that FindFit finds aren't even close to the data.

For example, here's default approximation:

    In[383]:= fit = 
 FindFit[aww, 
  a + b CDF[NormalDistribution[c, d], x] + 
   e CDF[NormalDistribution[f, g], x], {a, b, c, d, e, f, g}, x]

Out[383]= {a -> 8.63749, b -> 95.1976, c -> 385.463, d -> 663.707, 
 e -> -75.2157, f -> -85.3431, g -> -1038.96}

fitted function

Another thing I'm looking for is to use as few parameters (a,b,c,d,e,f,g) as possible in the approximation.

Should I try a different function, or is there a better way to find the fit?

Here's the data I'm working with:

{{0, 0.201519}, {0.693147, 0.339104}, {1.09861, 0.390401}, {1.38629, 
  0.410394}, {1.60944, 0.412307}, {1.79176, 0.417754}, {1.94591, 
  0.435408}, {2.07944, 0.444448}, {2.19722, 0.44524}, {2.30259, 
  0.442406}, {2.3979, 0.447151}, {2.48491, 0.437103}, {2.56495, 
  0.459182}, {2.63906, 0.46491}, {2.70805, 0.471748}, {2.8029, 
  0.468653}, {2.89037, 0.467473}, {2.94444, 0.469316}, {3.02013, 
  0.473278}, {3.11327, 0.47169}, {3.19846, 0.474257}, {3.27697, 
  0.464787}, {3.3669, 0.47889}, {3.46549, 0.49119}, {3.54085, 
  0.483291}, {3.58352, 0.481487}, {3.69704, 0.482514}, {3.77617, 
  0.479843}, {3.87106, 0.482569}, {3.94135, 0.485608}, {4.00722, 
  0.493137}, {4.1106, 0.5}, {4.17863, 0.498063}, {4.27102, 
  0.501595}, {4.35004, 0.501828}, {4.4347, 0.506954}, {4.5269, 
  0.508308}, {4.61155, 0.509924}, {4.68992, 0.518376}, {4.76985, 
  0.522628}, {4.84523, 0.523864}, {4.93102, 0.523511}, {5.02758, 
  0.533681}, {5.10417, 0.533301}, {5.18193, 0.5349}, {5.26333, 
  0.542174}, {5.36073, 0.555209}, {5.43189, 0.557592}, {5.51772, 
  0.563697}, {5.61202, 0.571544}, {5.70691, 0.582026}, {5.76335, 
  0.582014}, {5.85009, 0.5952}, {5.93492, 0.59866}, {6.01713, 
  0.610044}, {6.11193, 0.619297}, {6.17291, 0.628049}, {6.26708, 
  0.637543}, {6.34656, 0.64715}, {6.41987, 0.652515}, {6.51345, 
  0.666603}, {6.61286, 0.678222}, {6.67611, 0.686927}, {6.7542, 
  0.703593}, {6.83354, 0.718134}, {6.92997, 0.735695}, {7.0236, 
  0.757207}, {7.09035, 0.773825}, {7.16482, 0.788462}, {7.25558, 
  0.81023}, {7.36073, 0.833882}, {7.44522, 0.852115}, {7.52476, 
  0.867163}, {7.62487, 0.885581}, {7.72828, 0.909325}, {7.93179, 
  0.94279}, {8.23179, 0.97279}, {8.53179, 0.99279}, {8.83179, 
  1.01079}, {9.11788, 1.01579}, {9.11788, 1.01579}, {9.51788, 1.0209}}