On 4/11/2012 5:15 PM, L. Mattera wrote:
> Hi
> my name is Lorenzo Mattera, I am using since a short time Mathematica.
> I am trying to solve a fitting problem where two sets of data have to be
> fitted by two models depending on the same parameters.
> I found very helpful the suggestions reported at
> http://forums.wolfram.com/mathgroup/archive/2011/Sep/msg00555.html (and
> references therein) so that I was able to
> produce a working procedure. However, I have a "small" problem:
> the two set of data have quite different weights as one is in the
> 0-100000 range while the other is in the 0-1 range so that one of the two is
> irrelevant in the fitting procedure.
> It seems to me that NonlinearModelFit minimizes the sum of the squared
> residuals,
> any way to minimize the squared normalized residuals?
> Perhaps is one of the options, but so far I could not find it.
> Tank you for the help
> best regards
> L. Mattera
>
You will probably want to use the Weights option in some way, but what
it is set to will depend on the precise meaning of "normalized
residuals". If the desire is to put the contributes to the model on
similar scales, you might use 1/yValuesFromTheData or use
1/Mean[yValuesFromFirstDataSet] for points from the first data set and
1/Mean[yValuesFromSecondDataSet] for points from the second data set.
If you want to scale based on error variation from the two sets and
models, you might get an approximation for the error variations by
fitting the two models separately, and then use
1/model1["ErrorVariance"] to weight the data points from the first data
set and 1/model2["ErrorVariance"] to weight the data points from the
second data set when fitting together, where model1 and modl2 are the
separate fittings for the first and second data sets respectively.
Darren Glosemeyer
Wolfram Research