I'm doing some line fitting on experimental data. Basically I have some array of pixels, and a value measured at each pixel, and I am fitting it with several constrained Gaussians. I'm using a Levenburg-Marquadt nonlinear least squares algorithm called mpfit to fit the parameters, but the results aren't so good due to the existence of background signals in the data.(adsbygoogle = window.adsbygoogle || []).push({});

I'm thinking I could do a better fit using a different "metric" for computing goodness of fit than sum(chi squared error). I want the difference between the model function and the data to be small over many pixels, but not necessarily all of the pixels. That is, I prefer a fit that matches 10 out of 30 pixels very well (but 20 pixels very poorly) over a fit that fits all 30 pixels in a mediocre way. Has anything like this been done before? I don't want to reinvent the wheel.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Non-least squares regression

Loading...

Similar Threads - least squares regression | Date |
---|---|

I The least square method | Aug 9, 2017 |

I Linear least-squares method and row multiplication of matrix | Sep 22, 2016 |

Over constrained least squares analysis | Dec 17, 2015 |

A Least-squares - fitting an inverse function | Aug 22, 2015 |

Nonlinear Least Squares Fitting | Jan 14, 2014 |

**Physics Forums - The Fusion of Science and Community**