The current model for singlet fitting uses a VARPRO approach where the linear components (the peak amplitudes) are fitted in a linear least squares step independently from the non-linear (width, frequency, phase) components. This is more efficient because no iteration is needed for those parameters, and it reduces the size of the non-linear search space, however it also makes constraints between the peak amplitudes impossible to introduce, and also gives challenges in returning fit standard errors because of the split in method. I propose to modify the singlet fitting code to use entirely non-linear methods - this will allow much greater alignment with the standard lmfit template and so give more flexibility to the fitting, allowing different optimisation algorithms to be specified, for example.
The current model for singlet fitting uses a VARPRO approach where the linear components (the peak amplitudes) are fitted in a linear least squares step independently from the non-linear (width, frequency, phase) components. This is more efficient because no iteration is needed for those parameters, and it reduces the size of the non-linear search space, however it also makes constraints between the peak amplitudes impossible to introduce, and also gives challenges in returning fit standard errors because of the split in method. I propose to modify the singlet fitting code to use entirely non-linear methods - this will allow much greater alignment with the standard lmfit template and so give more flexibility to the fitting, allowing different optimisation algorithms to be specified, for example.