# Fitting model to data

I have been trying to adapt some of the previous suggestions on other questions similar to my problem but I haven´t been able to solve my problem so far. Best wishes

• The question as it is, gives no clues about what to do! – Cesareo Nov 29 '20 at 17:59
• Yes, I would like to delete the question. It could not get solved and other threads are very similar and have very detailed and excellent solutions to similar problems. For this particular question the solution was not working. Therefore I would ask to delete the whole thread, please – Fred Nov 29 '20 at 21:55

It looks like this question can be answered following the answers in this discussion: "Multi-peak fitting for peak position".

I was too lazy to figure out a basis with the functions you want to fit. (You have listed many parameters.) So, I used the Gaussian function in this answer:

gaussian[amp_, pos_, fwhm_, x_] := 2^(-((4 (-pos + x)^2)/fwhm^2)) amp


Here are the obtained fits:

If you can come up with a reasonable basis using code similar to this one:

aBFuncs =
Association[
Flatten@Table[
pos -> gaussian[amp, pos, fwhm, x], {amp, {1}}, {pos, Min[data[[All, 1]]], Max[data[[All, 1]]], 0.05}, {fwhm, {0.3, 0.1}}]];


then you should be able to get the fits you want.

• Thank you very much for your help! The data is going from top to bottom, so the peaks are not upwards but going from the top downwards. – Fred May 11 '20 at 22:30
• @FredWeker "The data is going from top to bottom, so the peaks are not upwards but going from the top downwards." -- It should not matter if the function basis is chosen right. – Anton Antonov May 12 '20 at 12:22