I need to set a nonlinear function through the routines nls
or nlsLM
, however, my data generate heteroscedastic residues when calculated with these routines, which does not allow me to adjust directly through the sum of the squares of the residues
I already have the equation that makes the residues homocedastic, but I do not know how to make the routine use this form to calculate the residuals instead of the direct calculation of (observed-expected) ^ 2