# Equation fitting

#### CRGreathouse

Homework Helper
I'm almost too embarrassed to post, but I thought someone might have insight that could help me here. I'm trying to fit an equation to data, but I'm just not sure what sort of equation I should use. I have some requirements on the form of the equation, and then I have points (yet to be determined, actually).

$$f'(x)>0\,\,\forall x>0$$ (cost is increasing)
$$f''(x)<0\,\,\forall x>0$$ (essentially, average cost is decreasing)
$$\lim_{x\rightarrow\infty} f(x)=k$$ (price is bounded above in this fashion)

It would make the most sense if the origin was included, but this can be one of the data points.

So before I even think about least-squares vs. minimal points on the curve, I wanted to consider different forms that could make sense. The first that comes to mind was the elementary

$$y=a-\frac{ac}{x+c}$$

but this has some instabilities and oddities. I guess I'm just looking for thoughts on widely-used models that fit my criteria or could be modified to fit them. In the perfect case I'd have a smooth equation that was nearly linear for small x and essentially hyperbolic for large x.

Any suggestions would be welcomed.

S

#### SGT

CRGreathouse said:
I'm almost too embarrassed to post, but I thought someone might have insight that could help me here. I'm trying to fit an equation to data, but I'm just not sure what sort of equation I should use. I have some requirements on the form of the equation, and then I have points (yet to be determined, actually).

$$f'(x)>0\,\,\forall x>0$$ (cost is increasing)
$$f''(x)<0\,\,\forall x>0$$ (essentially, average cost is decreasing)
$$\lim_{x\rightarrow\infty} f(x)=k$$ (price is bounded above in this fashion)

It would make the most sense if the origin was included, but this can be one of the data points.

So before I even think about least-squares vs. minimal points on the curve, I wanted to consider different forms that could make sense. The first that comes to mind was the elementary

$$y=a-\frac{ac}{x+c}$$

but this has some instabilities and oddities. I guess I'm just looking for thoughts on widely-used models that fit my criteria or could be modified to fit them. In the perfect case I'd have a smooth equation that was nearly linear for small x and essentially hyperbolic for large x.

Any suggestions would be welcomed.
One equation that fits your requirements is:
$$f(x) = k(1 - e^{-ax})$$ k > 0 a > 0
Then
$$f´(x) = ak e^{-ax} > 0$$
$$f"(x) = -a^2k e^{-ax} < 0$$

#### CRGreathouse

Homework Helper
SGT said:
One equation that fits your requirements is:
$$f(x) = k(1 - e^{-ax})$$ k > 0 a > 0
Then
$$f´(x) = ak e^{-ax} > 0$$
$$f"(x) = -a^2k e^{-ax} < 0$$
Thanks. You know, I was just so out of it I didn't think to use this.

I'm going to play with this for a while and make it work. You gave me just what I needed to get my brain working again.

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving