# Convolution Fitting

Here I have a piecewise function g:

f[x_] = Sqrt[0.5/(-x + 0.255)]*Exp[-Sqrt[-0.5*x + 2]] (*I use it in the piecewise function g below*);
g[y_] = Piecewise[{{f[y], 0.0 < y < 0.255}, {f[0], y <= 0.0}, {0.17, y >= 0.255}}]


Then I want to build a convolution function cf which has four arguments t, a, b and c:

cf[t_,a_,b_,c_] = Convolve[g[y], Exp[-1*a*(t - y)^2 + b], y, t] + c


So I use this convolution function to fit my data (you can download it at Google Drive) by using FindFitfunction:

FindFit[data, cf[t,a,b,c], {a,b,c}, t]


Unfortunately, it took so much time to get a result that I suspect there is something wrong in my code.

Any comment would be much appreciated.

• The way it is defined the cf function seems to depend only on a,b,c and x. Is this correct ? – Lotus Mar 23 '18 at 6:47
• In the definition g[y] I see a parameter x on the rigthhand side? Is this ok? – Ulrich Neumann Mar 23 '18 at 7:30
• @UlrichNeumann Yes you are right. Sorry. – user57085 Mar 23 '18 at 7:51
• @Lotus Do you mean there is an argument y in the cf function? – user57085 Mar 23 '18 at 7:57