R nonlinear regression of cumulative X and Y data

388 views Asked by At

I'm trying to figure how to make a nonlinear regression of some cumulative data of X and Y values. The dataset is based on cumulative items and their respective cumulated demand. I have a plot that looks like this

cumulative demand of cumulative items

based on the following observation of 5299 items, which is available here: abc.csv datafile

and I would like to fit a model that can explain it quite neatly. Given the plot, I reckon that there is a high degree of detail. Hence, I would believe that it would be possible to find a function that would explain the data with very high accuracy.

The problem is, however, that I find myself trying to fit a model with nls() by trial and error. Furthermore, some of the functions that I've tried give me some explanation, but not in full detail. For instance

nlm <- nls(abc$Cumfreq ~c*(1-exp(-a*abc$noe))+b, data=abc, start = list(a=4.14, b=0.21, c=0.79))

Yields me:

With regression

My question is: how do I obtain a regression with a better fit? Is there a function in R or another way of achieving this? (fingers crossed for a math genius out there)

0

There are 0 answers