# Optimisation on shape of a function

This is a basic level question as I have no prior experience with optimizing on shapes. I have a dataset and I am fitting a model to it. The equation of the model I want to fit is

$$R(0,\theta)=\beta_0+\beta_1 \left[ \frac{1-\exp(-\frac{\theta}{\tau_1})}{\frac{\theta}{\tau_1}} \right] + \beta_2 \left[ \frac{1-\exp(-\frac{\theta}{\tau_1})}{\frac{\theta}{\tau_1}} - \exp \left(-\frac{\theta}{\tau_1} \right) \right] + \beta_3 \left[ \frac{1-\exp(-\frac{\theta}{\tau_2})}{\frac{\theta}{\tau_2}} - \exp \left(-\frac{\theta}{\tau_2} \right) \right].$$

Here I have to model $R$ with $\theta$.

Now I want to optimize this data such that the shape of my $\theta$~$R$ graph is of almost fixed shape Something like this.

I have no idea how to proceed with this, so any help would be appreciated.

• you mean, you have a set $(x_i, y_i)$ and you want to simulate them by find a proper function f, such that $y_i = f(x_i) + \epsilon_i$ and $\epsilon_i$ small enough ? Jun 25, 2018 at 10:07
• I have the function f, Its the model i have given in the image, but this model can take various shapes depending on the beta parameters. For example if beta2 is positive the curvature at the maximum of the graph will be downwards and it will come down steeply after the maxima, but as you see in the graph, after maxima the function is almost constant. Jun 25, 2018 at 10:10
• Why don't you explain about what are the shaping parameters and also show us a table of $(x_k,y_k)$ points ? It appears to me as being a kind of interpolation/smoothing problem. A nonlinear one. Jun 25, 2018 at 11:00
• Using Cesareo's notation, you have data points $\{(x_k,y_k)\}_{k=1}^n$ and you want to choose $\beta_i, \tau_i$ to minimize $\sum_{k=1}^n (y_k - R(x_k))^2$, which is also $||\vec{y} - \vec{R}||^2$. Assuming the $\tau_1, \tau_2$ parameters are fixed and you only want to choose $\beta_0, \beta_1, \beta_2, \beta_3$ the problem is easier: Writing $\vec{R} = \beta_0\vec{1} + \beta_1\vec{R}_1 + \beta_2 \vec{R}_2 + \beta_3\vec{R}_3$ then it is equivalent to finding the projection of the data vector $\vec{y}$ onto the space spanned by $\{\vec{1}, \vec{R}_1, \vec{R}_2, \vec{R}_3\}$. Jun 25, 2018 at 13:31
• So then you only have to do a 2-d search over gridpoints in a square of $(\tau_1, \tau_2)$ parameters, for each gridpoint $(\tau_1, \tau_2)$ you can get a simple solution to the corresponding linear regression problem to find the $\beta_i$. (Of course there may be a typo and you also have a $\tau_3$?) Jun 25, 2018 at 13:37